opentelemetry-go-instrumentation icon indicating copy to clipboard operation
opentelemetry-go-instrumentation copied to clipboard

Instrument `IsRecording` from default OTel default global impl

Open MrAlias opened this issue 1 year ago • 2 comments

Instrumenting this method is critical as many users will use this method to gate other telemetry annotation.

The method shoule return true as long as the sampler has not returned DROP: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#sampler

Originally posted by @MrAlias in https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/523#discussion_r1408318459

MrAlias avatar Dec 07 '23 16:12 MrAlias

To unblock the beta we should just return true by default and just respond incorrectly when the span would have been dropped.

We can open another issue for the GA release to track actually returning the correct value.

MrAlias avatar Apr 16 '24 17:04 MrAlias

We can open another issue for the GA release to track actually returning the correct value.

#787

MrAlias avatar Apr 16 '24 19:04 MrAlias

The return value for this method looks to be stored in an inaccessible register. It does not look like we can modify the return value from the eBPF program.

I'm going to close this. If we want to address this in the future, we'll need to look into possibly modifying the upstream nonRecordingSpan struct to possibly have this return value as a field.

MrAlias avatar Jul 02 '24 17:07 MrAlias