metrics

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TransformationErrors = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pigo_transformation_errors_total",
			Help: "Total number of transformation errors by type and pipeline",
		},
		[]string{"error_type", "pipeline", "source", "sink"},
	)

	PublishErrors = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pigo_publish_errors_total",
			Help: "Total number of publish errors by sink",
		},
		[]string{"sink"},
	)

	ProcessedEvents = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pigo_processed_events_total",
			Help: "Total number of processed events by pipeline",
		},
		[]string{"pipeline", "source", "sink"},
	)

	EventProcessingDuration = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "pigo_event_processing_duration_seconds",
			Help:    "Duration of event processing",
			Buckets: prometheus.DefBuckets,
		},
		[]string{"pipeline", "source", "sink"},
	)
)

Functions

func StartPrometheusServer

func StartPrometheusServer(ctx context.Context, wg *sync.WaitGroup, opts *PromServerOpts)

StartPrometheusServer starts a Prometheus metrics server with the given options The server gracefully shutdown when the provided context is canceled

Types

type PromServerOpts

type PromServerOpts struct {
	Addr              string
	Path              string        // Path for metrics endpoint, defaults to "/metrics"
	ShutdownTimeout   time.Duration // Timeout for server shutdown, defaults to 5 seconds
	ReadHeaderTimeout time.Duration // Timeout for reading request headers, defaults to 3 seconds
}

Jump to

Keyboard shortcuts

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