Directly expose noop exporters for spans and logs.#8435
Open
breedx-splk wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
Additional context: We have an Android user/contributor who wants to turn off spans and metrics and only ever export logs. Right now, there isn't a great way to do that through our high-level DSL...so while I was looking into how we might one day implement this, I came across this little gap. |
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.
Right now, there's a silly workaround for users that want to disable exporters -- they can simply use
SpanExporter.composite(emptyList())to get theNoOpSpanExporter.INSTANCEimplementation. Sure, this is an implementation detail, but its also pretty obvious that when you composite nothing you get nothing. And that just reads clunky.Since we already have these NoOp implementations, let's just expose them more directly. The implementation is still completely internal, and yes, this does very slightly increase the api surface area, but I think it's within reason and should be an improvement over the composite hack.
Why not metrics? Welp, we don't have an existing NoOpMetricExporter. I'm not entirely sure why, but it might be due to the spec requiring the NoOp API implementation for metrics? 🤷🏻