opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

OTLP Exporter builder issues

Open cijothomas opened this issue 1 year ago • 10 comments

Methods like install_batch created unintended side-effects https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-otlp/src/span.rs#L143-L150

  1. It sets global providers, which may not be what user has intended.
  2. It returns a tracer with instrumentation scope set to "opentelemetry-otlp", which is incorrect as well.

The builder methods used in OTLP to setup the pipeline must be revisited to ensure that there are no accidental side effects like above. Also, returning tracer with hardcoded name is defeating the purpose of instrumentation scope, as all tracers will have same scope (and that too incorrect one). This is particularly hard when used with tracer-opentelemetry, as it'll result in traces which all have same scope!

cijothomas avatar Mar 01 '24 17:03 cijothomas

I used traces as an example - same/similar issue for all signals exist and need a unified fix.

cijothomas avatar Mar 01 '24 17:03 cijothomas

I'm interested in taking this on

mattbodd avatar Mar 01 '24 18:03 mattbodd

Adding a permalink (for the link in the description): https://github.com/open-telemetry/opentelemetry-rust/blob/d5392dc1df13b51553577a51d736eac9b29e7125/opentelemetry-otlp/src/span.rs#L143-L150

NickLarsenNZ avatar Apr 10 '24 13:04 NickLarsenNZ

Both logs, and metrics have completed this cleanup. Neither returns a Logger/Meter, nor set a Global Provider. Tracing is still needing to be fixed to make it consistent with the rest.

cijothomas avatar May 21 '24 15:05 cijothomas

I will do it for the tracing pipelines if no one else pick it up within next week

TommyCpp avatar May 21 '24 16:05 TommyCpp

Both logs, and metrics have completed this cleanup. Neither returns a Logger/Meter, nor set a Global Provider. Tracing is still needing to be fixed to make it consistent with the rest.

Is the logs one linked anywhere in this issue? I didn't see it, but am on mobile and maybe missing the obvious.

NickLarsenNZ avatar May 21 '24 16:05 NickLarsenNZ

Is the logs one linked anywhere in this issue?

Not linked, but it was removed as part of global cleanups in #1691 .

lalitb avatar May 21 '24 16:05 lalitb

Is the logs one linked anywhere in this issue?

Not linked, but it was removed as part of global cleanups in #1691 .

@NickLarsenNZ The logging should not affect end users.. It is only going to affect authors of bridges/appenders.. Curious if you are writing one?

cijothomas avatar May 21 '24 18:05 cijothomas

I can work on this if this still needs help.

utpilla avatar May 21 '24 23:05 utpilla

@ThomsonTan Will see if this is something he can take.

cijothomas avatar Jul 16 '24 16:07 cijothomas