feat: Exemplars for metric & PromQL charts#2536
Conversation
🦋 Changeset detectedLatest commit: d50b65f The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
Greptile SummaryThis PR adds exemplar overlays for metric and PromQL charts. The main changes are:
Confidence Score: 4/5This is close, but the exemplar SQL scoping issue should be fixed before merging.
packages/common-utils/src/core/renderChartConfig.ts Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'main' into feat/exemplars" | Re-trigger Greptile |
E2E Test Results✅ All tests passed • 225 passed • 3 skipped • 1454s
Tests ran across 4 shards in parallel. |
…ated collector config, so the collector container no longer needs SPAN_METRICS_PROM_RW_ENDPOINT in its own environment.
| const where = await renderWhere(whereConfig, metadata); | ||
| const from = renderFrom({ from: whereConfig.from }); | ||
|
|
||
| return concatChSql(' ', [ | ||
| chSql`SELECT | ||
| toUnixTimestamp64Milli(ex_TimeUnix) AS timestamp, | ||
| ex_Value AS value, | ||
| ex_TraceId AS traceId, | ||
| ex_SpanId AS spanId`, | ||
| chSql`FROM ${from}`, |
There was a problem hiding this comment.
The metric-name condition is added to filters, so a chart using filtersLogicalOperator: 'OR' can turn the exemplar WHERE clause into userFilterA OR userFilterB OR MetricName = .... In that case, the exemplar scan can include other metrics whenever a user filter matches, or include this metric outside the intended user filter group. Keep the required metric-name check ANDed separately from the user filter group so exemplar markers stay scoped to the plotted series.
Why
Engineers staring at a latency spike on a chart have no way to jump to a trace that caused it.
This change adds exemplars, clickable markers overlaid on time charts, each linking to a representative trace.
Works for metric and PromQL sources.
Also added some test-telemetry infrastructure to build and validate the feature against more complex data sets.
CleanShot.2026-06-29.at.13.50.52.mp4
What's includedExemplar overlay (app)
Two data backends
Fully-OTLP coherent metrics (collector)
with exemplars from spans, so the duration histogram lands in ClickHouse with Exemplars.* ps — no synthetic/seeded data.
Telemetry generator (telemetry-generator/)
Team setting
Scoping
Out of scope (separate tickets)
Testing
Changesets
Notes / caveats