Metrics Cardinality Analytics

Rapidly analyzing high cardinality fields is key for effective observability. It helps identify specific issues and their causes, like finding a user or a specific endpoint that is causing problems.

Metrics Cardinality Analytics help you determine if you have excessive number of distinct metrics that lead to lower performance in your system. See Cardinality.

Because metrics cardinality is the number of unique combinations of metric names and their labels or dimensions, it determines the possible number of time series in your data.

  • While high cardinality metrics lead to detailed analysis and troubleshooting, they can also complicate data management and reduce query performance.

  • Higher cardinality increases the number of items to iterate over during queries, which affects efficiency.

  • With metrics tools where pricing depends on distinct tag combinations, eliminating spurious values can lead to cost savings.

  • When you define labels carefully, you can manage cardinality in your data, remediating the risk of increase in time series as the volume of ingested data grows.

  • High cardinality is common in cloud-native environments, and can result from migrating legacy infrastructure to a new format.

Determine metrics cardinality

  1. Navigate to the Metrics Cardinality Analytics by clicking the Metrics tab, and selecting Cardinality Analytics:

    Navigate to Metrics cardinality analytics

    See Reported Cardinality Measurements for details of the report.

    • Report by label

    • Report by metric

    1. By default, the report computes cardinality by Label. This example reports the overall cardinality as All cardinality: 294,885.

      Metrics Cardinality report
    2. When you have a very large number of distinct labels, you can search for specific ones by name.

      Here, click Select a label, and choose a tracked label from the drop-down, agent,

      metrics cardinality label select

      And specify its value from Select a value drop-down, otelcol.

      metrics cardinality label value select
    1. The result shows the cardinality of the label agent=otelcol; here, it has the cardinality of 18.

      metrics cardinality label value result
    1. Click the selector next to Show Cardinality page label, and select by metric. The table resets to show the calculations by Metric.

      Metrics Cardinality report
    2. When you have a very large number of distinct metrics or labels, you can search for specific ones by name.

      Here, click Select a metric, and choose a tracked metric from the drop-down.

      metrics cardinality metric select
    3. Observe that in this example, the cardinality of the metric aws_autoscaling_group_and _warm_pool_total_capacity is 10.

      metrics cardinality metric select result
    4. To further refine your investigation, you can select a label that applies to that metric from the Select a label drop-down,

      metrics cardinality metric label select

      And specify its value from Select a value drop-down.

      metrics cardinality metric label value select
    5. The result shows the cardinality of the metric with specified label value; here, it has the cardinality of 1.

      metrics cardinality metric label value result

Adjust cardinality report

By default, the interface limits the display to the top 10 entries by Series Count, yet you can easily change the display.

The demonstrations here build on top of the results Report by label, step 5.

Reverse sort

To show the bottom entries, change the reporting order.

  1. Click the sort order option next to limit to, and select bottom from the drop-down.

    metrics cardinality order reverse select
  2. You can see that the interface now displays the bottom results.

Change sort

To sort by the Value Count of entries instead of the default Series Count, change the sort option.

  1. Click the Series Count selection next to by, and select Value Count from the drop-down.

    metrics cardinality sort select
  2. You can see that the interface now displays the entries in order of Value Count, with the explorer label at the top.

    metrics cardinality sort result

Increase number of entries

To display all results in a table, you can increase the limit.

  1. Click the number next to limit to, and select a new value from the drop-down.

    Here, the new limit will be 25.

    metrics cardinality limit increase select
  2. You can see that the interface now displays more than 10 results; there are 22 in this example.

    metrics cardinality limit increase result

Change the time interval

The default reporting time interval is for the preceding 5 minutes.

The UI supports the maximum time interval of 5 minutes. However, it reports on any contiguous 5 minutes.
  1. To change the reporting time interval:

    metrics cardinality time select
    1. Click the Last 5 minutes selector at the top right of the interface.

    2. In the Calendar picker, change the From and To parameters.

      Notice that the default settings are for the last 5 minutes. This change is to report data for the last 1 minute:

      From

      Change from now-5m to now-1m

      To

      Keep now

    3. [Optional] To specify local time you use in the browser, toggle the Disable UTC selector.

    4. Click Apply Time Range.

  2. The interface now displays the measurements and charts for the specified time interval.

    metrics cardinality time result

Reported Cardinality Measurements

Metrics cardinality reports on these measurements:

Label

The name of the label.

Only in Label Cardinality report.

Metric

The name of the metric.

Only in Metric Cardinality report.

Series Count

The number of series that contain the label or metric, depending on the report.

In both Label Cardinality and Metric Cardinality reports.

Series Percentage

The percent of the series in the system that contain that label or metric, in the specified time period, depending on the report. If all the series contain the label or metric, all show 100%.

In both Label Cardinality and Metric Cardinality reports.

Value Count (1h)

The number of distinct values for the label in the hour preceding the To specification of the time interval. When specifying last 5 minutes, this is equivalent to now-1h.

Only in Label Cardinality report.

Value Count

This value count is for the specified time interval. By default, for the last 5 minutes, now-5m.

Only in Label Cardinality report.

Value Chart

The distribution of value counts over the specified 1 hour interval.

Only in Label Cardinality report.

Series Chart

The distribution of series counts over the specified 1 hour interval.

In both Label Cardinality and Metric Cardinality reports.