telemetry

package
v0.0.0-...-5fa7315 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package telemetry provides OpenTelemetry integration for AgentShield.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMeter

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

type ShutdownFunc func(ctx context.Context) error

ShutdownFunc is called to flush and shut down the telemetry provider.

func Init

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL