Skip to content

Enhance metric name disambiguation using attributes #41303

@NassimBtk

Description

@NassimBtk

Component(s)

exporter/bmchelix

Is your feature request related to a problem? Please describe.

This update improves the uniqueness and clarity of exported metric names by enriching them based on label attributes that vary across data points sharing the same entityId and metricName.

Currently, to ensure that each metric name is uniquely identified in BMC Helix Operations Management (BHOM), users use OTTL to append the value of a distinguishing attribute such as state to the metric name.

Example:

- context: datapoint
  statements:
    - set(metric.name, Concat([metric.name, attributes["cpu.mode"]], ".")) where attributes["cpu.mode"] != nil

This transformation will rename metrics like system.cpu.time to system.cpu.time.user or system.cpu.time.system, depending on the cpu.mode value.

So modifying metric.name within a datapoint context causes a conflict when multiple datapoints belong to the same metric, as the name change applies to the entire metric rather than individual datapoints.

Describe the solution you'd like

To ensures the uniqueness of metric names within BMC Helix, we need to enrich metric names with datapoint attributes in the helix exporter:

Example transformation:
Input:

          "metrics": [
            {
              "name": "system.cpu.time",
              "unit": "s",
              "description": "Seconds each logical CPU spent on each mode",
              "gauge": {
                "dataPoints": [
                  {
                    "asDouble": 10,
                    "timeUnixNano": "1544712660300000000",
                    "attributes": [
                      {
                        "key": "cpu.mode",
                        "value": {
                          "stringValue": "system"
                        }
                      }
                    ]
                  },
                  {
                    "asDouble": 20,
                    "timeUnixNano": "1544712660300000000",
                    "attributes": [
                      {
                        "key": "cpu.mode",
                        "value": {
                          "stringValue": "user"
                        }
                      }
                    ]
                  }
                ]
              }
            }
          ]

Helix Output:

{
  "MetricName": "system.cpu.time.user",
  "Samples": [
    {
       "Value": 10,
       "Timestamp":  1544712660300000000
    }
  ]
},
{
  "MetricName": "system.cpu.time.user",
   "Samples": [
    {
       "Value": 20,
       "Timestamp":  1544712660300000000
    }
  ]
}

Describe alternatives you've considered

OTTL!
But works only if there is one metric per state.

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions