TRACING-6127: feat: add span_kind filter, show p95 latency instead of avg operation duration#1044
Conversation
|
@andreasgerstmayr: This pull request references TRACING-6127 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 task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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. |
|
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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughRenamed service panel from "Duration" to "Latency" and switched P95 latency computation to histogram_quantile; updated operations table units/headers and request-rate series name; added a multi-select Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/controllers/uiplugin/apm.go (1)
101-107: Minor: Error rate unit displays as "req/s" which may be slightly misleading.Using
RequestsPerSecondsUnitfor error rate will display as "req/s", but errors aren't requests. This is a minor semantic mismatch. If Perses provides a more generic "per second" unit, that would be more accurate. Otherwise, this is acceptable for consistency with the request rate column.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/controllers/uiplugin/apm.go` around lines 101 - 107, The Error rate column is using common.RequestsPerSecondsUnit (which renders as "req/s") — update the Format.Unit for the metric with Header "Error rate" (the block where Name is "value `#2`" and Format is a *common.Format) to use a more generic per-second unit if Perses exposes one (e.g., common.PerSecondUnit or similar) instead of RequestsPerSecondsUnit; if no generic unit exists, leave as-is for consistency but add a short inline comment explaining the semantic mismatch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/controllers/uiplugin/apm.go`:
- Around line 101-107: The Error rate column is using
common.RequestsPerSecondsUnit (which renders as "req/s") — update the
Format.Unit for the metric with Header "Error rate" (the block where Name is
"value `#2`" and Format is a *common.Format) to use a more generic per-second unit
if Perses exposes one (e.g., common.PerSecondUnit or similar) instead of
RequestsPerSecondsUnit; if no generic unit exists, leave as-is for consistency
but add a short inline comment explaining the semantic mismatch.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4943b1c9-76cd-4c01-8bef-909e9d321b50
📒 Files selected for processing (1)
pkg/controllers/uiplugin/apm.go
|
/ok-to-test |
|
/hold |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreasgerstmayr, jgbernalp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
… duration * add Span Kind variable to filter by span kind (defaults to SPAN_KIND_SERVER to avoid double-counting) * rename "Duration" to "Latency", and use P95 histogram quantile instead of average operation duration * update error rate unit Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
ad50543 to
5306ca9
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/controllers/uiplugin/apm.go (1)
183-185: Scopespan_kindlabel-values query to active filters.Consider including
namespace="$namespace",service="$collector", andservice_name="$service"in this matcher so variable options stay contextual and avoid broad cluster-wide scans.Proposed diff
labelvalues.PrometheusLabelValues("span_kind", - labelvalues.Matchers(`{__name__=~"traces_span_metrics_calls(_total)?"}`), + labelvalues.Matchers(`{__name__=~"traces_span_metrics_calls(_total)?", namespace="$namespace", service="$collector", service_name="$service"}`), ),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/controllers/uiplugin/apm.go` around lines 183 - 185, The Prometheus label-values query for "span_kind" is currently unscoped and can return cluster-wide values; update the call to labelvalues.PrometheusLabelValues used with labelvalues.Matchers so the matcher includes the active filter labels namespace="$namespace", service="$collector", and service_name="$service" (i.e., add these matchers alongside `{__name__=~"traces_span_metrics_calls(_total)?"}`) to ensure span_kind options are contextual to the selected namespace/collector/service; locate the invocation of labelvalues.PrometheusLabelValues and adjust the labelvalues.Matchers expression accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/controllers/uiplugin/apm.go`:
- Around line 183-185: The Prometheus label-values query for "span_kind" is
currently unscoped and can return cluster-wide values; update the call to
labelvalues.PrometheusLabelValues used with labelvalues.Matchers so the matcher
includes the active filter labels namespace="$namespace", service="$collector",
and service_name="$service" (i.e., add these matchers alongside
`{__name__=~"traces_span_metrics_calls(_total)?"}`) to ensure span_kind options
are contextual to the selected namespace/collector/service; locate the
invocation of labelvalues.PrometheusLabelValues and adjust the
labelvalues.Matchers expression accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c8b66647-736c-42fd-82b2-5b86be1ae9d3
📒 Files selected for processing (1)
pkg/controllers/uiplugin/apm.go
Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
|
@andreasgerstmayr: This pull request references TRACING-6127 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 task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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. |
|
/retest |
|
/unhold |
|
/test observability-operator-e2e |
|
/retest |
Follow-up changes to #1043 (this PR depends on #1043):