metrics

package
v0.0.0-...-946f5b7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeRequestWriter

type FakeRequestWriter struct {
}

func (*FakeRequestWriter) Write

func (f *FakeRequestWriter) Write(ctx context.Context, database string, wr prompb.WriteRequest) error

type Handler

type Handler struct {
	Path string

	// DropLabels is a map of metric names regexes to label name regexes.  When both match, the label will be dropped.
	DropLabels map[*regexp.Regexp]*regexp.Regexp

	// DropMetrics is a slice of regexes that drops metrics when the metric name matches.  The metric name format
	// should match the Prometheus naming style before the metric is translated to a Kusto table name.
	DropMetrics []*regexp.Regexp
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(opts HandlerOpts) *Handler

func (*Handler) HandleReceive

func (s *Handler) HandleReceive(w http.ResponseWriter, r *http.Request)

HandleReceive handles the prometheus remote write requests and writes them to the store.

func (*Handler) ServeHTTP

func (s *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type HandlerOpts

type HandlerOpts struct {
	// Path is the path where the handler will be registered.
	Path string

	RequestTransformer interface {
		TransformWriteRequest(req *prompb.WriteRequest) *prompb.WriteRequest
	}

	// RequestWriter is the interface that writes the time series to a destination.
	RequestWriter RequestWriter

	// Health is the interface that determines if the service is healthy.
	HealthChecker HealthChecker

	// Database is the name of the Kusto database where time series will be written.
	Database string
}

type HealthChecker

type HealthChecker interface {
	IsHealthy() bool
}

type RequestWriter

type RequestWriter interface {
	// Write writes the time series to the correct peer.
	Write(ctx context.Context, wr *prompb.WriteRequest) error
}

type SeriesCounter

type SeriesCounter interface {
	AddSeries(key string, id uint64)
}

Jump to

Keyboard shortcuts

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