Skip to content

fix: telemetry doc honesty, datadog status reset, slog span context#146

Merged
joshua-temple merged 1 commit into
mainfrom
fix/telemetry-fixes
Jun 5, 2026
Merged

fix: telemetry doc honesty, datadog status reset, slog span context#146
joshua-temple merged 1 commit into
mainfrom
fix/telemetry-fixes

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

What this change does

Closes the telemetry review findings (no behavior change beyond bug fixes):

  • doc.go honesty: removes the stale "otel/datadog deferred" wording; both adapters shipped at v0.1.0.
  • datadog correctness: SetStatus(StatusOK) now clears a previously recorded error, so a span that recovered no longer finishes errored (with a test).
  • slog: span lifecycle methods (SetAttributes/RecordError/End) log against the span's own context instead of context.Background(); NewMeter no longer allocates an unused counter/closure.
  • otel: simplified the dead stringify fallback branch (dropped an unused import); covered the instrument error-fallback paths.
  • tests: datadog WithSpanStarter + attribute-kind coverage; otel KindAny stringify + instrument fallbacks.

Checklist

  • Signed off (DCO), conventional commits, no behavior change beyond fixes
  • All four telemetry modules build/test/vet/lint clean (incl. -race); importing consumers build

…bug, and slog span context

- telemetry/doc.go: replace stale "deferred" description for otel and
  datadog with accurate "shipped" wording mirroring the README adapter table
- telemetry/datadog: SetStatus(StatusOK) now clears a previously recorded
  error so a span that recovers finishes without the Datadog error flag;
  add test asserting OK-after-error produces no error.message tag
- telemetry/slog: store the span's own context (which carries the span id)
  in the span struct; use it in SetAttributes/RecordError/End instead of
  context.Background(), preserving trace/deadline propagation
- telemetry/slog: NewMeter no longer calls resolve() (which allocates an
  unused atomic counter and clock func); apply only WithLogger
- telemetry/otel: simplify stringify() to v.String() — the fmt.Sprintf
  fallback was unreachable because slog.Value.String always produces a
  non-empty representation; remove dead fmt import
- telemetry/otel: add errMeterImpl test helper and
  TestMeter_InstrumentErrorFallback covering the no-op fallback path when
  the SDK returns an error building an instrument; add
  TestConvertAttr_KindAnyStringify covering the KindAny stringify branch
- telemetry/datadog: add TestTracer_WithSpanStarter and TestAttrValue_Kinds
  covering the WithSpanStarter option and duration/time/uint64/any tag kinds

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple joshua-temple merged commit 085c0ab into main Jun 5, 2026
121 checks passed
@joshua-temple joshua-temple deleted the fix/telemetry-fixes branch June 5, 2026 14:20
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.

1 participant