Skip to main content

OpenTelemetry keystonemiddleware instrumentation

Instruments the keystonemiddleware auth_token WSGI middleware that OpenStack services mount in front of their request pipeline.

It wraps keystonemiddleware.auth_token.BaseAuthProtocol.process_request -- the single method through which the stock AuthProtocol and any subclass validate the request's bearer token(s) -- so every authentication produces a span:

  • the outcome: whether a user and/or service token was present and accepted;
  • for accepted user tokens, the resolved identity (user.id, user.name, user.roles) and OpenStack scope (openstack.project_id, openstack.project_name, openstack.domain_id).

Because auth_token is usually the first middleware to see an inbound request, it also continues a distributed trace: when no span is already active the instrumentor extracts the W3C trace context from the incoming headers and opens a SERVER span, so a trace started by an instrumented client (for example the OpenStack SDK) carries on into the service. When a span is already active the authentication span is nested under it as INTERNAL.

Every response carries the request's trace id in an X-Trace-ID header (32 hex chars), so a caller can quote it when reporting a failed request. A header of that name already set by the service is left untouched.

The W3C traceresponse header is opt-in, as in the upstream web-framework instrumentors:

from opentelemetry.instrumentation.propagators import (
    TraceResponsePropagator,
    set_global_response_propagator,
)

set_global_response_propagator(TraceResponsePropagator())

Installation

pip install opentelemetry-instrumentation-keystonemiddleware

Usage

from opentelemetry.instrumentation.keystonemiddleware import (
    KeystoneMiddlewareInstrumentor,
)

KeystoneMiddlewareInstrumentor().instrument()

Metadata

Release files for opentelemetry-instrumentation-keystonemiddleware 0.14.0

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

Source distribution (sdist)

Source distribution for opentelemetry-instrumentation-keystonemiddleware 0.14.0
File Size Uploaded Provenance Actions
opentelemetry_instrumentation_keystonemiddleware-0.14.0.tar.gz 11.5 kB With provenance Details for opentelemetry_instrumentation_keystonemiddleware-0.14.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opentelemetry-instrumentation-keystonemiddleware 0.14.0
File Interpreter ABI Platform Actions
opentelemetry_instrumentation_keystonemiddleware-0.14.0-py3-none-any.whl Python 3 none any Details for opentelemetry_instrumentation_keystonemiddleware-0.14.0-py3-none-any.whl

Total release size: 21.3 kB

Release files / opentelemetry_instrumentation_keystonemiddleware-0.14.0.tar.gz

Download URL opentelemetry_instrumentation_keystonemiddleware-0.14.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b2bea59b5b03bce714fcf4e36a8510a35cfc3c73ef6988ba8644a1993a0dc387
BLAKE2b-256 checksum
How to use checksums
f1cf324d6723be9ba5df3afd343897f78833d072c75fa2466c45cb448fd59a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / opentelemetry_instrumentation_keystonemiddleware-0.14.0-py3-none-any.whl

Download URL opentelemetry_instrumentation_keystonemiddleware-0.14.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7ab75d67a77f0282859da722d6b6e92c74b62d3ee2ad5ac817f315a2d3799c1
BLAKE2b-256 checksum
How to use checksums
d9b878f682ed22ed6814cbca35d4dff810fd2367478cb72112d78326f79972b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for opentelemetry-instrumentation-keystonemiddleware 0.14.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opentelemetry_instrumentation_keystonemiddleware-0.14.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

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