prometheus

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package prometheus provides the legacy Prometheus metric filter.

Deprecated: This filter is deprecated and will be removed in a future version. Use dgp.filter.http.metric instead

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Cfg  *MetricCollectConfiguration
	Prom *prom.Prometheus
}

func (*Filter) Decode

type FilterFactory

type FilterFactory struct {
	Cfg  *MetricCollectConfiguration
	Prom *prom.Prometheus
}

func (*FilterFactory) Apply

func (factory *FilterFactory) Apply() error

func (*FilterFactory) Config

func (factory *FilterFactory) Config() any

func (*FilterFactory) PrepareFilterChain

func (factory *FilterFactory) PrepareFilterChain(ctx *contextHttp.HttpContext, chain filter.FilterChain) error

type MetricCollectConfiguration

type MetricCollectConfiguration struct {
	Rules MetricCollectRule `yaml:"metric_collect_rules" json:"metric_collect_rules"`
}

MetricCollectConfiguration is the configuration for the legacy Prometheus filter. Deprecated: Use dgp.filter.http.metric instead.

type MetricCollectRule

type MetricCollectRule struct {
	MetricPath string `json:"metric_path,omitempty" yaml:"metric_path,omitempty"`
	// Push Gateway URL in format http://domain:port
	// where JOBNAME can be any string of your choice
	PushGatewayURL        string `default:"http://127.0.0.1:9091" json:"push_gateway_url,omitempty" yaml:"push_gateway_url,omitempty"`
	CounterPush           bool   `json:"counter_push,omitempty" yaml:"counter_push,omitempty"`
	PushIntervalThreshold int    `json:"push_interval_threshold" yaml:"push_interval_threshold,omitempty"`
	PushJobName           string `json:"push_job_name,omitempty" yaml:"push_job_name,omitempty"`
}

MetricCollectRule defines the metric collection rules. Deprecated: Use dgp.filter.http.metric instead.

type Plugin

type Plugin struct {
}

func (*Plugin) CreateFilterFactory

func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)

func (Plugin) Kind

func (p Plugin) Kind() string

Jump to

Keyboard shortcuts

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