Skip to content

Support expanded OpenTelemetry semantic attributes #281

@beeme1mr

Description

@beeme1mr

Overview

OpenFeature recently partnered with OpenTelemetry to define the next version of the feature flag semantic convention. This significantly expanded the number of named attributes to better support more sophisticated use cases. Most of the attributes are readily available in OpenFeature hooks. However, some provider-specific attributes like feature_flag.set.id and feature_flag.version are not easily accessible at the moment. The OpenFeature specification must be adjusted to fully support the new OTel semantics.

Proposal

Modify the finally stage in hooks to include the evaluation details. The evaluation details should match what's returned to the application developer. This would allow providers to set defined flag metadata that would then be available in a hook. If this proposal is accepted, it may also be worth explicitly defining some well-known attributes to make it easier for provider developers.

Consideration

This proposal is a breaking change but should have little to no impact on end users. The finally stage had limited value before and was primarily used to end spans or request-based metrics.

Another consideration is that providers must return flag metadata in their responses so that they're available in hooks. Providers should also avoid throwing errors and instead return responses with the REASON set to ERROR so that flag metadata can be included in the response.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions