Werk #18209: otel: Create metric for every data point

Component Checks & agents
Title otel: Create metric for every data point
Date Jun 3, 2025
Level Trivial Change
Class New Feature
Compatibility Incompatible - Manual interaction might be required
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Cloud (CCE), Checkmk MSP (CME)
2.4.0p4 Checkmk Cloud (CCE), Checkmk MSP (CME)

Before, only one metric for the first data point with the name of the OpenTelemetry metric name was created in Checkmk.

Now, for every data point a metric is created. The name is generated from the OpenTelemetry metric name and the datapoint attributes following this logic:

  1. Alphabetically sorted <key>_<value> pairs of data point attributes, where leading namespaces are stripped from the key such that only unique keys remain
  2. Concatenate these pairs with __ as separator
  3. If a rate is to be calculated for a metric (e.g. monotonic counters), add a __per_sec suffix
  4. Replace special characters, which are not allowed in metric names in Checkmk, with _

Please note, that because of this change metrics, which were previously created by the OpenTelemetry integration, will no longer be supplied with data. Instead, new metrics following this new naming convention will be created.

Example

Let this be an OpenTelemetry metric to be checked:

{
  "name": "my.counter",
  "unit": "1",
  "description": "I am a Counter",
  "sum": {
    "aggregationTemporality": 1,
    "isMonotonic": true,
    "dataPoints": [
      {
        "asDouble": 5,
        "startTimeUnixNano": "1544712660300000000",
        "timeUnixNano": "1544712660300000000",
        "attributes": [
          {
            "key": "my.counter.name",
            "value": {
              "stringValue": "some value"
            }
          }
        ]
      },
      {
        "asDouble": 5,
        "startTimeUnixNano": "1544712660300000000",
        "timeUnixNano": "1544712660300000000",
        "attributes": [
          {
            "key": "my.counter.attr",
            "value": {
              "stringValue": "some value"
            }
          }
        ]
      },
      {
        "asDouble": 5,
        "startTimeUnixNano": "1544712660300000000",
        "timeUnixNano": "1544712660300000000",
        "attributes": [
          {
            "key": "your.counter.attr",
            "value": {
              "stringValue": "some value"
            }
          }
        ]
      }
    ]
  }
}

This will result in three metrics:

  • name_some_value__per_sec (i.e. the my.counter namespace was removed, because name is unique)
  • my_counter_attr_some_value__per_sec (i.e. the attribute key was not truncated as only the first namespace my makes it unique)
  • your_counter_attr_some_value__per_sec (i.e. the attribute key was not truncated as only the first namespace your makes it unique)

To the list of all Werks