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

chore: start spans only when telemetry is enabled #719

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

ezr-ondrej
Copy link
Member

Extract span start into a separate function.
This also obsoletes the Tracer naming per package, which is actually correct
According to Tracer docs https://pkg.go.dev/go.opentelemetry.io/otel/[email protected]#TracerProvider
the passed name should be a name of a tracing library, not the package being intrumented.

Follows #711 with cleanup of TraceName we got it wrong according to docs.
More info is also in these nice docs: https://uptrace.dev/opentelemetry/go-tracing.html#tracer

@ezr-ondrej ezr-ondrej force-pushed the telemetry_common_tracer branch 2 times, most recently from ff1e4a7 to 1837fe4 Compare October 16, 2023 12:32
Extract span start into a separate function.
This also obsoletes the Tracer naming per package, which is actually correct
According to Tracer docs https://pkg.go.dev/go.opentelemetry.io/otel/[email protected]#TracerProvider
the passed name should be a name of a tracing library, not the package being intrumented.
@ezr-ondrej ezr-ondrej force-pushed the telemetry_common_tracer branch from 1837fe4 to d8228d9 Compare October 17, 2023 09:30
@ezr-ondrej ezr-ondrej marked this pull request as ready for review October 17, 2023 09:30
@ezr-ondrej
Copy link
Member Author

ezr-ondrej commented Oct 17, 2023

This is a last bigger change I figured might be worth it when digging through telemetry.
It's simplifying the tracer initialization quite a bit and allows for disabling the tracing entirely.

Copy link
Member

@lzap lzap left a comment

Choose a reason for hiding this comment

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

SUperb.

@lzap lzap merged commit f4f2a99 into RHEnVision:main Oct 17, 2023
6 checks passed
@ezr-ondrej ezr-ondrej deleted the telemetry_common_tracer branch October 17, 2023 13:53
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