diff --git a/examples/python/Dockerfile b/examples/python/Dockerfile index 2bb29f3..9f6430b 100644 --- a/examples/python/Dockerfile +++ b/examples/python/Dockerfile @@ -16,6 +16,7 @@ COPY app.py . # Logging support is still in alpha, so we need to enable it explicitly ENV OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true +ENV OTEL_LOGS_EXPORTER=otlp EXPOSE 8082 diff --git a/examples/python/oats.yaml b/examples/python/oats.yaml index 5ee168b..2308b14 100644 --- a/examples/python/oats.yaml +++ b/examples/python/oats.yaml @@ -15,3 +15,7 @@ expected: metrics: - promql: 'http_server_active_requests{http_method="GET"}' value: ">= 0" + logs: + - logql: '{exporter="OTLP"} | json | body =~ `Anonymous player is rolling the dice.*`' + contains: + - 'Anonymous player is rolling the dice' diff --git a/examples/python/run.sh b/examples/python/run.sh index b50f3d8..b21a851 100755 --- a/examples/python/run.sh +++ b/examples/python/run.sh @@ -19,4 +19,5 @@ opentelemetry-bootstrap -a install # Step 2: Run the application export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true +export OTEL_LOGS_EXPORTER=otlp opentelemetry-instrument flask run -p 8082