opentelemetry-go-instrumentation
opentelemetry-go-instrumentation copied to clipboard
Instrument `IsRecording` from default OTel default global impl
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
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.
We can open another issue for the GA release to track actually returning the correct value.
#787
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.