Use Adaptive Metrics to reduce cardinality
Documentation
Grafana Cloud
Monitor applications
Application Observability
Set up a Collector
Adaptive Metrics
Grafana Cloud
Use Adaptive Metrics to reduce cardinality
You can use Adaptive Metrics to solve increased cardinality issues and reduce your Grafana Cloud costs.
Set up the Adaptive Metrics HTTP API and upload the following aggregation rules that add the collector_id
label to exported metrics:
json
{
"rules": [
{
"metric": "traces_spanmetrics_latency_sum",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_spanmetrics_latency_count",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_spanmetrics_latency_bucket",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_spanmetrics_calls_total",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_spanmetrics_size_total",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_total",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_failed_total",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_server_seconds_sum",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_server_seconds_count",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_server_seconds_bucket",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_client_seconds_bucket",
"drop_labels": ["collector_id", "namespace", "source"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_client_seconds_sum",
"drop_labels": ["collector_id", "namespace", "source"],
"aggregations": ["sum:counter"]
},
{
"metric": "traces_service_graph_request_client_seconds_count",
"drop_labels": ["collector_id", "namespace", "source"],
"aggregations": ["sum:counter"]
},
{
"metric": "target_info",
"drop_labels": ["collector_id"],
"aggregations": ["sum:counter"]
}
]
}
Was this page helpful?
Related documentation
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
![Intro to Application and Frontend Observability with Grafana Cloud](https://grafana.com/media/webinar/Webinar---Intro-to-Application-and-Frontend-Observability-with-Grafana-Cloud-notext.png?w=200 200w, https://grafana.com/media/webinar/Webinar---Intro-to-Application-and-Frontend-Observability-with-Grafana-Cloud-notext.png?w=400 400w)
Intro to Application and Frontend Observability with Grafana Cloud
Learn about how to monitor application and frontend performance using Grafana’s out-of-the-box dashboards and workflows.
![How to get started with OpenTelemetry and Grafana](https://grafana.com/media/webinar/AMER-otel-grafana-meta-no-text-v2-%281%29.png?w=200 200w, https://grafana.com/media/webinar/AMER-otel-grafana-meta-no-text-v2-%281%29.png?w=400 400w)
How to get started with OpenTelemetry and Grafana
Learn about the essentials of instrumentation and demonstrate how to visualize OpenTelemetry data seamlessly within Grafana and Grafana Cloud.
![Mastering OpenTelemetry instrumentation and Grafana](/media/webinar/AMER-otel-grafana-meta-no-text-v2-%281%29.png?w=200 200w, /media/webinar/AMER-otel-grafana-meta-no-text-v2-%281%29.png?w=400 400w)
Mastering OpenTelemetry instrumentation and Grafana
Learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.