Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry integration for AgentShield.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMeter ¶
func InitMeter(ctx context.Context, cfg *config.TelemetryConfig) (*sdkmetric.MeterProvider, error)
InitMeter creates an OTel MeterProvider with an OTLP/HTTP metric exporter. Returns nil when telemetry is disabled.
Types ¶
type MetricsRecorder ¶
type MetricsRecorder struct {
// contains filtered or unexported fields
}
MetricsRecorder records OTel metrics for AgentShield operations.
func NewMetricsRecorder ¶
func NewMetricsRecorder(meter otelmetric.Meter) (*MetricsRecorder, error)
NewMetricsRecorder creates a new MetricsRecorder using the given OTel Meter.
func (*MetricsRecorder) RecordEvaluation ¶
func (m *MetricsRecorder) RecordEvaluation(ctx context.Context, tool, action string, alertCount int, cached bool)
RecordEvaluation records metrics for a single evaluation.
type ShutdownFunc ¶
ShutdownFunc is called to flush and shut down the telemetry provider.
func Init ¶
func Init(ctx context.Context, cfg *config.TelemetryConfig, version string) (trace.TracerProvider, ShutdownFunc, error)
Init initialises the OpenTelemetry TracerProvider. When telemetry is disabled it returns a no-op provider. The returned ShutdownFunc must be called on process exit to flush pending spans.
Click to show internal directories.
Click to hide internal directories.