Documentation
¶
Overview ¶
Package telemetry exports every tool call as an OpenTelemetry span, over OTLP/HTTP with JSON encoding, so agentgate's decisions show up next to the rest of your traces in Jaeger, Tempo, Honeycomb, Datadog or anything else that speaks OTLP.
Each session is one trace and each call a span in it, named the way the MCP semantic conventions name them ("tools/call write_file") and carrying the GenAI and MCP attributes plus agentgate's own: the decision, the rule and the reason.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Endpoint is the OTLP/HTTP base URL, e.g. http://localhost:4318. Spans
// are posted to <endpoint>/v1/traces.
Endpoint string `yaml:"endpoint"`
// Headers are sent with every export, e.g. an API key.
Headers map[string]string `yaml:"headers"`
// ServiceName defaults to agentgate.
ServiceName string `yaml:"service_name"`
}
Config is where spans go. The OTEL_* environment variables fill in what the config file leaves out, so an existing OpenTelemetry setup works as is.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter batches spans and posts them in the background. A slow or dead collector never slows a tool call down: when the buffer is full, spans are dropped and counted.
type Span ¶
type Span struct {
CallID string
SessionID string
Tool string
Upstream string
HostName string
HostVersion string
Start time.Time
Duration time.Duration
Decision string
RuleID string
Reason string
IsError bool
Error string
Shadow bool
Labels []string
}
Span is one tool call as it is exported.