Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fapm%2Fgetting-started%2Fusing-compact-span-metric.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fapm%2Fgetting-started%2Fusing-compact-span-metric.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Using compact span metric

## Overview[​](#overview "Direct link to Overview")

Compact span metric is an optimized metric type designed to improve the performance of the APM [Service Catalog](https://docs-docusaurus.kinsta.page/user-guides/apm/features/service-catalog/.md) and [Database Catalog](https://docs-docusaurus.kinsta.page/user-guides/apm/features/database-monitoring/.md) pages, especially in large-scale environments. Traditional [Span Metrics](https://docs-docusaurus.kinsta.page/user-guides/apm/getting-started/span-metrics/.md) 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 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[​](#key-benefits "Direct link to 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`

* **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[​](#enabling-compact-span-metrics "Direct link to Enabling compact span metrics")

### With Coralogix OTel integration[​](#with-coralogix-otel-integration "Direct link to 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:

* 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`

### Without Coralogix OTel integration[​](#without-coralogix-otel-integration "Direct link to Without Coralogix OTel integration")

<!--$?-->

<!--/$-->

## UI changes with compact metric[​](#ui-changes-with-compact-metric "Direct link to 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.
* Service and Database drilldown pages remain unchanged and continue to use all dimensions from the full span metrics.

## Disabling compact span metric[​](#disabling-compact-span-metric "Direct link to 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[​](#next-steps "Direct link to Next steps")

Already running Events2Metrics? See [Migration from Events2Metrics to Span Metrics](https://docs-docusaurus.kinsta.page/user-guides/apm/getting-started/migration-from-e2m/.md) for the recommended switchover path.

For per-service visibility into APM volume and cardinality after compact metrics are enabled, use [Service Governance](https://docs-docusaurus.kinsta.page/user-guides/account-management/payment-and-billing/metrics-usage-analyzer/apm/.md) in the Metrics Usage Analyzer.
