Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Enabled controls whether enhanced metrics are collected
Enabled bool `mapstructure:"enabled"`
// EndpointPatterns configures endpoint pattern matching and grouping
EndpointPatterns EndpointPatternsConfig `mapstructure:"endpoint_patterns"`
// CollectSizes enables request/response body size tracking
CollectSizes bool `mapstructure:"collect_sizes"`
// CollectQueueTime enables queue time vs processing time breakdown
CollectQueueTime bool `mapstructure:"collect_queue_time"`
// CollectWorkerInfo enables worker pool health metrics
CollectWorkerInfo bool `mapstructure:"collect_worker_info"`
// DurationBuckets defines histogram buckets for duration metrics (in seconds)
DurationBuckets []float64 `mapstructure:"duration_buckets"`
// SizeBuckets defines histogram buckets for size metrics (in bytes)
SizeBuckets []float64 `mapstructure:"size_buckets"`
}
Config represents the prometheus plugin configuration
type Configurer ¶
type Configurer interface {
// UnmarshalKey reads configuration section into provided structure
UnmarshalKey(name string, out interface{}) error
// Has checks if configuration section exists
Has(name string) bool
}
Configurer interface for reading plugin configuration
type EndpointMatcher ¶
type EndpointMatcher struct {
// contains filtered or unexported fields
}
EndpointMatcher matches request paths to endpoint patterns Uses LRU cache to minimize regex matching overhead
func NewEndpointMatcher ¶
func NewEndpointMatcher(config EndpointPatternsConfig) (*EndpointMatcher, error)
NewEndpointMatcher creates a new endpoint matcher from configuration
func (*EndpointMatcher) Match ¶
func (em *EndpointMatcher) Match(path string) string
Match returns the endpoint pattern for a given path Uses cached results when available, falls back to regex matching
type EndpointPatternsConfig ¶
type EndpointPatternsConfig struct {
// Enabled controls whether endpoint pattern matching is active
Enabled bool `mapstructure:"enabled"`
// MaxPatterns limits the number of unique endpoint patterns to prevent cardinality explosion
MaxPatterns int `mapstructure:"max_patterns"`
// Rules defines regex patterns for grouping similar endpoints
Rules []PatternRule `mapstructure:"rules"`
// CacheSize defines the LRU cache size for pattern matching results
CacheSize int `mapstructure:"cache_size"`
}
EndpointPatternsConfig configures endpoint pattern matching
type PatternRule ¶
type PatternRule struct {
// Pattern is the regex pattern to match against request paths
Pattern string `mapstructure:"pattern"`
// Name is the label value to use when pattern matches
Name string `mapstructure:"name"`
}
PatternRule defines a single pattern matching rule
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Init ¶
func (p *Plugin) Init(cfg Configurer) error
func (*Plugin) MetricsCollector ¶
func (p *Plugin) MetricsCollector() []prometheus.Collector
Click to show internal directories.
Click to hide internal directories.