metrics

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	RecordOperation(ctx context.Context, operation string, status string, durationMs int64)
	RecordStage(ctx context.Context, operation string, stage string, durationMs int64)
	RecordError(ctx context.Context, operation string, errorType string)
	SetStorageCount(ctx context.Context, storageType string, count int64)
}

Collector is the interface for metrics collection. Implementations include the Prometheus-backed collector (when built with -tags metrics) and the no-op collector (default build without metrics tag).

type MetricsCollector

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

MetricsCollector provides Prometheus metrics collection for gognee operations

func NewCollector

func NewCollector() *MetricsCollector

NewCollector creates a new Prometheus metrics collector

func (*MetricsCollector) RecordError added in v1.3.0

func (m *MetricsCollector) RecordError(ctx context.Context, operation string, errorType string)

RecordError records an error occurrence

func (*MetricsCollector) RecordOperation added in v1.3.0

func (m *MetricsCollector) RecordOperation(ctx context.Context, operation string, status string, durationMs int64)

RecordOperation records the completion of an operation

func (*MetricsCollector) RecordStage added in v1.3.0

func (m *MetricsCollector) RecordStage(ctx context.Context, operation string, stage string, durationMs int64)

RecordStage records the duration of a specific stage within an operation

func (*MetricsCollector) Registry added in v1.3.0

func (m *MetricsCollector) Registry() *prometheus.Registry

Registry returns the Prometheus registry for HTTP exposure

func (*MetricsCollector) SetStorageCount added in v1.3.0

func (m *MetricsCollector) SetStorageCount(ctx context.Context, storageType string, count int64)

SetStorageCount sets the current count for a storage type

Jump to

Keyboard shortcuts

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