Skip to main content

Using compact Span Metrics

Overview​

Compact span metric 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 metric addresses this by keeping only the most essential dimensions, reducing metric cardinality while delivering the core insights needed for monitoring and troubleshooting.

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 the Services and Databases 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:
    • 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
  • 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​

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 metric, 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_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

Without Coralogix OTel integration​

UI changes with compact metric​

The following fields are affected when compact metric is enabled:

  • Unsupported filters are hidden in the main Services and Databases catalog pages.
  • 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:

  1. Update to the latest otel-integration: v0.0.230 or higher.
  2. 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

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.

Last updated on