fix: telemetry doc honesty, datadog status reset, slog span context#146
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this change does
Closes the telemetry review findings (no behavior change beyond bug fixes):
SetStatus(StatusOK)now clears a previously recorded error, so a span that recovered no longer finishes errored (with a test).SetAttributes/RecordError/End) log against the span's own context instead ofcontext.Background();NewMeterno longer allocates an unused counter/closure.stringifyfallback branch (dropped an unused import); covered the instrument error-fallback paths.WithSpanStarter+ attribute-kind coverage; otel KindAny stringify + instrument fallbacks.Checklist
-race); importing consumers build