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

Refactor to use AddOtlpExporter and LoggerProviderBuilder #180

Merged
merged 6 commits into from
Nov 22, 2024

Conversation

stevejgordon
Copy link
Contributor

We initially used UseOtlpExporter as a convenient way to enable OTLP export by default globally for all signals. However, this plays poorly with the AddOtlpExporter methods, which throw if called by consumer code. This change avoids that risk. It also introduces a LoggingProviderBuilder extension to register our defaults, which our main builder calls.

We still support disabling our default registration of the OTLP exporter via an environment variable, which the auto instrumentation plugin then passes when configuring the providers.

This PR also fixes a small typo in the docs.

Closes #177

We originally used UseOtlpExporter as a nice way to globally enable
OTLP export by default for all signals. However, this doesn't play well
with the AddOtlpExporter methods which then throw if called by consumer
code. This change avoids that risk. It also introduces a LoggingProviderBuilder
extension to register our defaults which our main builder calls.
@stevejgordon stevejgordon requested a review from a team November 21, 2024 15:30
trentm
trentm previously approved these changes Nov 21, 2024
global.json Outdated Show resolved Hide resolved
@stevejgordon stevejgordon requested a review from trentm November 21, 2024 19:16
@stevejgordon stevejgordon merged commit 107db01 into main Nov 22, 2024
5 checks passed
@stevejgordon stevejgordon deleted the otlp-exporter branch November 22, 2024 05:25
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.

Refactor use of UseOtlpExporter
2 participants