-
Notifications
You must be signed in to change notification settings - Fork 6
add aiohttp example #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add aiohttp example #248
Conversation
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" \ |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
What does this pull request do?
Add an example for aiohttp server
Related issues
Closes #ISSUE