Documentation
¶
Overview ¶
Package prometheus provides the official Prometheus metrics integration for postgres-sqlguard validation outcomes.
New registers a counter with a caller-supplied registerer. The integration never uses the process-global registry implicitly. Its service label is fixed at construction, and its remaining labels come only from the bounded sqlguard.ValidationEvent dimensions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Registerer prometheusclient.Registerer
Service string
MetricName string
}
Config contains immutable construction-time settings for Metrics.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics records bounded postgres-sqlguard validation outcomes in a Prometheus counter registered with the configured registry.
func New ¶
New validates config, registers the validation counter with the supplied registerer, and returns a Prometheus metrics implementation.
func (*Metrics) RecordValidation ¶
func (m *Metrics) RecordValidation(event sqlguard.ValidationEvent) error
RecordValidation records one bounded validation event.