Closed BnMcG closed 4 years ago
Hey, thanks for trying it out! I came up with a workaround to this, shortly before finding this PR: https://github.com/open-telemetry/opentelemetry-php/pull/171
I believe once this is merged, there won’t be any missing parent traces.
In my workaround I replaced startAndActivateSpanFromContext
with getActiveSpan
. Then updating the name on the span, but this seems to be discouraged.
Ah interesting! Yeah, I've been digging around the opentelemetry-php library and suspected it was something to do with that initial span that's setup. I was just looking at whether or not I could force that span to be exported somehow, but if it's being removed altogether that sounds preferable.
I just patched in the branch which has the global span changes into my test project and it does get rid of the invalid parent span ID errors! I've also raised #2 which has a minor fix.
I saw your commit on #2 to fetch the noop-span version of opentelemetry-php. I think I'd rather wait until there's a fix upstream than add any workarounds in here. By the sounds of it, it shouldn't be too long until that's resolved.
That doesn't actually fix the parent ID issue, as far as I can tell it's just an oversight in the examples in the opentelemetry-php library. The startAndActivateSpan
method calls $tracer->setActiveSpan($span)
itself, so as far as I can see there's no benefit to calling it again yourself.
The upstream fix has been merged now, so I think this can be closed.
Hi,
Just playing around with this library today, and I'm finding the following warning in my traces:
The ID changes with each request. Any ideas what might be wrong? I've had a poke around but nothing promising so far. Mostly just curious if this is unique to my environment or not. I'm using this with Laravel 8 and PHP 7.4.
Cheers.