prometheus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

func New(config Config) (*Metrics, error)

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.

Jump to

Keyboard shortcuts

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