Skip to content
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

Ignore stdlib logs from urllib3 #135

Closed
alexmojaki opened this issue May 6, 2024 · 7 comments
Closed

Ignore stdlib logs from urllib3 #135

alexmojaki opened this issue May 6, 2024 · 7 comments
Labels
good first issue Good for newcomers

Comments

@alexmojaki
Copy link
Contributor

https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1713885605381719

We can specifically ignore the message https://logfire-api.pydantic.dev:443 "POST /v1/traces HTTP/1.1" 200 2 (and same for /v1/metrics) so that the user doesn't have to silence all of urllib3 to avoid this noise.

@epicwhale
Copy link

+1 👍

@epicwhale
Copy link

fyi: when I put this into my fastapi project, I realised the noise is VERY HIGH - almost takes over the entire real estate..
image

@alexmojaki alexmojaki added the good first issue Good for newcomers label May 6, 2024
@adriangb
Copy link
Member

adriangb commented May 7, 2024

Shouldn't the urllib3 instrumentation respect the contextvars to not infinite loop instrumentation? Are we maybe not propagating them correctly?

@alexmojaki
Copy link
Contributor Author

This is urllib3 using stdlib logging, i.e. this fix would be in the stdlib logging instrumentation. The urllib3 instrumentation is not involved.

But you do bring up a good point. Looking more closely, we use the string suppress_instrumentation, whereas OTEL mostly uses _SUPPRESS_INSTRUMENTATION_KEY = create_key("suppress_instrumentation") which is different.

@adriangb
Copy link
Member

adriangb commented May 7, 2024

OTEL currently has a haphazard mix of suppress instrumentation keys. We should probably just set all of them.

@alexmojaki
Copy link
Contributor Author

Well in this case it's about reading the correct key. OTEL conveniently sets it in the right places in BatchSpanProcessor and SimpleSpanProcessor.

@alexmojaki
Copy link
Contributor Author

Fixed by #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants