pydantic / logfire

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

Don't configure automatically #194

Closed alexmojaki closed 4 months ago

alexmojaki commented 4 months ago

As announced in https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1716143149301069, the log/span/instrument methods shouldn't implicitly initialize config. This requires a few steps:

  1. Make sure that all docs explicitly call logfire.configure() before anything else.
  2. https://github.com/pydantic/logfire/issues/193 so that instument_* methods can emit a warning if called before configuring. Currently the problem is that users may call e.g. SQLAlchemyInstrumentor().instrument() and forget to configure and we can't do anything about that.
  3. Emit warnings when calling methods before configure.
  4. Stop emitting spans (but keep the warning) when calling methods before configure.
bllchmbrs commented 4 months ago

Please!