-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logfire.instrument_requests() (#196)
Co-authored-by: Alex Hall <alex.mojaki@gmail.com>
- Loading branch information
1 parent
60455c1
commit 0032545
Showing
5 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import Any, Optional | ||
|
||
from opentelemetry.instrumentation.requests import RequestsInstrumentor | ||
|
||
|
||
def instrument_requests(excluded_urls: Optional[str] = None, **kwargs: Any): | ||
"""Instrument the `requests` module so that spans are automatically created for each request. | ||
See the `Logfire.instrument_requests` method for details. | ||
""" | ||
RequestsInstrumentor().instrument(excluded_urls=excluded_urls, **kwargs) # type: ignore[reportUnknownMemberType] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters