telemetry

package
v0.64.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attrs

type Attrs map[string]string

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

func NewBridge

func NewBridge(sink TelemetrySink, config BridgeConfig) *Bridge

func (*Bridge) Collect

func (b *Bridge) Collect(ctx context.Context, app modular.Application) error

type BridgeConfig

type BridgeConfig struct {
	Timeout time.Duration
}

type ContextServiceInvoker

type ContextServiceInvoker interface {
	InvokeServiceContext(context.Context, string, map[string]any) (map[string]any, error)
}

type LogEmitter

type LogEmitter interface {
	DrainTelemetryLogs(context.Context) []LogRecord
}

type LogRecord

type LogRecord struct {
	Timestamp time.Time
	Level     string
	Message   string
	Module    string
	Attrs     Attrs
}

type MetricEmitter

type MetricEmitter interface {
	EmitMetrics(context.Context, MetricRecorder) error
}

type MetricKind

type MetricKind string
const (
	MetricCounter   MetricKind = "counter"
	MetricGauge     MetricKind = "gauge"
	MetricHistogram MetricKind = "histogram"
)

type MetricRecord

type MetricRecord struct {
	Name      string
	Kind      MetricKind
	Value     float64
	Attrs     Attrs
	Timestamp time.Time
}

type MetricRecorder

type MetricRecorder interface {
	Counter(name string, value float64, attrs Attrs)
	Gauge(name string, value float64, attrs Attrs)
	Histogram(name string, value float64, attrs Attrs)
}

type NoopSink

type NoopSink struct{}

func (NoopSink) RecordLogs

func (NoopSink) RecordLogs(context.Context, []LogRecord) error

func (NoopSink) RecordMetrics

func (NoopSink) RecordMetrics(context.Context, []MetricRecord) error

func (NoopSink) RecordSpanEvents

func (NoopSink) RecordSpanEvents(context.Context, []SpanEvent) error

type ServiceInvokerSink

type ServiceInvokerSink struct {
	// contains filtered or unexported fields
}

func NewServiceInvokerSink

func NewServiceInvokerSink(invoker ContextServiceInvoker) *ServiceInvokerSink

func (*ServiceInvokerSink) RecordLogs

func (s *ServiceInvokerSink) RecordLogs(ctx context.Context, records []LogRecord) error

func (*ServiceInvokerSink) RecordMetrics

func (s *ServiceInvokerSink) RecordMetrics(ctx context.Context, records []MetricRecord) error

func (*ServiceInvokerSink) RecordSpanEvents

func (s *ServiceInvokerSink) RecordSpanEvents(ctx context.Context, records []SpanEvent) error

type SnapshotRecorder

type SnapshotRecorder struct {
	// contains filtered or unexported fields
}

func NewSnapshotRecorder

func NewSnapshotRecorder() *SnapshotRecorder

func (*SnapshotRecorder) Counter

func (r *SnapshotRecorder) Counter(name string, value float64, attrs Attrs)

func (*SnapshotRecorder) Gauge

func (r *SnapshotRecorder) Gauge(name string, value float64, attrs Attrs)

func (*SnapshotRecorder) Histogram

func (r *SnapshotRecorder) Histogram(name string, value float64, attrs Attrs)

func (*SnapshotRecorder) Metrics

func (r *SnapshotRecorder) Metrics() []MetricRecord

type SpanEvent

type SpanEvent struct {
	Name      string
	Attrs     Attrs
	Timestamp time.Time
}

type SpanRecorder

type SpanRecorder interface {
	Event(name string, attrs Attrs)
	Attribute(key, value string)
}

type TelemetrySink

type TelemetrySink interface {
	RecordMetrics(context.Context, []MetricRecord) error
	RecordLogs(context.Context, []LogRecord) error
	RecordSpanEvents(context.Context, []SpanEvent) error
}

type TraceAnnotator

type TraceAnnotator interface {
	AnnotateSpan(context.Context, SpanRecorder)
}

Jump to

Keyboard shortcuts

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