Skip to main content

OpenTelemetry Starlette Instrumentation

Project description

pypi

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

File details

Details for the file opentelemetry-instrumentation-starlette-0.25b1.tar.gz.

File metadata

  • Download URL: opentelemetry-instrumentation-starlette-0.25b1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for opentelemetry-instrumentation-starlette-0.25b1.tar.gz
Algorithm Hash digest
SHA256 37ea1e13bfe6ddea28024c91a552ced2a1be45d77a5c88d115f346fd853b276b
MD5 b3cda1ded2cae95caa13ef7a38502080
BLAKE2b-256 5e3c347530601a62ef11092fdd7a1917b37fd4ca2db3f9c8428a95283765d847

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_starlette-0.25b1-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_starlette-0.25b1-py3-none-any.whl
Algorithm Hash digest
SHA256 e466855a3d318fd8267b59bdf091caf6e704638b3e14d10dd824d18e31aa2536
MD5 0f7cb627ce6babdc68b5aaeaea88c46b
BLAKE2b-256 45e71c29817284a587f84ea5b31825420812fbc4bc2eae72d0a5e2cb3bc76e1a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page