-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
30 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,25 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING, Callable, TypedDict | ||
|
||
from opentelemetry.trace import Span | ||
|
||
if TYPE_CHECKING: | ||
from wsgiref.types import WSGIEnvironment | ||
|
||
|
||
RequestHook = Callable[[Span, 'WSGIEnvironment'], None] | ||
"""A hook that is called before a request is processed.""" | ||
ResponseHook = Callable[[Span, str, 'list[tuple[str, str]]'], None] | ||
"""A hook that is called after a response is processed.""" | ||
|
||
|
||
class CommenterOptions(TypedDict, total=False): | ||
"""The `commenter_options` parameter for `instrument_flask`.""" | ||
|
||
framework: bool | ||
"""Include the framework name and version in the comment.""" | ||
route: bool | ||
"""Include the route name in the comment.""" | ||
controller: bool | ||
"""Include the controller name in the comment.""" |