Auto TraceΒΆ
Metaclass for automatic method tracing via OpenTelemetry.
ClassesΒΆ
AutoTracedMeta ΒΆ
Bases: type
Metaclass that automatically applies @traced_and_logged to all public methods.
This enables automatic OpenTelemetry span creation and debug logging for all method calls on classes using this metaclass.
Control via environment variable
FLOCK_AUTO_TRACE=true - Enable auto-tracing (default) FLOCK_AUTO_TRACE=false - Disable auto-tracing
Example
class Agent(metaclass=AutoTracedMeta): def execute(self, ctx, artifacts): # Automatically traced and logged ...
FunctionsΒΆ
__new__ ΒΆ
Create a new class with auto-traced methods.
Source code in src/flock/logging/auto_trace.py
FunctionsΒΆ
skip_trace ΒΆ
Decorator to mark a method to skip auto-tracing.
Use this for methods that are called very frequently or are not interesting for debugging purposes.
Example
class Agent(metaclass=AutoTracedMeta): @skip_trace def _internal_helper(self): # Not traced ...