Skip to content

Replace dots with slashes in OTEL metric families for hierarchical grouping#21371

Merged
ilyam8 merged 4 commits into
masterfrom
copilot/fix-otel-metrics-grouping
Dec 3, 2025
Merged

Replace dots with slashes in OTEL metric families for hierarchical grouping#21371
ilyam8 merged 4 commits into
masterfrom
copilot/fix-otel-metrics-grouping

Conversation

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Contributor
Summary

Fixes #21239

OTEL metrics appear as flat, ungrouped items in the dashboard because the family field uses dots as separators. This change replaces dots with slashes in metric family names to enable hierarchical grouping.

Before: otel.dotnet.exceptions (flat)
After: dotnet/exceptions (grouped under dotnet)

Changes:

  • Rust plugin (src/crates/jf/otel-plugin/src/netdata_chart.rs): Generate family by replacing dots with slashes in the metric name
Test Plan
  • Rust: cargo check passes
Additional Information

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@ilyam8

ilyam8 commented Dec 1, 2025

Copy link
Copy Markdown
Member

@copilot the fix is very simple - we need to replace dots with / for metric families (only family, not chart id or anything else), e.g. otel.dotnet.exceptions => otel/dotnet/exceptions.

@ilyam8

ilyam8 commented Dec 1, 2025

Copy link
Copy Markdown
Member

@copilot

Modify the Go plugin (src/go/otel-collector/exporter/netdataexporter/convert.go) to replace dots with slashes in the family field

No. You don't need to modify any go code. otel is rust only.

…ouping

Modified both the Rust and Go OTEL plugins to use slashes instead of dots
in the family field, enabling hierarchical grouping in the dashboard.

For example:
- Before: otel.dotnet.exceptions
- After: otel/dotnet/exceptions

Also fixed a pre-existing bug in convert_test.go where Convert was called
instead of convert (lowercase).

Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix OTEL metrics grouping in dashboard Replace dots with slashes in OTEL metric families for hierarchical grouping Dec 1, 2025
Copilot AI requested a review from ilyam8 December 1, 2025 13:38
Removed modifications to Go otel-collector code as per review feedback.
The OTEL plugin is Rust-only. The fix only needs to replace dots with
slashes in the family field in the Rust plugin.

Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Contributor Author

@copilot

Modify the Go plugin (src/go/otel-collector/exporter/netdataexporter/convert.go) to replace dots with slashes in the family field
...

Reverted all Go changes in 4c50bb1. The fix now only modifies the Rust plugin's family field.

@ilyam8 ilyam8 marked this pull request as ready for review December 1, 2025 17:03
@ilyam8 ilyam8 requested a review from Ferroin as a code owner December 1, 2025 17:03
@ilyam8

ilyam8 commented Dec 1, 2025

Copy link
Copy Markdown
Member

@copilot remove "otel/" prefix in the family, we don't need it.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

The family field should just use the metric name with dots replaced by slashes,
without the otel/ prefix (e.g., dotnet/exceptions instead of otel/dotnet/exceptions).

Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Contributor Author

@copilot remove "otel/" prefix in the family, we don't need it.

Removed the "otel/" prefix in 0abaa42. The family field now uses just the metric name with dots replaced by slashes (e.g., dotnet/exceptions).

@Ferroin Ferroin requested a review from vkalintiris December 2, 2025 17:28
@Ferroin

Ferroin commented Dec 2, 2025

Copy link
Copy Markdown
Member

Flagging @vkalintiris for review on this as he’s the de-facto code owner.

@ilyam8

ilyam8 commented Dec 3, 2025

Copy link
Copy Markdown
Member

After this change

Screenshot 2025-12-03 at 12 07 34

@ilyam8 ilyam8 merged commit d7f3bf3 into master Dec 3, 2025
118 of 166 checks passed
@ilyam8 ilyam8 deleted the copilot/fix-otel-metrics-grouping branch December 3, 2025 10:09
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Dec 3, 2025
…ouping (netdata#21371)

Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
(cherry picked from commit d7f3bf3)
@stelfrag stelfrag mentioned this pull request Dec 3, 2025
Ferroin pushed a commit that referenced this pull request Dec 3, 2025
…ouping (#21371)

Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
(cherry picked from commit d7f3bf3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OTEL metrics are not grouped in the dashboard

4 participants