metrics

package
v0.67.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

Metrics collects OpenTelemetry metrics for the proxy.

func New

func New(ctx context.Context, meter metric.Meter) (*Metrics, error)

New creates a Metrics instance using the given OpenTelemetry meter.

func (*Metrics) AddMapping

func (m *Metrics) AddMapping(mapping proxy.Mapping)

AddMapping records that a domain mapping was added.

func (*Metrics) L4ServiceAdded added in v0.67.0

func (m *Metrics) L4ServiceAdded(mode types.ServiceMode)

L4ServiceAdded increments the L4 service gauge for the given mode.

func (*Metrics) L4ServiceRemoved added in v0.67.0

func (m *Metrics) L4ServiceRemoved(mode types.ServiceMode)

L4ServiceRemoved decrements the L4 service gauge for the given mode.

func (*Metrics) Middleware

func (m *Metrics) Middleware(next http.Handler) http.Handler

Middleware wraps an HTTP handler with request metrics.

func (*Metrics) RecordCertificateIssuance added in v0.66.3

func (m *Metrics) RecordCertificateIssuance(duration time.Duration)

RecordCertificateIssuance records the duration of a certificate issuance.

func (*Metrics) RemoveMapping

func (m *Metrics) RemoveMapping(mapping proxy.Mapping)

RemoveMapping records that a domain mapping was removed.

func (*Metrics) RoundTripper

func (m *Metrics) RoundTripper(next http.RoundTripper) http.RoundTripper

RoundTripper wraps an http.RoundTripper with backend duration metrics.

func (*Metrics) TCPRelayDialError added in v0.67.0

func (m *Metrics) TCPRelayDialError(accountID types.AccountID)

TCPRelayDialError records a dial failure for a TCP relay.

func (*Metrics) TCPRelayEnded added in v0.67.0

func (m *Metrics) TCPRelayEnded(accountID types.AccountID, duration time.Duration, srcToDst, dstToSrc int64)

TCPRelayEnded records a TCP relay connection ending and accumulates bytes and duration.

func (*Metrics) TCPRelayRejected added in v0.67.0

func (m *Metrics) TCPRelayRejected(accountID types.AccountID)

TCPRelayRejected records a rejected TCP relay (semaphore full).

func (*Metrics) TCPRelayStarted added in v0.67.0

func (m *Metrics) TCPRelayStarted(accountID types.AccountID)

TCPRelayStarted records a new TCP relay connection starting.

func (*Metrics) UDPPacketRelayed added in v0.67.0

func (m *Metrics) UDPPacketRelayed(direction types.RelayDirection, bytes int)

UDPPacketRelayed records a packet relayed in the given direction with its size in bytes.

func (*Metrics) UDPSessionDialError added in v0.67.0

func (m *Metrics) UDPSessionDialError(accountID types.AccountID)

UDPSessionDialError records a dial failure for a UDP session.

func (*Metrics) UDPSessionEnded added in v0.67.0

func (m *Metrics) UDPSessionEnded(accountID types.AccountID)

UDPSessionEnded records a UDP session ending.

func (*Metrics) UDPSessionRejected added in v0.67.0

func (m *Metrics) UDPSessionRejected(accountID types.AccountID)

UDPSessionRejected records a rejected UDP session (limit or rate limited).

func (*Metrics) UDPSessionStarted added in v0.67.0

func (m *Metrics) UDPSessionStarted(accountID types.AccountID)

UDPSessionStarted records a new UDP session starting.

Jump to

Keyboard shortcuts

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