Compact Span Metrics
Overview
Compact Span Metrics is an optimized metric type designed to improve the performance of the Services and Databases catalog pages, especially in large-scale environments. Traditional Span Metrics can carry very high cardinality, leading to slow load times and limited scalability. Compact Span Metrics addresses this by keeping only the most essential dimensions, reducing metric cardinality while delivering the core insights needed for monitoring and troubleshooting.
- Compact Span Metrics is enabled by default only for Span Metrics users.
- This setup is additive: compact metrics are sent alongside the existing Span Metrics, not as a replacement. This is relevant for both the Services and Databases catalogs.
- When you enable Compact Span Metrics, data in the main catalog pages will appear only from the moment you start sending it.
Key benefits
- Uses essential labels only:
- Services catalog:
service_name,status_code,k8s_cluster_name,span_kind,host.name - Databases catalog:
service_name,status_code,k8s_cluster_name,db_namespace,db_system,host.name
- Services catalog:
- Optional histogram control: the
lehistogram can be disabled to further reduce load. - Reduction in cardinality: lowers metric permutations.
- Low-latency performance: enables much faster load times in large environments.
- Backward compatibility: compact metrics are sent in addition to existing Span Metrics, ensuring no breakage in drilldowns.
Enabling Compact Span Metrics
With Coralogix OTel integration
Using the Coralogix latest integration is strongly recommended, as it’s continuously updated and aligned with the latest OpenTelemetry releases. To benefit from Compact Span Metrics, make sure to upgrade your otel-integration to version v0.0.230 or higher.
The following metrics are enabled by default:
-
Services catalog:
compact_calls_totalcompact_duration_ms_countcompact_duration_ms_sumcompact_duration_ms_bucket
-
Databases catalog:
db_compact_calls_totaldb_compact_duration_ms_countdb_compact_duration_ms_sumdb_compact_duration_ms_bucket
Without Coralogix OTel integration
When compact database metrics are missing
Compact database metrics are not part of the check that enables the new APM, so an account that sends compact service metrics but not compact database metrics still gets the new APM for its services. In that case:
- The Databases scope in the sidebar is unavailable. Hover over it to see why, with links to open the databases in legacy APM and to the setup documentation.
- Selecting a database anywhere in the new APM (a map node, a table row, or an overview) opens its drilldown in legacy APM, carrying over your current time range.
- The welcome dialog reports the service metrics as sending and the database metrics as not sending.
Disabling Compact Span Metrics
You can disable the Services catalog compact metrics (compact_*), the Databases catalog compact metrics (db_compact_*), or both.
With the Coralogix OTel integration
- Update to the latest otel-integration:
v0.0.230or higher. - In your Helm chart configuration, set
compactMetrics.enabled: falseunderspanMetrics(Services catalog) and/ordbMetrics(Databases catalog):
otel-integration:
opentelemetry-agent:
presets:
spanMetrics:
enabled: true
# Services catalog compact metrics (compact_*)
compactMetrics:
enabled: false
dropHistogram: true
# Databases catalog compact metrics (db_compact_*)
dbMetrics:
enabled: true
compactMetrics:
enabled: false
dropHistogram: true
Running your own collector
Remove the compact metrics you no longer need from your collector configuration, then restart the Collector:
- Services catalog: the
spanmetrics/compactconnector and itstraces/compactandmetrics/compactpipelines. - Databases catalog: the
spanmetrics/db_compactconnector and itstraces/db_compactandmetrics/db_compactpipelines.
Also remove the matching forward/compact or forward/db_compact connector from the traces pipeline exporters.
Next steps
Already running Events2Metrics? See Migration from Events2Metrics to Span Metrics for the recommended switchover path.
For per-service visibility into APM volume and cardinality after compact metrics are enabled, use Service Governance in the Metrics Usage Analyzer.