View Source Telemetria.Backend behaviour (telemetria v0.23.1)
This behaviour should be implemented by the backend, used for actual telemetry events processing.
Backend shipped with the library:
Summary
Types
The context of the currently processing block.
The type used for naming blocks / events
The additional attributes of the block, aside from measurements
Callbacks
The implementation will be called when the block gets entered
The implementation will be called when the block context is to be exited
The implementation will be called to reshape the event before sending it to the actual handler
The implementation will be called when the block gets exited / executed
The implementation will be called when the block context is to be updated
Types
@type block_context() :: any()
The context of the currently processing block.
For instance, opentelemetry:span_ctx()
for otel
or nil
for telemetry
@type block_id() :: Telemetria.event_name()
The type used for naming blocks / events
@type block_metadata() :: map()
The additional attributes of the block, aside from measurements
Callbacks
@callback entry(block_id()) :: block_context() | [block_context()]
The implementation will be called when the block gets entered
@callback exit(block_context()) :: :ok
The implementation will be called when the block context is to be exited
@callback reshape(block_metadata()) :: block_metadata()
The implementation will be called to reshape the event before sending it to the actual handler
@callback return(block_context(), block_context()) :: block_context() | [block_context()]
The implementation will be called when the block gets exited / executed
@callback update(block_context(), block_metadata()) :: block_context() | [block_context()]
The implementation will be called when the block context is to be updated