Skip to content

[exporter/bmchelix] Enrich metric names with datapoint attributes#46771

Open
NassimBtk wants to merge 5 commits intoopen-telemetry:mainfrom
MetricsHub:feature/bmchelix-enrich-metric-names-with-datapoint-attributes
Open

[exporter/bmchelix] Enrich metric names with datapoint attributes#46771
NassimBtk wants to merge 5 commits intoopen-telemetry:mainfrom
MetricsHub:feature/bmchelix-enrich-metric-names-with-datapoint-attributes

Conversation

@NassimBtk
Copy link
Contributor

Description

This pull request enhances the BMC Helix exporter to ensure metric names are uniquely identifiable in BMC Helix Operations Management by enriching them with datapoint attributes and applying normalization for compatibility. It also improves label handling, removes legacy enrichment logic, and updates tests to validate the new enrichment approach and normalization rules.

Metric enrichment and normalization:

  • Metric names are now enriched with non-core datapoint attributes, appended as dot-separated suffixes, and normalized to match BMC Helix compatibility requirements. This ensures unique identification and prevents key collisions. (exporter/bmchelixexporter/internal/operationsmanagement/metrics_producer.go, [1] [2] [3]
  • Entity label values (entityTypeId, entityName) and metric names are normalized to remove invalid characters (e.g., colons) and conform to required patterns. Label values are also normalized (e.g., commas replaced with whitespace). (exporter/bmchelixexporter/internal/operationsmanagement/metrics_producer.go, [1] [2] [3]

Codebase simplification and removal of legacy logic:

  • The legacy enrichMetricNamesWithAttributes function is removed, replaced by the new createEnrichedMetricWithDpAttributes approach for metric enrichment. (exporter/bmchelixexporter/internal/operationsmanagement/metrics_producer.go, [1] [2]

Link to tracking issue

Fixes #46558

Testing

  • Unit tests are updated and expanded to cover the new enrichment logic, normalization rules, and edge cases (e.g., empty metric names are skipped, attribute values are normalized, input metrics are not mutated). (exporter/bmchelixexporter/internal/operationsmanagement/metrics_producer_test.go, [1] [2]
  • Test data is corrected to move host.name to resource attributes, reflecting real-world usage. (exporter/bmchelixexporter/internal/operationsmanagement/metrics_producer_test.go, [1] [2] [3]

Documentation

  • A detailed changelog entry is added, describing the enrichment and normalization changes, their rationale, and compatibility notes for BMC Helix Operations Management. (.chloggen/bmchelix-enrich-metric-names.yaml, .chloggen/bmchelix-enrich-metric-names.yamlR1-R31)

…utes

Developed createEnrichedMetricWithDpAttributes to
enrich metric names with datapoint attribute

Added normalize_metric_name, normalize_label_value
and normalize_entity_value to normalize metric names, label values and
entity values respectively.
@NassimBtk NassimBtk requested review from a team and MovieStoreGuy as code owners March 9, 2026 17:28
@github-actions github-actions bot requested a review from bertysentry March 9, 2026 17:28
@NassimBtk NassimBtk changed the title Issue #46558: Enrich metric names with datapoint attributes [exporter/bmchelix] Enrich metric names with datapoint attributes Mar 9, 2026
Copy link
Contributor

@MovieStoreGuy MovieStoreGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the code, this should be configurable since you're now increasing the cardinality of data being sent.

for k, v := range dpAttributes {
stringMetricAttrs[k] = fmt.Sprintf("%v", v)
labels[k] = fmt.Sprintf("%v", v)
normalizedValue := NormalizeLabelValue(fmt.Sprintf("%v", v))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, you can just call fmt.Sprint, no need for the formatting

Copy link
Contributor Author

@NassimBtk NassimBtk Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you! I have fixed two other fmt.Sprintf BTW.

- Added a new configuration option
 `enrich_metric_with_attributes`. This option
  allows users to control whether metric names
  should be enriched with attributes from the data
  points

- Updated the README.md file to include
  information about the new configuration option

- Replaced fmt.Sprintf("%v", value) with
  fmt.Sprint(value)

- Updated unit tests to cover the new feature.
@NassimBtk NassimBtk requested a review from MovieStoreGuy March 11, 2026 10:19
Fixed config.schema.yaml and config.go

Authentication key for external integration link
updated in README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[exporter/bmchelix] Enrich metric names with datapoint attributes for unique identification in BMC Helix Operations Management

3 participants