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 ¶
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 // 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.
var BridgeBusToMetrics = internal.BridgeBusToMetrics
BridgeBusToMetrics folds bus events into the registry's counters; returns the bridge's stop func.
var BridgeBusToTracer = internal.BridgeBusToTracer
BridgeBusToTracer turns lifecycle event pairs into spans; returns the bridge's stop func.
var DefaultTraceBridgeFilter = internal.DefaultTraceBridgeFilter
DefaultTraceBridgeFilter scopes the trace bridge to the canonical lifecycle event pairs so a chatty bus never becomes span flood.
var New = internal.New
New constructs the redactor-mandatory Logger.
var NewMetricsRegistry = internal.NewMetricsRegistry
NewMetricsRegistry builds the metrics registry plus its shutdown func.
var NewTracer = internal.NewTracer
NewTracer builds the OTel tracer plus its shutdown func.
var PrometheusHandler = internal.PrometheusHandler
PrometheusHandler mounts the registry as an http.Handler when the prometheus exporter driver is configured.
var WithBusEmitter = internal.WithBusEmitter
WithBusEmitter pairs Logger.Error with runtime.error bus events.
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 ¶
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.
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). |