telemetry

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package telemetry is the public SDK facade over Harbor's internal/telemetry package — the redactor-mandatory structured Logger, the bus→metrics bridge, and the bus→tracer bridge that derive Harbor's three signals from the one canonical event stream (RFC §3.6, §6.14; D-204/D-206). Alias-based re-exports only: no behavior lives here. Added in Phase 112b: the observe-an-embedded-runtime recipe's manual-composition path is consumer-facing and flushed the names out. Exporter driver registration, the slog handler internals, and the cardinality lint are deliberately private.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLoggerNotConfigured — invalid log format/level configuration.
	ErrLoggerNotConfigured = internal.ErrLoggerNotConfigured
	// ErrRedactorMissing — New was called with a nil redactor; there
	// is no unredacted-logger mode.
	ErrRedactorMissing = internal.ErrRedactorMissing
	// ErrMetricsNotConfigured — the metrics registry config is invalid.
	ErrMetricsNotConfigured = internal.ErrMetricsNotConfigured
	// ErrMetricExporterUnknown — the named metric exporter driver is
	// not registered (blank-import sdk/drivers/prod).
	ErrMetricExporterUnknown = internal.ErrMetricExporterUnknown
	// ErrPrometheusHandlerUnavailable — the registry was not built
	// with the prometheus exporter.
	ErrPrometheusHandlerUnavailable = internal.ErrPrometheusHandlerUnavailable
	// ErrBridgeMisconfigured — BridgeBusToMetrics missing a mandatory
	// dependency.
	ErrBridgeMisconfigured = internal.ErrBridgeMisconfigured
	// ErrTraceBridgeMisconfigured — BridgeBusToTracer missing a
	// mandatory dependency.
	ErrTraceBridgeMisconfigured = internal.ErrTraceBridgeMisconfigured
)

Re-exported sentinel errors callers compare via errors.Is.

View Source
var BridgeBusToMetrics = internal.BridgeBusToMetrics

BridgeBusToMetrics folds bus events into the registry's counters; returns the bridge's stop func.

View Source
var BridgeBusToTracer = internal.BridgeBusToTracer

BridgeBusToTracer turns lifecycle event pairs into spans; returns the bridge's stop func.

View Source
var DefaultTraceBridgeFilter = internal.DefaultTraceBridgeFilter

DefaultTraceBridgeFilter scopes the trace bridge to the canonical lifecycle event pairs so a chatty bus never becomes span flood.

New constructs the redactor-mandatory Logger.

View Source
var NewMetricsRegistry = internal.NewMetricsRegistry

NewMetricsRegistry builds the metrics registry plus its shutdown func.

View Source
var NewTracer = internal.NewTracer

NewTracer builds the OTel tracer plus its shutdown func.

View Source
var PrometheusHandler = internal.PrometheusHandler

PrometheusHandler mounts the registry as an http.Handler when the prometheus exporter driver is configured.

View Source
var WithBusEmitter = internal.WithBusEmitter

WithBusEmitter pairs Logger.Error with runtime.error bus events.

View Source
var WithWriter = internal.WithWriter

WithWriter redirects the Logger's slog output (tests, captures).

Functions

This section is empty.

Types

type BusEmitter

type BusEmitter = internal.BusEmitter

BusEmitter is the Logger's runtime.error emission seam (sdk/telemetry/eventbus provides the production adapter).

type Logger

type Logger = internal.Logger

Logger is the redactor-mandatory structured logger; Error calls pair a runtime.error bus event with the slog record.

type MetricsOption

type MetricsOption = internal.MetricsOption

MetricsOption customises NewMetricsRegistry.

type MetricsRegistry

type MetricsRegistry = internal.MetricsRegistry

MetricsRegistry is the low-cardinality metrics projection of the event stream.

type Option

type Option = internal.Option

Option customises New (bus emitter, writer).

type Tracer

type Tracer = internal.Tracer

Tracer turns lifecycle event pairs into OTel spans.

type TracerOption

type TracerOption = internal.TracerOption

TracerOption customises NewTracer.

Directories

Path Synopsis
Package eventbus is the public SDK facade over Harbor's internal/telemetry/eventbus package — the production BusEmitter adapter that pairs Logger.Error calls with runtime.error events on the canonical bus (RFC §3.6, §6.14; D-204/D-206).
Package eventbus is the public SDK facade over Harbor's internal/telemetry/eventbus package — the production BusEmitter adapter that pairs Logger.Error calls with runtime.error events on the canonical bus (RFC §3.6, §6.14; D-204/D-206).

Jump to

Keyboard shortcuts

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