LaunchDarkly PHP OpenTelemetry integration 0.1.0

Attributes
in package

String constants for every OpenTelemetry attribute key and fixed attribute value emitted by the LaunchDarkly tracing hook.

These names align with the OpenTelemetry semantic conventions for feature flags and the LaunchDarkly OTEL integration specification. They are kept in one place so that the hook implementation, tests, and consumers reference identical strings.

Tags
see
TracingHook
see
https://github.com/launchdarkly/sdk-meta/blob/main/api/otel-integration.md
psalm-api

Table of Contents

FEATURE_FLAG_CONTEXT_ID  = 'feature_flag.context.id'
Canonical key of the `LDContext` the flag is being evaluated for.
FEATURE_FLAG_KEY  = 'feature_flag.key'
Key of the flag being evaluated.
FEATURE_FLAG_PROVIDER_NAME  = 'feature_flag.provider.name'
Name of the feature flag provider; always {@see self::PROVIDER_NAME}.
FEATURE_FLAG_RESULT_REASON_IN_EXPERIMENT  = 'feature_flag.result.reason.inExperiment'
`true` when the evaluation was part of an experiment. Omitted entirely when the evaluation reason is not an experiment — never emitted as `false`.
FEATURE_FLAG_RESULT_VALUE  = 'feature_flag.result.value'
Serialized evaluated flag value. Optional; emitted only when {@see TracingHookOptions::$includeValue} is `true`.
FEATURE_FLAG_RESULT_VARIATION_INDEX  = 'feature_flag.result.variationIndex'
Variation index of the evaluated flag as an integer. Emitted whenever the evaluation produced a non-null variation index, including the value `0`.
FEATURE_FLAG_SET_ID  = 'feature_flag.set.id'
Environment identifier for the LaunchDarkly project/environment.
PROVIDER_NAME  = 'LaunchDarkly'
Fixed value emitted for the `feature_flag.provider.name` attribute.

Constants

FEATURE_FLAG_CONTEXT_ID

Canonical key of the `LDContext` the flag is being evaluated for.

public mixed FEATURE_FLAG_CONTEXT_ID = 'feature_flag.context.id'

FEATURE_FLAG_KEY

Key of the flag being evaluated.

public mixed FEATURE_FLAG_KEY = 'feature_flag.key'

FEATURE_FLAG_PROVIDER_NAME

Name of the feature flag provider; always {@see self::PROVIDER_NAME}.

public mixed FEATURE_FLAG_PROVIDER_NAME = 'feature_flag.provider.name'

FEATURE_FLAG_RESULT_REASON_IN_EXPERIMENT

`true` when the evaluation was part of an experiment. Omitted entirely when the evaluation reason is not an experiment — never emitted as `false`.

public mixed FEATURE_FLAG_RESULT_REASON_IN_EXPERIMENT = 'feature_flag.result.reason.inExperiment'

FEATURE_FLAG_RESULT_VALUE

Serialized evaluated flag value. Optional; emitted only when {@see TracingHookOptions::$includeValue} is `true`.

public mixed FEATURE_FLAG_RESULT_VALUE = 'feature_flag.result.value'

FEATURE_FLAG_RESULT_VARIATION_INDEX

Variation index of the evaluated flag as an integer. Emitted whenever the evaluation produced a non-null variation index, including the value `0`.

public mixed FEATURE_FLAG_RESULT_VARIATION_INDEX = 'feature_flag.result.variationIndex'

FEATURE_FLAG_SET_ID

Environment identifier for the LaunchDarkly project/environment.

public mixed FEATURE_FLAG_SET_ID = 'feature_flag.set.id'

Emitted only when TracingHookOptions::$environmentId is configured with a non-empty string.

PROVIDER_NAME

Fixed value emitted for the `feature_flag.provider.name` attribute.

public mixed PROVIDER_NAME = 'LaunchDarkly'

Search results