Skip to content

COO-1614: feat: APM dashboard: support normalized metric names#1043

Open
andreasgerstmayr wants to merge 1 commit intorhobs:mainfrom
andreasgerstmayr:apm-dashboard-support-normalization
Open

COO-1614: feat: APM dashboard: support normalized metric names#1043
andreasgerstmayr wants to merge 1 commit intorhobs:mainfrom
andreasgerstmayr:apm-dashboard-support-normalization

Conversation

@andreasgerstmayr
Copy link
Copy Markdown
Contributor

@andreasgerstmayr andreasgerstmayr commented Mar 26, 2026

Support normalized Prometheus metric names in the APM dashboard, for example traces_span_metrics_calls_total for the traces.span.metrics.calls OTEL metric.

Ref. https://redhat.atlassian.net/browse/COO-1614

@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Mar 26, 2026

@andreasgerstmayr: This pull request references COO-1614 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature request to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Support normalized Prometheus metric names in the APM dashboard, for example traces_span_metrics_calls_total for the traces.span.metrics.calls OTEL metric.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: andreasgerstmayr
Once this PR has been reviewed and has the lgtm label, please assign jgbernalp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 26, 2026

Hi @andreasgerstmayr. Thanks for your PR.

I'm waiting for a rhobs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 36553c1b-b0be-4f81-8b8a-85228754cb83

📥 Commits

Reviewing files that changed from the base of the PR and between c006ea2 and fb31eab.

📒 Files selected for processing (1)
  • pkg/controllers/uiplugin/apm.go

📝 Walkthrough

Walkthrough

PromQL queries in the APM controller were updated to use regex-based metric name selection for span call and duration metrics (optional suffixes supported), and related request/error rate, operation duration, histogram, and dashboard variable matcher queries were adjusted.

Changes

Cohort / File(s) Summary
APM Controller PromQL Queries
pkg/controllers/uiplugin/apm.go
Replaced direct metric selectors with regex __name__=~"traces_span_metrics_calls(_total)?" and `name=~"traces_span_metrics_duration(_milliseconds)?(_bucket

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding support for normalized metric names in the APM dashboard, which aligns with the file changes updating PromQL queries.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of supporting normalized Prometheus metric names with a concrete example.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Mar 26, 2026

@andreasgerstmayr: This pull request references COO-1614 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature request to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Support normalized Prometheus metric names in the APM dashboard, for example traces_span_metrics_calls_total for the traces.span.metrics.calls OTEL metric.

Ref. https://redhat.atlassian.net/browse/COO-1614

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@andreasgerstmayr andreasgerstmayr force-pushed the apm-dashboard-support-normalization branch from 98fb77b to c006ea2 Compare March 26, 2026 16:50
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/controllers/uiplugin/apm.go`:
- Line 137: The PromQL expression in the query string divides per-series rates
before aggregating, producing a sum of per-series averages; update the
expression in the code that builds the query (the line using fmt.Sprintf with
variableMatchers and span_name) to compute the overall average by dividing two
aggregates: sum(rate(..._sum[5m])) by (span_name) divided by
sum(rate(..._count[5m])) by (span_name), keeping the same metric name regex and
variableMatchers placeholders so you aggregate sums and counts per span_name
before dividing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7999b4d8-fe88-4900-8c64-7fad9730dffd

📥 Commits

Reviewing files that changed from the base of the PR and between cf377a3 and 98fb77b.

📒 Files selected for processing (1)
  • pkg/controllers/uiplugin/apm.go

Support normalized Prometheus metric names in the APM dashboard,
for example traces_span_metrics_calls_total for the traces.span.metrics.calls
OTEL metric.

Ref. https://redhat.atlassian.net/browse/COO-1614

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
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.

2 participants