-
Notifications
You must be signed in to change notification settings - Fork 81
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
Document Requests kwargs #679
Conversation
Deploying logfire-docs with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normal arguments are definitely better. Each integration can also have **kwargs: Any
which is documented as something like 'other arguments passed to OTEL, intended for forward compatibility'.
logfire/__init__.py
Outdated
'StructlogProcessor', | ||
'LogfireLoggingHandler', | ||
'loguru_handler', | ||
'SamplingOptions', | ||
'MetricsOptions', | ||
'CeleryInstrumentKwargs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should in general avoid adding things to __init__
if they only serve as type hints.
afb3724
to
c4a4f03
Compare
@alexmojaki please confirm if this is okay for you. If it's, I'll add the others. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #679 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 137 137
Lines 10919 10920 +1
Branches 1520 1520
=========================================
+ Hits 10919 10920 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this approach looks good
@@ -1174,17 +1174,26 @@ def instrument_httpx( | |||
self._warn_if_not_initialized_for_instrumentation() | |||
return instrument_httpx(self, client, **kwargs) | |||
|
|||
def instrument_celery(self, **kwargs: Unpack[CeleryInstrumentKwargs]) -> None: | |||
def instrument_celery(self, **kwargs: Any) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about skip_dep_check
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed on purpose. Is it really important? People shouldn't use it anyway... Unless specific cases like psycopg-binary
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's not that important but I wasn't sure if it was intentional. Let's leave it out.
def instrument_requests( | ||
self, | ||
excluded_urls: str | None = None, | ||
request_hook: Callable[[Span, requests.PreparedRequest], None] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice of otel to pass the actual request object this time lol
let me know if this is okay, and I'll apply to the others. |
c4bc011
to
e4ce95e
Compare
e4ce95e
to
6b59d52
Compare
Should we actually remove the kwargs and use the parameters? It's just a bad experience in every sense to have kwargs.