Ignore stdlib logs from urllib3
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.
+1 👍
fyi: when I put this into my fastapi project, I realised the noise is VERY HIGH - almost takes over the entire real estate..
Shouldn't the urllib3 instrumentation respect the contextvars to not infinite loop instrumentation? Are we maybe not propagating them correctly?
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.
OTEL currently has a haphazard mix of suppress instrumentation keys. We should probably just set all of them.
Well in this case it's about reading the correct key. OTEL conveniently sets it in the right places in BatchSpanProcessor and SimpleSpanProcessor.
Fixed by https://github.com/pydantic/logfire/pull/197