Help us shape the future of Go! Take the 2026 Go Developer Survey

metricsadapter

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package metricsadapter implements bridge.MetricsCollector over a go-utils metrics registry, such as a Forge app's.

You only need it if you embed the engine and want the bridge signals (hook-bus events and the operational counters IncrementCounter carries) in a registry. In a Forge app the extension passes the app's registry to authsome.WithMetricsSink instead, which records authsome's own metric families and needs no adapter.

Every family this adapter writes keeps the same label keys on every series, and none is labelled by tenant: the tenant the engine passes is an app ID, which is unbounded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements bridge.MetricsCollector over a metrics registry.

func New

func New(m forge.Metrics) *Adapter

New returns an adapter recording into m. A nil registry yields a nil adapter, which callers treat as "no metrics".

func (*Adapter) IncrementCounter

func (a *Adapter) IncrementCounter(name, _ string)

IncrementCounter implements bridge.MetricsCollector: IncrementCounter("auth.lockout", ...) adds one to authsome_auth_lockout_total. The tenant is ignored.

func (*Adapter) IncrementGauge

func (a *Adapter) IncrementGauge(name, _ string, delta int)

IncrementGauge implements bridge.MetricsCollector. The tenant is ignored.

func (*Adapter) RecordEvent

func (a *Adapter) RecordEvent(action, resource, outcome, _ string, duration time.Duration)

RecordEvent implements bridge.MetricsCollector: authsome_events_total by action, resource and outcome and, when a duration is given, a histogram of it in seconds under the same labels. The tenant is ignored.

Jump to

Keyboard shortcuts

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