Digma instrumentation for FastAPI
Project description
opentelemetry-instrumentation-digma-fastapi
This package extends the default FastAPI instrumentation for OTEL to provide additional attributes which can be used to facilitate Continuous Feedback back to the code.
Installing the package
pip install opentelemetry-instrumentation-digma-fastapi
Or add it to your requirements/poetry file.
Instrumenting your FastAPI project
Enable OpenTelemetry in your project
First, configure OpenTelemetry in your project. See the Digma instrumentation repo for quick instructions on getting that done, whether you're already using OTEL or not.
Make sure you've instrumented your FastAPI application using the standard Pypi package.
- Install the package:
pip install opentelemetry-instrumentation-fastapi
- Instrument the FastAPI app by adding the following to your app setup:
FastAPIInstrumentor.instrument_app(app)
More info can be found in the official package documentation.
Enable the Digma OpenTelemetry instrumentation
Before or after the call to FastAPIInstrumentor.instrument
to enable OTEL, also add the following:
DigmaFastAPIInstrumentor().instrument_app(app)
Check out some sample projects
You can review a simple example in the FastAPI Sample Repo Or a more complex real world example in the Gringotts Vault API application (which includes both FastAPI, Postgres, RabbitMQ and other technologies)
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
Hashes for opentelemetry-instrumentation-digma-fastapi-0.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e704987e077f64607aed01ac0069f72b49044bf2a46f527d409a3d398fa11ea |
|
MD5 | efc2ed508a40053ab00a09c40a2365c3 |
|
BLAKE2b-256 | 9321ef1cd45838c363ead5afb8f273921479c47cba57830f3643888d18f7bb38 |
Hashes for opentelemetry_instrumentation_digma_fastapi-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c77cdc0dbfe0c022777313d70aa6d134110cc258441dc3273554604b038f5509 |
|
MD5 | c11a466928dc32eebfa127a37282c77e |
|
BLAKE2b-256 | e14e9f7db66d600b0137878144d32cace8dd8b9d77e6d28174200e1a062a96d2 |