Skip to content

feat(traces): drill from General-service metric charts to native traces - #90

Merged
wu-sheng merged 3 commits into
mainfrom
feat/metric-trace-drilldown
Jul 2, 2026
Merged

feat(traces): drill from General-service metric charts to native traces#90
wu-sheng merged 3 commits into
mainfrom
feat/metric-trace-drilldown

Conversation

@wu-sheng

@wu-sheng wu-sheng commented Jul 1, 2026

Copy link
Copy Markdown
Member

Why

Requested in discussion #13934: when a service / API's latency or error rate looks abnormal on a trend chart, operators want to click the spike and land on the matching traces instead of hand-building a trace filter. Only latency and success/error metrics have a natural trace criterion, so the drill is scoped to those.

What

  • Metric → native-trace drill on the General service layer. Drill-capable line widgets — Avg Response Time, Response Time Percentile, Error Rate, Apdex, Success Rate, MQ consume latency, across the Service / Instance / Endpoint scopes — carry a traces flag in their header and their datapoints are clickable. Clicking a point pins a small "View slow/error traces →" popover; the link opens the native Traces list in a new browser tab, pre-filtered to that service (and the selected instance / endpoint) and centered on the clicked bucket's window.
    • Latency widget → slowest-first (queryOrder=BY_DURATION) with minTraceDuration = the clicked value.
    • Error / success-rate widget → traceState=ERROR.
    • Throughput / resource widgets offer no drill.
  • Config, not inference. A new optional traceDrill: { mode: 'latency' | 'error' } field on DashboardWidget, authored in the widget editor next to the MQE and enabled only when the layer's native Traces component is on (disabled with a notice otherwise). The bundled General service template stamps the ten eligible widgets; it also works on custom General-service dashboards.
  • Fix: the dashboard "Reading data…" gate hung on Back-from-Traces — a warm vue-query cache repopulates synchronously on remount with no change event, so the freshness watch now runs immediately at mount.
  • Fix: the drill popover no longer stacks under the chart hover tooltip.
  • Remove: the deprecated layerScope widget option. It emitted OAP's scope: All entity (deprecated in the query-protocol since 9.4.0) and no bundled dashboard used it; legacy stored dashboards degrade to normal service scope.

No backend / query-protocol change — minTraceDuration + traceState already exist on the trace query.

Validation

  • type-check, build-ui, build-bff, license:check (0 invalid), lint, test:unit (BFF 172, UI 133) all green.
  • New UI strings translated across all 8 locales (en source + zh-CN / es / pt / ja / ko / de / fr); completeness verified.
  • Rendered against the demo OAP in the dev stack: the traces flag renders on the eligible General-service widgets, a datapoint click opens the pre-filtered Traces tab, and the popover/tooltip no longer overlap.
  • Still worth a focused check on a live OAP before release: the instance/endpoint name → OAP id resolution on the Instance/Endpoint scopes (endpoint id is a serviceId+name composite), and the second-precision centered window.

wu-sheng added 3 commits July 2, 2026 07:48
Click a datapoint on a drill-capable General service line widget — Avg
Response Time, Response Time Percentile, Error Rate, Apdex, Success Rate,
MQ consume latency, across Service / Instance / Endpoint — to open the
native Traces list in a new browser tab, pre-filtered to that service
(and the selected instance / endpoint) and centered on the clicked
bucket's window. Latency widgets open slowest-first with a minimum trace
duration of the clicked value; error / success-rate widgets open with the
trace status set to Error. A "traces" flag in the widget header marks the
eligible charts.

Opt-in per line widget via a new optional `traceDrill` template field
(mode: latency | error), authored in the widget editor next to the MQE
and enabled only on a layer whose native Traces component is on. The
bundled General service layer stamps the ten eligible widgets.

Also:
- fix: the dashboard "Reading data…" gate hung on Back-from-Traces — a
  warm vue-query cache repopulates synchronously on remount with no change
  event, so the freshness watch now runs immediately at mount.
- fix: the drill popover no longer stacks under the chart hover tooltip
  (the clicked chart's tooltip is suppressed while its popover is pinned).
- remove: the deprecated `layerScope` widget option. It emitted OAP's
  `scope: All` entity (deprecated in the query-protocol since 9.4.0) and
  no bundled dashboard used it; legacy stored dashboards degrade to normal
  service scope.
…urce

The drill is config-driven and not bound to any specific layer. The only
environmental gate is whether the layer's Traces component is activated —
key on `caps.traces` (renderer) / `components.traces` (editor) instead of
`traces.source`, which defaulted to `native` when the component was absent
and would have offered the drill on a layer with no Traces tab.
The drill filter (minTraceDuration / traceState) is only consumed by the
native trace view; a Zipkin-only layer's /trace route renders the Zipkin
view, which ignores it. Gate on the Traces component being on AND the
source being native/both, so a Zipkin-only layer never offers a drill that
would open an unfiltered list.
@wu-sheng wu-sheng added this to the 1.0.0 milestone Jul 2, 2026
@wu-sheng wu-sheng added the enhancement New feature or request label Jul 2, 2026
@wu-sheng
wu-sheng merged commit a9922bd into main Jul 2, 2026
8 checks passed
@wu-sheng
wu-sheng deleted the feat/metric-trace-drilldown branch July 2, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants