ObserveNow
...
Integrations
Applications

Python

instrumenting your app please follow the steps outlined in this document https //github com/prometheus/client python setting the pod annotations once your application is emitting metrics, your pod in k8s will need to be annotated to enable the agent to scrape the metrics following are the relevant annotations prometheus io/scrape 'true' prometheus io/path '/data/metrics' # (if the metrics are served on a path other than /metrics) prometheus io/port '80' # (if the metrics are served on a port other than the container port) trace context (traceid, spanid and traceflags) injection into logs it is very simple to configure trace context (traceid, spanid, and trace flags) injection into user logs in python applications please follow the below mentioned steps to inject the trace context to the logs there is no out of the box auto instrumentation to inject the trace context instead, you'll have to get a context from current span and attach it to the log statement step 1 import the library from opentelemetry import trace step 2 get the current span context ctx = trace get current span() get span context() step 3 get trace id and span id from the context trace id = '{trace 032x}' format(trace=ctx trace id) span id = '{span 016x}' format(span=ctx span id) step 4 inject trace context ( trace id and span id ) to the log log info('sample log with trace id=%s span id=%s', trace id, span id) please ensure the aforementioned code block is added to a file where your application requests are traced with otel python instrumentation single machine if you are running a python application in a vm, ensure you have installed opsverse agent and opentelemetry collector using steps in the opsverse docs, and then instrument your application using the docs below django https //opentelemetry python readthedocs io/en/latest/examples/django/readme html https //opentelemetry python readthedocs io/en/latest/examples/django/readme html fastapi https //opentelemetry python contrib readthedocs io/en/latest/instrumentation/fastapi/fastapi html https //opentelemetry python contrib readthedocs io/en/latest/instrumentation/fastapi/fastapi html flask https //opentelemetry python contrib readthedocs io/en/latest/instrumentation/flask/flask html https //opentelemetry python contrib readthedocs io/en/latest/instrumentation/flask/flask html