Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an auto-instrumentable no-op implementation to the trace package #6203

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jan 22, 2025

This copes the go.opentelemetry.io/auto/sdk package into the go.opentelemetry.io/otel/trace package. This is done to avoid package import cycles and still provide an auto-instrumentable SDK (see open-telemetry/opentelemetry-go-instrumentation#974).

Overview of changes

The code copied is updated with the following changes. The over-all goal is to ensure none of this is exported and follows the auto/sdk as close as possible to help maintenance.

trace/auto.go

Consolidation of the following into a single file:

Has the following changes:

  • func TracerProvider() renamed to newAutoTracerProvider
  • type tracerProvider struct renamed to autoTracerProvider
  • type tracer struct renamed to autoTracer
  • type span struct renamed to autoSpan
  • Lint issues addressed based on this repositories configuration (these changes are being back-ported upstream)

trace/auto_test.go

Consolidation of the following into a single file:

Has the following changes:

  • Renames in trace/auto.go are applied here
  • Lint issues addressed based on this repositories configuration (these changes are being back-ported upstream)

trace/internal/telemetry

Copied from https://github.com/open-telemetry/opentelemetry-go-instrumentation/tree/aea085dd2a3640630ac07a2187cbda9d15d2dd00/sdk/internal/telemetry

  • Pacakge vanity URLs added
  • Lint issues addressed based on this repositories configuration (these changes are being back-ported upstream)
  • Use of the package name has been updated

trace/internal/telemetry/test

Copied from https://github.com/open-telemetry/opentelemetry-go-instrumentation/tree/aea085dd2a3640630ac07a2187cbda9d15d2dd00/sdk/internal/telemetry/test

  • Module name updated
  • Documentation updated with new package name
  • Testing values updated with new package name

@MrAlias MrAlias added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.8%. Comparing base (6605083) to head (a320e46).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6203     +/-   ##
=======================================
- Coverage   82.2%   81.8%   -0.5%     
=======================================
  Files        273     283     +10     
  Lines      23741   24894   +1153     
=======================================
+ Hits       19534   20380    +846     
- Misses      3858    4110    +252     
- Partials     349     404     +55     

see 13 files with indirect coverage changes

@MrAlias MrAlias marked this pull request as ready for review January 23, 2025 21:32
@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 23, 2025

cc @open-telemetry/go-instrumentation-approvers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant