You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My idea is that we release logfire-noop, this package has no dependencies and allows third-party libraries to integrate with logfire while still giving their users complete choice over whether to actually use Logfire.
The idea is that logfire-noop would contain two modules: logfire_noop and logfire_if_installed (name TBC)
logfire_noop exports types matching logfire but that do nothing, or do the minimum required for code to run, e.g. logfire.span() needs to return a context manager.
logfire_if_installed behaves like this:
when logfire is installed, it just the contents of logfire
when logfire is not installed, it just the contents of logfire_noop
Third party libraries would wuite code like this:
importlogfire_if_installed
...
defmy_library_method(...):
...
withlogfire.span('doing a thing {sniffle=}', sniffle=rofl):
...
The text was updated successfully, but these errors were encountered:
I think we should use the same namespace for logfire-noop and logfire i.e. if you install logfire-noop, you'll be able to access the same methods as logfire.
We should probably create the package within this repository, and have a job that checks that everything you can use on logfire can be used on logfire_noop.
Would it be possible for logfire-noop to have the same effect as instrumenting with opentelemetry-api? So that packages instrumented this way become compatible with both opentelemetry and logfire. I would definitely use this in https://github.com/jackmpcollins/magentic Relevant issue there jackmpcollins/magentic#136
Description
My idea is that we release
logfire-noop
, this package has no dependencies and allows third-party libraries to integrate with logfire while still giving their users complete choice over whether to actually use Logfire.The idea is that
logfire-noop
would contain two modules:logfire_noop
andlogfire_if_installed
(name TBC)logfire_noop
exports types matching logfire but that do nothing, or do the minimum required for code to run, e.g.logfire.span()
needs to return a context manager.logfire_if_installed
behaves like this:logfire
is installed, it just the contents oflogfire
logfire_noop
Third party libraries would wuite code like this:
The text was updated successfully, but these errors were encountered: