skillfed

openfeature-hooks-opentelemetry

OpenTelemetry hooks for the OpenFeature Python SDK

openfeature-hooks-opentelemetry v0.3.1 125.7K downloads/30d#11,806 on PyPI25
Permissive license Apache-2.0 Active released

What it is and what it does

This package provides a hook for the OpenFeature Python SDK that integrates with OpenTelemetry to automatically record feature flag evaluations as span events. When a flag is evaluated and an active OpenTelemetry span exists, the hook captures the evaluation as a span event, making feature flag decisions visible in distributed traces. This enables teams to correlate feature flag changes with request performance, latency, and errors, supporting observability use cases like A/B testing analysis and progressive rollout monitoring.

The hook can be registered either globally (affecting all flag evaluations) or per-client (affecting only specific OpenFeature clients). It depends on openfeature-sdk for the hook framework, opentelemetry-api for span access, and opentelemetry-semantic-conventions for standardized attribute naming. The package is actively maintained and requires Python 3.9 or later.

Use it for:

  • Correlate feature flag decisions with request latency and errors in distributed traces to measure feature impact.
  • Track A/B test variant assignments across service calls to analyze test performance and user behavior.
  • Monitor progressive feature rollouts by observing which flag variants are active during request processing.
  • Debug unexpected behavior by inspecting which feature flags were evaluated during a traced request.
  • Analyze the relationship between feature flag changes and system performance metrics in observability dashboards.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically captures feature flag evaluations as span events in OpenTelemetry traces, enabling observability of how feature flags affect runtime behavior.

Yes. This package fills a clear observability gap for teams using OpenFeature and OpenTelemetry together. It has low install friction, active maintenance, permissive licensing, no known vulnerabilities, and solves a real problem—making feature flag decisions visible in distributed traces. Install it if you use both OpenFeature and OpenTelemetry and want to understand how feature flags affect your system's behavior.

Install

openfeature-hooks-opentelemetry on PyPI

pip

pip install openfeature-hooks-opentelemetry

uv

uv add openfeature-hooks-opentelemetry

poetry

poetry add openfeature-hooks-opentelemetry

Installing openfeature-hooks-opentelemetry

Before you install

Low friction install with three stable runtime dependencies (openfeature-sdk, opentelemetry-api, opentelemetry-semantic-conventions). Repository is active with recent commits and no archived status.

License in practice

Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for most commercial and open-source projects.

Quickstart

pip install openfeature-hooks-opentelemetry

from openfeature import api
from openfeature.contrib.hook.opentelemetry import TracingHook

api.add_hooks([TracingHook()])

Requires Python 3.9 or later; an active OpenTelemetry span must be present for the hook to create span events.

Verify before relying

  • Whether the hook works with all OpenFeature SDK versions or has specific version constraints beyond what the dependency declaration shows.
  • Performance overhead of the hook when evaluating many flags in high-throughput scenarios.
  • Compatibility with different OpenTelemetry exporters and backends.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — openfeature-sdk, opentelemetry-api, opentelemetry-semantic-conventions
Maintenance actively maintained — 178 days since the last release
Last repo commit
First released
Downloads 125,699/month — #11,806 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openfeature_hooks_opentelemetry-0.3.1-py3-none-any.whl

Programming Language :: PythonProgramming Language :: Python :: 3

Tags

opentelemetry feature flag tracingopenfeature hooks observabilityfeature flag span eventsopentelemetry tracing integrationfeature flag telemetry signalsopenfeature sdk hooksdistributed tracing feature flags
observabilityfeature-flagsdistributed-tracing

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-replicate

Adds OpenTelemetry tracing to Replicate API…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-transformers

Adds distributed tracing to HuggingFace…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-django

Adds distributed tracing to Django applications…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-groq

Automatically captures traces of Groq SDK API…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-logging

Integrates Python's standard logging module…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-openai

Captures traces of OpenAI API calls (prompts,…

permissive · top 5,000 on PyPI

openfeature-flagd-core

Evaluates feature flags using JSON logic and…

permissive · top 15,000 on PyPI

openfeature-sdk

OpenFeature Python SDK provides a…

permissive · top 5,000 on PyPI

posthog

PostHog Python SDK integrates product analytics…

permissive · top 1,000 on PyPI

flagsmith-flag-engine

Evaluates feature flags and remote…

permissive · top 5,000 on PyPI