Skip to content

refactor(tracer): add tracer.Start for OpenTelemetry spans - #825

Open
mwbrooks wants to merge 4 commits into
mwbrooks-tracer-otlpfrom
mwbrooks-tracer-start
Open

mwbrooks wants to merge 4 commits into
mwbrooks-tracer-otlpfrom
mwbrooks-tracer-start

Conversation

@mwbrooks

Copy link
Copy Markdown
Member

Changelog

N/A - internal refactor with no user-facing changes.

Summary

This pull request adds tracer.Start, so maintainers have one pattern for moving each opentracing.StartSpanFromContext call to the OpenTelemetry API, package by package, in the next PRs.

ctx, span := tracer.Start(ctx, "apiclient.UpdateApp")
defer span.End()
  • Start starts a span from otel.Tracer("slack-cli"), as a child of whatever span is in ctx
  • The bridge now wraps its OpenTelemetry tracer in a WrapperTracer. Without it, a span from Start doesn't see an OpenTracing parent in ctx and starts a new trace

Stacked on #822.

Testing

  1. Run go test ./internal/tracer/ -run Test_Start, which nests OpenTracing, then OpenTelemetry, then OpenTracing spans and checks each parent link

Notes

  • Test_Start fails without the WrapperTracer change, with the OpenTelemetry span's parent empty
  • Nothing calls Start yet, so this changes no spans the CLI sends today

Requirements

Adds one helper for the call-site migration from OpenTracing to the
OpenTelemetry API. Wraps the bridge's tracer so an OpenTelemetry span
started from a context nests under the OpenTracing span in it.
@mwbrooks mwbrooks added this to the Next Release milestone Nov 20, 2026
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Nov 20, 2026
@mwbrooks mwbrooks self-assigned this Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.56%. Comparing base (8f1998c) to head (523cd46).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           mwbrooks-tracer-otlp     #825      +/-   ##
========================================================
- Coverage                 80.57%   80.56%   -0.01%     
========================================================
  Files                       246      246              
  Lines                     18913    18914       +1     
========================================================
- Hits                      15239    15238       -1     
- Misses                     3674     3676       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks
mwbrooks marked this pull request as ready for review November 20, 2026 18:47
@mwbrooks
mwbrooks requested a review from a team as a code owner November 20, 2026 18:47
@mwbrooks
mwbrooks requested a review from zimeg November 20, 2026 18:47
…oks-tracer-start

# Conflicts:
#	internal/tracer/tracer_test.go

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 @mwbrooks LGTM! Thanks for the test that nests all three span hops, and for one pattern to move the rest over with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants