Skip to content

[HDX-5732] Use OTel span events and links in the default Traces source - #288

Merged
SpencerTorres merged 1 commit into
mainfrom
spencer/span-events
Oct 20, 2026
Merged

SpencerTorres merged 1 commit into
mainfrom
spencer/span-events

Conversation

@SpencerTorres

Copy link
Copy Markdown
Member

Summary

Linear: HDX-5732

Updates the default HyperDX sources in values.yaml to match the current source schema. The main fix: the default Traces source now sets spanEventsValueExpression and spanLinksValueExpression. HyperDX needs both to show span events (including exceptions) and span links. HyperDX's onboarding flow and schema auto-detection already set them, but the chart's defaults had fallen behind.

Only new installs are affected. HyperDX applies DEFAULT_SOURCES only to teams with no sources yet, so existing sources are left alone and users can opt in from source settings.

Changes

  • Traces: add "spanEventsValueExpression": "Events" and "spanLinksValueExpression": "Links".
  • Metrics: register the summary and exponential histogram tables in metricTables. The key must be the MetricsDataType value, including the space; other spellings are silently dropped.
  • Cleanup (no runtime effect): remove fields HyperDX drops when saving each source kind: log-style fields on Sessions, bodyExpression on Traces, sessionSourceId on Logs, and traceSourceId/sessionSourceId plus stray _id/id keys on Metrics.
  • Unit tests pin the span fields and metric table keys. Changeset added.

Compatibility

Checked against HyperDX's source schemas (zod and mongoose) at the shipped appVersion 2.39.1 and at main; every field is accepted and saved. The 2.39.1 collector creates every referenced column and table (Events.*, Links.*, otel_metrics_summary, otel_metrics_exponential_histogram) in both the standard and compat schemas.

Testing

  • helm unittest charts/clickstack: 256 passed
  • helm template renders with each examples/*/values.yaml
  • Rendered DEFAULT_SOURCES is valid JSON with the expected fields

Not included

  • metadataMaterializedViews (kv rollup tables) for Logs/Traces. HyperDX's own defaults set it, but on 2.39.1 it hides attribute keys from autocomplete. That was fixed in 2.40.0, so it's worth adding with the next appVersion bump.
  • The HyperDX-side UI and default-source changes for HDX-5732 are tracked separately in the hyperdx repo.

@SpencerTorres
SpencerTorres requested a review from a team as a code owner October 20, 2026 00:53
@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: abf82b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
helm-charts Patch

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

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

Config-only change: the hyperdx.deployment.defaultSources JSON in values.yaml is updated to match the current HyperDX source schema, with matching helm-unittest assertions and a changeset. The rendering template (templates/hyperdx/deployment.yaml) is unchanged — DEFAULT_SOURCES is still emitted via value: {{ tpl .Values.hyperdx.deployment.defaultSources . | quote }}. The edited DEFAULT_SOURCES block parses as well-formed JSON, cross-source references (logSourceId → Logs, traceSourceId → Traces, sessionSourceId → Sessions, metricSourceId → Metrics) all still resolve to source name values that exist, and the change affects new installs only.

✅ No critical issues found.

No P0/P1 or P2 findings. The added span-event/link expressions and the summary / exponential histogram metric tables are pinned by new tests, and the field removals are cosmetic cleanup with no renderable or cross-reference failure mode in the diff.

🔵 P3 nitpicks (2)
  • charts/clickstack/tests/default-env-vars_test.yaml:114 — the trace assertions match "kind": "trace",[^}]*"spanEventsValueExpression", so they silently depend on spanEventsValueExpression appearing after "kind" within the trace object; reordering the trace fields later would break the test without any real regression.
    • Fix: assert each expression key independently (or against the parsed value) rather than through a position-sensitive [^}]* span from "kind": "trace".
  • charts/clickstack/values.yaml:298 — the Sessions source drops its log-style fields (displayedTimestampValueExpression, implicitColumnExpression, bodyExpression, etc.) on the stated grounds that HyperDX ignores them for kind: session; this is not verifiable from the diff and no test pins the resulting shape.
    • Fix: leave as-is if confirmed against the shipped HyperDX source schema, but keep the removal as a known item to re-validate on the next appVersion bump.

Reviewers (4): correctness, testing, maintainability, project-standards.

Testing gaps:

  • Field removals (_id/id in metricTables, bodyExpression on Traces, log-style fields on Sessions, sessionSourceId on Logs, traceSourceId/sessionSourceId on Metrics) have no assertion confirming their absence; acceptable for cosmetic cleanup but leaves the cleanup unguarded against regression.
  • No test asserts the full DEFAULT_SOURCES value remains valid JSON after the edit; current coverage is presence (isNotEmpty) plus per-field regex only.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR.

@SpencerTorres
SpencerTorres merged commit e2c4be5 into main Oct 20, 2026
8 checks passed
@SpencerTorres
SpencerTorres deleted the spencer/span-events branch October 20, 2026 20:22
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.

2 participants