metrics

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package metrics owns the OTel instrument set. A nil *Set no-ops every method so components never need nil checks around instrumentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

func New

func New(registries ...*stats.Registry) (*Set, http.Handler, error)

func (*Set) ConnectorBytes

func (s *Set) ConnectorBytes(ctx context.Context, connector string, n int64)

func (*Set) ConnectorMessages

func (s *Set) ConnectorMessages(ctx context.Context, connector, stage string, n int64)

func (*Set) PrometheusSourceDetailsEnabled added in v1.2.6

func (s *Set) PrometheusSourceDetailsEnabled() bool

func (*Set) RemoveComponent

func (s *Set) RemoveComponent(kind, id string)

RemoveComponent drops the component-state gauge entry for a source, sink, or connector. Called when a component is stopped and no longer desired (disabled or deleted) so its last state doesn't linger in the exposition.

func (*Set) RemoveConnector

func (s *Set) RemoveConnector(connector string)

RemoveConnector drops the queue depth/bytes gauge entry for a connector. Called when a connector is removed from config entirely so its last observed queue depth doesn't linger in the exposition forever.

func (*Set) SetComponentState

func (s *Set) SetComponentState(kind, id string, state int64)

func (*Set) SetPrometheusSourceDetails added in v1.2.6

func (s *Set) SetPrometheusSourceDetails(enabled bool)

SetPrometheusSourceDetails enables or disables the high-cardinality per-PGN, decoded-field, and raw-byte Prometheus surface. Ordinary source, delivery, queue, and component metrics remain available in either state.

func (*Set) SetQueueDepth

func (s *Set) SetQueueDepth(connector string, depth, bytes int64)

func (*Set) SinkClients

func (s *Set) SinkClients(sink string, delta int64)

func (*Set) SinkHTTPRequest added in v1.2.4

func (s *Set) SinkHTTPRequest(ctx context.Context, sink, status, encoding string,
	envelopes, payloadBytes, uncompressedBytes int64, latency time.Duration,
)

SinkHTTPRequest records one HTTP sink request attempt. status is the numeric response code, or "transport_error" when no response arrived. Payload sizes are recorded per request so their histogram count is also a batch/request count; envelopes records the number of canonical envelopes contained in that attempted payload.

func (*Set) SinkHTTPRetryAfter added in v1.2.4

func (s *Set) SinkHTTPRetryAfter(ctx context.Context, sink, status string, delay time.Duration)

SinkHTTPRetryAfter records a valid Retry-After value returned by an HTTP sink endpoint. It is separate from SinkHTTPRequest because most responses do not carry the header.

func (*Set) SourceDrops

func (s *Set) SourceDrops(ctx context.Context, component string, n int64)

SourceDrops records envelopes dropped by a full subscriber channel on a non-blocking broadcast (hub.publish for HTTP/CAN sources, busClient's internal broadcast for bus subscribers). component is the source id for hub drops, or "bus:<kind>:<name>" for a shared CAN client's internal broadcast.

func (*Set) SourceMessages

func (s *Set) SourceMessages(ctx context.Context, source string, n int64)

Jump to

Keyboard shortcuts

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