pydantic / logfire

Uncomplicated Observability for Python and beyond! 🪵🔥
https://docs.pydantic.dev/logfire/
MIT License
1.62k stars 46 forks source link

Change level of Postgres Instrumentation #226

Closed bllchmbrs closed 3 weeks ago

bllchmbrs commented 3 weeks ago

Question

I'm using the postgres instrumentation.

It's quite chatty at the info level. Is there a way of lowering this? I took a look at the instrumentation docs for OpenTelemetry but I couldn't figure it out/see what I should do.

I'd like to drop it to debug

adriangb commented 3 weeks ago

Unfortunately there is nothing built into opentelemetry to lower the level of a group of spans (e.g. from an instrumentation).

I'm not saying it's a good long term solution but you could filter them out via a query filter.

@alexmojaki any ideas for making this part of the SDK? It could alter the level before exporting based on the scope name.

bllchmbrs commented 3 weeks ago

This would be a nice QoL improvement, it's so chatty it immediately overwhelms by logs.

bllchmbrs commented 3 weeks ago

The best practice here is to filter this in the UI either via a otel scope query: otel_scope_name != 'opentelemetry.instrumentation.psycopg2' or by clicking visibility and removing the scope.

alexmojaki commented 3 weeks ago

Discussion here: https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1717437392293579