Using Compact Span Metric
Overview
The compact span metric 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 metric addresses this by keeping only the most essential dimensions, reducing metric cardinality while delivering the core insights needed for monitoring and troubleshooting.
Compact span metric also unlocks global filters like environment
by default, while remaining fully compatible with existing metrics and drilldowns.
This means you get a faster, leaner, and more responsive experience with no disruption to your current workflows.
Note
- The compact span metric 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 the compact metric, 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
le
histogram 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
- Using the Coralogix latest integration is strongly recommended, as it’s continuously updated and aligned with the latest OpenTelemetry releases.
- Make sure upgrading to version
v0.0.230
or above. - The following metrics will be enabled:
- Service catalog:
- compact_calls_total
- compact_duration_ms_count
- compact_duration_ms_sum
- compact_duration_ms_bucket
- Databases catalog:
- db_compact_calls_total
- db_compact_duration_ms_count
- db_compact_duration_ms_sum
- db_compact_duration_ms_bucket
- Service catalog:
UI changes with compact metric
The following fields are affected when compact metric is enabled:
- Unsupported filters are hidden in the main service catalog and db catalog pages. Only
k8s_cluster_name
is allowed. - Service and Database drilldown pages remain unchanged and continue to use all dimensions from the full span metrics.
Disabling compact span metric
To disable compact span metric, update and configure your OpenTelemetry collector:
- Update to the latest otel-integration:
v0.0.230
or later. - Apply the following preset in your Helm chart configuration:
otel-integration:
opentelemetry-agent:
presets:
spanMetrics:
enabled: true
compactMetrics:
enabled: false
dropHistogram: true
--------
opentelemetry-agent:
presets:
spanMetrics:
enabled: true
dbMetrics:
enabled: true
compactMetrics:
enabled: false
dropHistogram: true
Enabling compact span metric without the Coralogix integration
Using the Coralogix latest integration is strongly recommended, as it’s continuously updated and aligned with the latest OpenTelemetry releases.
If you’re not using the Coralogix OpenTelemetry integration:
- Download the latest Kubernetes manifest from the Coralogix OpenTelemetry integration - it includes the full compact metrics configuration.
- Use it as a reference to align your setup and keep configurations consistent with future updates.