Skip to content

Conversation

andreaturli
Copy link

What does this pull request do?

Add an example for aiohttp server

Related issues

Closes #ISSUE

Co-authored-by: Riccardo Magliocchetti <[email protected]>
```sh
export OTEL_EXPORTER_OTLP_ENDPOINT=https://my-deployment.apm.us-west1.gcp.cloud.es.io
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer P....l"
docker run -e OTEL_EXPORTER_OTLP_ENDPOINT="$OTEL_EXPORTER_OTLP_ENDPOINT" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are using logging here I think we can can export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true and then update docker to forward it

from aiohttp import web


logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call to logging.basicConfig() is a no-op when the otel sdk is configured to handle logs, we can call logger.setLevel() later to get the logs exported in otlp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next release will have this fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants