Workiva / opentelemetry-dart

Apache License 2.0
62 stars 34 forks source link

Behavior changed incompatibly between 0.18.3 and 0.18.6? #188

Open time4tea opened 3 months ago

time4tea commented 3 months ago

Before going into this issue, I can confess I am very confused by the api, particularly around context propagation, having to cast to specific implementations to maybe get a root span and all the docs telling to use functions that are deprecated.

As an open source maintainer I know it is hard to keep docs up to date, but a simple realistic example test would be really helpful.

Previously I was doing this:

final span = tracer.startSpan("z");

This would give a span of parent:"" (empty) - a root.

But since 0.8.5 or 6, it returns a span with parent 00000000

I dont know how to convince it not to. I'm also unsure how to create an inner span.

final outer = tracer.startSpan("outer");
final inner = tracer.startSpan("inner")

doesn't work, but how to make it work?

I dont really want to use global things, especially as global tracer prover doesn't seem to allow itself to be reset (required for tests that might need to access it)

Sorry if this sounds like a complaint, it isn't! I'd really appreciate a real example.

The examples given seen to use a completed span as a parent (end is called before passing it down) so I don't quite get what that is doing.

Thank you!!

James

dankhan-helmet commented 2 months ago

Not quite sure, but this might be related to a problem I'm running into too

time4tea commented 2 months ago

@dankhan-helmet I am using honeycomb, and that's how I noticed this issue.. no more root spans.

I reverted to 0.18.3 temporarily.