strawberry.extensions.tracing.DatadogTracingExtension
Constructor:
Signature:
def __init__(self, execution_context: ExecutionContext | None = None) -> None: ...
Parameters:
-
execution_context:
- Type
-
ExecutionContext | None
- Default
-
None
Methods:
-
create_span
Create a span with the given name and kwargs.
You can override this if you want to add more tags to the span.
Example:
class CustomExtension(DatadogTracingExtension):def create_span(self, lifecycle_step, name, **kwargs):span = super().create_span(lifecycle_step, name, **kwargs)if lifecycle_step == LifeCycleStep.OPERATION:span.set_tag("graphql.query", self.execution_context.query)return spanSignature:
def create_span(self, lifecycle_step: LifecycleStep, name: str, kwargs: Any = {}) -> Span:...Parameters:
-
lifecycle_step:
- Type
-
LifecycleStep
-
name:
- Type
-
str
-
kwargs:
- Type
-
Any
- Default
-
{}
-
-
hash_query
Signature:
def hash_query(self, query: str) -> str:...Parameters:
-
query:
- Type
-
str
-
-
on_operation
Signature:
def on_operation(self) -> Iterator[None]:... -
on_validate
Signature:
def on_validate(self) -> Generator[None, None, None]:... -
on_parse
Signature:
def on_parse(self) -> Generator[None, None, None]:... -
resolve
Signature:
def resolve(self,_next: Callable,root: Any,info: GraphQLResolveInfo,args: str = (),kwargs: Any = {},) -> Any:...Parameters:
-
_next:
- Type
-
Callable
-
root:
- Type
-
Any
-
info:
- Type
-
GraphQLResolveInfo
-
args:
- Type
-
str
- Default
-
()
-
kwargs:
- Type
-
Any
- Default
-
{}
-
Attributes:
-
execution_context: