metric

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meter added in v0.7.0

type Meter struct {
	MP         *sdkmetric.MeterProvider
	Meter      otelmetric.Meter
	Prometheus *PrometheusExporter
	// contains filtered or unexported fields
}

Meter wraps an OTel MeterProvider and exposes a Meter for creating instruments.

func New added in v0.7.0

func New(ctx context.Context, cfg *model.Cfg, serviceName string, log *logger.Log) (*Meter, error)

New creates a new MeterProvider configured with an OTLP exporter (same collector as tracing) when metrics are enabled, or a no-op provider for testing and when disabled.

func NewForTesting added in v0.7.0

func NewForTesting(serviceName string, log *logger.Log) *Meter

NewForTesting returns a Meter backed by a no-op provider.

func (*Meter) HTTPHandler added in v0.7.0

func (m *Meter) HTTPHandler() http.Handler

HTTPHandler returns the Prometheus scrape HTTP handler, or nil if metrics are disabled.

func (*Meter) Shutdown added in v0.7.0

func (m *Meter) Shutdown(ctx context.Context) error

Shutdown flushes and shuts down the meter provider.

type PrometheusExporter added in v0.7.0

type PrometheusExporter struct {
	Reader  sdkmetric.Reader
	Handler http.Handler
}

PrometheusExporter holds the Prometheus reader and an HTTP handler for scraping.

func NewPrometheusExporter added in v0.7.0

func NewPrometheusExporter() (*PrometheusExporter, error)

NewPrometheusExporter creates a Prometheus exporter that can be added as a reader to the MeterProvider and also serves /metrics for scraping.

type VCI added in v0.7.0

type VCI struct {
	// OffersCreated counts credential offers generated.
	// Attributes: grant_type, credential_config_id, source
	OffersCreated metric.Int64Counter

	// TokensIssued counts access tokens issued at the token endpoint.
	// Attributes: grant_type
	TokensIssued metric.Int64Counter

	// CredentialsIssued counts successfully issued credentials.
	// Attributes: format, credential_config_id
	CredentialsIssued metric.Int64Counter

	// CredentialsFailed counts credential issuance failures.
	// Attributes: format, error_class
	CredentialsFailed metric.Int64Counter

	// DeferredCredentials counts deferred credential retrievals.
	// Attributes: status (issued, pending, expired)
	DeferredCredentials metric.Int64Counter

	// Notifications counts wallet notification events.
	// Attributes: event (credential_accepted, credential_failure)
	Notifications metric.Int64Counter

	// TokenLatency records token endpoint request duration.
	// Attributes: grant_type
	TokenLatency metric.Float64Histogram

	// IssuanceLatency records credential endpoint request duration.
	// Attributes: format
	IssuanceLatency metric.Float64Histogram
}

VCI holds OpenID4VCI (credential issuance) metric instruments. Labels are restricted to protocol-level metadata to avoid PII exposure.

func NewVCI added in v0.7.0

func NewVCI(m metric.Meter) (*VCI, error)

NewVCI creates VCI metric instruments from the given meter.

type VP added in v0.7.0

type VP struct {
	// RequestsCreated counts verification request objects created.
	// Attributes: (none — all requests are equivalent)
	RequestsCreated metric.Int64Counter

	// PresentationsReceived counts VP tokens received via direct_post.
	// Attributes: format
	PresentationsReceived metric.Int64Counter

	// VerificationsFailed counts presentation verification failures.
	// Attributes: error_class
	VerificationsFailed metric.Int64Counter

	// VerificationLatency records direct_post processing duration.
	// Attributes: (none)
	VerificationLatency metric.Float64Histogram
}

VP holds OpenID4VP (verifiable presentation) metric instruments. Labels are restricted to protocol-level metadata to avoid PII exposure.

func NewVP added in v0.7.0

func NewVP(m metric.Meter) (*VP, error)

NewVP creates VP metric instruments from the given meter.

Jump to

Keyboard shortcuts

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