Skip to main content

Dynatrace OpenFeature Provider for Python

The official Dynatrace OpenFeature provider for Python server-side applications.

The provider evaluates flags in-process: on initialization it fetches your flag configuration from the Dynatrace CDN and refreshes it in the background, so evaluations are local and do not make a network call.

Changes are picked up through a server-sent events (SSE) stream advertised in the flag configuration: a change notification triggers an immediate re-fetch, and polling every 10 minutes acts as a safety net. While the stream is unavailable or disabled, the provider polls every 10 seconds instead.

Status: Early alpha — not yet ready for production use.

Installation

pip install dynatrace-openfeature-provider-python

Usage

from openfeature import api
from openfeature.evaluation_context import EvaluationContext

from dynatrace.openfeature import DynatraceProvider

api.set_provider(DynatraceProvider("dt01.server_us_<key>"))

client = api.get_client()
ctx = EvaluationContext(targeting_key="user-123")
enabled = client.get_boolean_value("my-flag", False, ctx)

# On shutdown:
api.shutdown()

Once the provider is registered, all flag evaluation goes through the OpenFeature API. See the OpenFeature Python SDK documentation for evaluation contexts, hooks, events, and the rest of the SDK surface.

Configuration

Pass options as keyword arguments to DynatraceProvider:

api.set_provider(
    DynatraceProvider(
        sdk_key,
        config_origin="https://cdn.eu.fm.dynatracelabs.com",
        metrics_origin="https://metrics.eu.fm.dynatracelabs.com",
    )
)
Option Type Default Description
config_origin str derived from SDK key Override the flag configuration origin.
metrics_origin str derived from SDK key Override the evaluation metrics ingest origin.
disable_sse bool False Don't attempt an SSE connection and poll only, every 10 seconds.

Running the e2e tests

The shared provider test harness gherkin suite runs against its mock server in a container, so Docker is required:

uv run poe e2e

This initializes the fm-provider-test-harness submodule and runs the suite with pytest-bdd. Set SKIP_HARNESS_UPDATE=1 to keep a local harness checkout, and MOCKSERVER_IMAGE to use a locally built mock server image.

Contributing

See CONTRIBUTING.md.

License

Apache 2.0 — see LICENSE.

Metadata

Release files for dynatrace-openfeature-provider-python 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dynatrace-openfeature-provider-python 0.3.1
File Size Uploaded Provenance Actions
dynatrace_openfeature_provider_python-0.3.1.tar.gz 27.7 kB Without provenance Details for dynatrace_openfeature_provider_python-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dynatrace-openfeature-provider-python 0.3.1
File Interpreter ABI Platform Actions
dynatrace_openfeature_provider_python-0.3.1-py3-none-any.whl Python 3 none any Details for dynatrace_openfeature_provider_python-0.3.1-py3-none-any.whl

Total release size: 60.1 kB

Release files / dynatrace_openfeature_provider_python-0.3.1.tar.gz

Download URL dynatrace_openfeature_provider_python-0.3.1.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6d2b2321eb344faf8bae28d7d2ec5d335b9855e332763279ee1e39fbd8bcbc44
BLAKE2b-256 checksum
How to use checksums
e48ff471213fd58f730d2454b5cbb29aa131c03ccc152747ad8499bb4ce03e59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / dynatrace_openfeature_provider_python-0.3.1-py3-none-any.whl

Download URL dynatrace_openfeature_provider_python-0.3.1-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54d81bab2aca263c5c1ba7547a3d4af3cdc3744acd5de125fce062fb9ce3f02f
BLAKE2b-256 checksum
How to use checksums
60bde1133fd2f4d90383e0410e1b4d1bc9ad88e62b73da179e1d38bf6120641b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Security for dynatrace-openfeature-provider-python 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page