You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hooks are a mechanism whereby application developers can add arbitrary behavior to flag evaluation. They operate similarly to middleware in many web frameworks. Please see the [spec](https://github.com/open-feature/spec/blob/main/specification/sections/04-hooks.md) for more details.
3
+
The OpenTelemetry hook for OpenFeature provides
4
+
a [spec compliant] (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/feature-flags.md)
5
+
way to automatically add a feature flag
6
+
evaluation to a span as a span event. This can be used to determine the impact a feature has on a request,
7
+
enabling enhanced observability use cases, such as A/B testing or progressive feature releases.
8
+
9
+
## Installation
10
+
<!-- x-release-please-start-version -->
11
+
```xml
12
+
<dependency>
13
+
<groupId>dev.openfeature.contrib.hooks</groupId>
14
+
<artifactId>otel</artifactId>
15
+
<version>0.4.0</version>
16
+
</dependency>
17
+
```
18
+
<!-- x-release-please-end-version -->
19
+
20
+
## Usage
21
+
22
+
OpenFeature provider various ways to register hooks. The location that a hook is registered affects when the hook is
23
+
run. It's recommended to register the `OpenTelemetryHook` globally in most situations, but it's possible to only enable
24
+
the hook on specific clients. You should **never** register the `OpenTelemetryHook` globally and on a client.
* The OpenTelemetry hook provides a way to automatically add a feature flag evaluation to a span as a span event.
14
+
* Refer to <a href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/feature-flags.md">OpenTelemetry</a>
0 commit comments