A telemetry exporter receives one structured metadata event at a time. Event
payloads contain decision IDs, stages, actions, timing, counts, and status;
they do not contain prompt, output, finding matches, or reviewer excerpts.
The callback can translate these events to OpenTelemetry spans or another
observability backend outside the core package.
Usage
telemetry_options(
exporter,
service_name = "llmshieldr",
attributes = list(),
on_error = c("warn", "stop"),
show_stats = FALSE
)
Arguments
- exporter
Function receiving one event list.
- service_name
Service identifier added to every event.
- attributes
Additional scalar deployment attributes.
- on_error
Whether exporter failure warns and continues or stops.
- show_stats
Show construction time and available usage metrics.
Examples
events <- list()
telemetry <- telemetry_options(function(event) {
events[[length(events) + 1L]] <<- event
})