OpenTelemetry Starlette Instrumentation
Project description
This library provides automatic and manual instrumentation of Starlette web frameworks, instrumenting http requests served by applications utilizing the framework.
auto-instrumentation using the opentelemetry-instrumentation package is also supported.
Installation
pip install opentelemetry-instrumentation-starlette
Configuration
Exclude lists
To exclude certain URLs from being tracked, set the environment variable OTEL_PYTHON_STARLETTE_EXCLUDED_URLS with comma delimited regexes representing which URLs to exclude.
For example,
export OTEL_PYTHON_STARLETTE_EXCLUDED_URLS="client/.*/info,healthcheck"
will exclude requests such as https://site/client/123/info and https://site/xyz/healthcheck.
Usage
from opentelemetry.instrumentation.starlette import StarletteInstrumentor
from starlette import applications
from starlette.responses import PlainTextResponse
from starlette.routing import Route
def home(request):
return PlainTextResponse("hi")
app = applications.Starlette(
routes=[Route("/foobar", home)]
)
StarletteInstrumentor.instrument_app(app)
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for opentelemetry-instrumentation-starlette-0.25b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ea1e13bfe6ddea28024c91a552ced2a1be45d77a5c88d115f346fd853b276b |
|
MD5 | b3cda1ded2cae95caa13ef7a38502080 |
|
BLAKE2b-256 | 5e3c347530601a62ef11092fdd7a1917b37fd4ca2db3f9c8428a95283765d847 |
Close
Hashes for opentelemetry_instrumentation_starlette-0.25b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e466855a3d318fd8267b59bdf091caf6e704638b3e14d10dd824d18e31aa2536 |
|
MD5 | 0f7cb627ce6babdc68b5aaeaea88c46b |
|
BLAKE2b-256 | 45e71c29817284a587f84ea5b31825420812fbc4bc2eae72d0a5e2cb3bc76e1a |