open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.28k stars 1.07k forks source link

feature flagging semantic conventions #3696

Closed jan-xyz closed 1 year ago

jan-xyz commented 1 year ago

Problem Statement

With https://github.com/open-telemetry/opentelemetry-specification/pull/2529 the semantic convention was extended with feature flag support but it's not available yet in the Go SDK.

Proposed Solution

Update to latest semantic convention spec.

Alternatives

It's possible to built it manually or use the OpenFeature SDK.

Prior Art

It is already added to the OpenFeature SDK in: https://github.com/open-feature/go-sdk-contrib/blob/main/hooks/open-telemetry/pkg/otel.go

Additional Context

I am opening this issue to understand better if this is something that belongs in here (as the specification is an Opentelemetry Spec) or if this should only exist in the OpenFeature SDK. We are currently working a lot with local feature flags and it seems a bit odd to import the OpenFeature SDK to properly add events to our spans.

Aneurysm9 commented 1 year ago

These seem to have been missed as they're type: event and we weren't processing that type. A quick check confirms there aren't any other types we're missing:

$ ack -h '^\s{4}type:\s+' | sort | uniq -c | sort
   4     type: event
  29     type: resource
  61     type: span

3697 should fix that going forward. The feature_flag conventions were added in 1.16 but we've changed the generation of conventions a bit since then and if it's okay to have them from 1.17 forward that's going to be the most straightforward solution.

jan-xyz commented 1 year ago

Thanks a lot! That was super fast! ❤️