Skip to content

Directly expose noop exporters for spans and logs.#8435

Open
breedx-splk wants to merge 3 commits into
open-telemetry:mainfrom
breedx-splk:expose-noop-span-exporter
Open

Directly expose noop exporters for spans and logs.#8435
breedx-splk wants to merge 3 commits into
open-telemetry:mainfrom
breedx-splk:expose-noop-span-exporter

Conversation

@breedx-splk
Copy link
Copy Markdown
Contributor

Right now, there's a silly workaround for users that want to disable exporters -- they can simply use SpanExporter.composite(emptyList()) to get the NoOpSpanExporter.INSTANCE implementation. 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? 🤷🏻

@breedx-splk breedx-splk requested a review from a team as a code owner May 29, 2026 00:49
@breedx-splk
Copy link
Copy Markdown
Contributor Author

breedx-splk commented May 29, 2026

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.

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.

1 participant