---
title: Compact Span Metrics
description: 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.
url: https://coralogix.com/docs/user-guides/apm-v2/getting-started/using-compact-span-metric/
product: apm
feature: OTel Span Metrics
feature_id: apm-otel-collector-spanmetrics
feature_identifier: apm/apm-otel-collector-spanmetrics
last_updated: '2026-11-12'
---

# Compact Span Metrics

## Overview

Compact Span Metrics is an optimized metric type designed to improve the performance of the [Services](https://coralogix.com/docs/user-guides/apm-v2/services.md) and [Databases](https://coralogix.com/docs/user-guides/apm-v2/databases.md) catalog pages, especially in large-scale environments. Traditional [Span Metrics](https://coralogix.com/docs/user-guides/apm-v2/getting-started/span-metrics.md) 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.

Note

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

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

Note

`host.name` is one of the compact labels, but the Services and Databases catalogs don't rely on it: services are keyed by `service_name`, and databases by `db_system` and `db_namespace`. Dropping `host.name` is safe and lowers cardinality further; only custom dashboards or alerts that group the compact metrics by host are affected. This is worth doing when spans pass through an OpenTelemetry gateway, where `host.name` is either the gateway's own host or one value per source host, adding cardinality without value. There is no preset toggle for this today: exclude `host.name` from the compact metrics' resource attributes in your collector configuration.

## 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_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

<!--$?-->

<!--/$-->

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

1. Update to the latest otel-integration: `v0.0.230` or higher.
2. In your Helm chart configuration, set `compactMetrics.enabled: false` under `spanMetrics` (Services catalog) and/or `dbMetrics` (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/compact` connector and its `traces/compact` and `metrics/compact` pipelines.
* **Databases catalog**: the `spanmetrics/db_compact` connector and its `traces/db_compact` and `metrics/db_compact` pipelines.

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](https://coralogix.com/docs/user-guides/apm-v2/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://coralogix.com/docs/user-guides/account-management/payment-and-billing/metrics-usage-analyzer/apm.md) in the Metrics Usage Analyzer.
