pip_services3_components.trace.CompositeTracer module
-
class
pip_services3_components.trace.CompositeTracer.
CompositeTracer
(references: pip_services3_commons.refer.IReferences.IReferences = None) Bases:
pip_services3_components.trace.ITracer.ITracer
,pip_services3_commons.refer.IReferenceable.IReferenceable
Aggregates all tracers from component references under a single component.
It allows to record traces and conveniently send them to multiple destinations.
- ### References ###
*:tracer:*:*:1.0 (optional)
ITracer
components to pass operation traces
See
ITracer
Example:
-
begin_trace
(correlation_id: Optional[str], component: str, operation: str) → pip_services3_components.trace.TraceTiming.TraceTiming Begings recording an operation trace
- Parameters
correlation_id – (optional) transaction id to trace execution through call chain.
component – a name of called component
operation – a name of the executed operation.
- Returns
a trace timing object.
-
failure
(correlation_id: Optional[str], component: str, operation: str, error: Exception, duration: float) Records an operation failure with its name, duration and error
- Parameters
correlation_id – (optional) transaction id to trace execution through call chain.
component – a name of called component
operation – a name of the executed operation.
error – an error object associated with this trace.
duration – execution duration in milliseconds.
-
set_references
(references: pip_services3_commons.refer.IReferences.IReferences) Sets references to dependent components.
- Parameters
references – references to locate the component dependencies.
-
trace
(correlation_id: Optional[str], component: str, operation: str, duration: float) → None Records an operation trace with its name and duration
- Parameters
correlation_id – (optional) transaction id to trace execution through call chain.
component – a name of called component
operation – a name of the executed operation.
duration – execution duration in milliseconds.