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 ¶
- type Set
- func (s *Set) ConnectorBytes(ctx context.Context, connector string, n int64)
- func (s *Set) ConnectorMessages(ctx context.Context, connector, stage string, n int64)
- func (s *Set) PrometheusSourceDetailsEnabled() bool
- func (s *Set) RemoveComponent(kind, id string)
- func (s *Set) RemoveConnector(connector string)
- func (s *Set) SetComponentState(kind, id string, state int64)
- func (s *Set) SetPrometheusSourceDetails(enabled bool)
- func (s *Set) SetQueueDepth(connector string, depth, bytes int64)
- func (s *Set) SinkClients(sink string, delta int64)
- func (s *Set) SinkHTTPRequest(ctx context.Context, sink, status, encoding string, ...)
- func (s *Set) SinkHTTPRetryAfter(ctx context.Context, sink, status string, delay time.Duration)
- func (s *Set) SourceDrops(ctx context.Context, component string, n int64)
- func (s *Set) SourceMessages(ctx context.Context, source string, n int64)
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 (*Set) ConnectorBytes ¶
func (*Set) ConnectorMessages ¶
func (*Set) PrometheusSourceDetailsEnabled ¶ added in v1.2.6
func (*Set) RemoveComponent ¶
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 ¶
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 (*Set) SetPrometheusSourceDetails ¶ added in v1.2.6
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 (*Set) SinkClients ¶
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
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 ¶
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.