Compact Span Metrics
Overview
Compact Span Metrics is an optimized metric type designed to improve the performance of the APM Service Catalog and Database 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 Service and Database Catalogs.
- When you enable Compact Span Metrics, data in the main catalog pages will appear only from the moment you start sending it. Drilldowns will continue to use the full Span Metrics as before.
Key benefits
- Uses essential labels only:
- Service Catalog:
service_name,status_code,k8s_cluster_name,span_kind,host.name - Database Catalog:
service_name,status_code,k8s_cluster_name,db_namespace,db_system,host.name
- Service 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:
-
Service 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
UI changes with Compact Span Metrics
The following fields are affected when Compact Span Metrics is enabled:
- Unsupported filters are hidden in the main service catalog and db catalog pages.
- Service and Database drilldown pages remain unchanged and continue to use all dimensions from the full Span Metrics.
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.