bootstrapobservability

package
v1.0.0-beta.161 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package bootstrapobservability contains the plain Phase-A construction helpers shared by the production and E2E composition roots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectClient

func ConnectClient(ctx context.Context, client *natsclient.Client, logger *slog.Logger) error

ConnectClient connects and waits for readiness. It is the sole owner of the configured local failure record for both primary binary connection paths.

func EnsureEffectiveStreams

func EnsureEffectiveStreams(
	ctx context.Context,
	cfg *config.Config,
	client *natsclient.Client,
	logger *slog.Logger,
) error

EnsureEffectiveStreams verifies account limits and provisions all streams from post-arbitration desired state before forwarding can be installed.

func NewClient

func NewClient(urls string, logger *slog.Logger, metrics *metric.MetricsRegistry) (*natsclient.Client, error)

NewClient constructs a client with its explicit non-forwarding logger and metrics registry. Nil dependencies are rejected instead of defaulted.

func NewForwardingHandler

func NewForwardingHandler(
	services types.ServiceConfigs,
	publisher logging.NATSPublisher,
	logger *slog.Logger,
) (slog.Handler, error)

NewForwardingHandler resolves effective outer activation before decoding inner policy. Disabled and absent entries therefore cannot fail decoding.

func NewLocalHandler

func NewLocalHandler(output io.Writer, level, format string) (slog.Handler, error)

NewLocalHandler creates the one explicitly configured local handler shared by all Phase-A and steady-state logger graphs.

func StartConfigManager

func StartConfigManager(
	ctx context.Context,
	initial *config.Config,
	client *natsclient.Client,
	logger *slog.Logger,
) (*config.Manager, *config.Config, error)

StartConfigManager completes config arbitration and returns the effective desired state selected by the manager. The caller-supplied logger is retained by the manager for its lifetime.

func StartValidatedConfigManager

func StartValidatedConfigManager(
	ctx context.Context,
	initial *config.Config,
	client *natsclient.Client,
	logger *slog.Logger,
) (*config.Manager, *config.Config, error)

StartValidatedConfigManager arbitrates desired state and validates the selected effective configuration before returning it to either root.

func ValidateEffectiveConfig

func ValidateEffectiveConfig(cfg *config.Config, logger *slog.Logger) error

ValidateEffectiveConfig applies every composition validation gate to the post-arbitration config before resources or forwarding are composed from it.

Types

type PhaseALogging

type PhaseALogging struct {
	Process       *slog.Logger
	Client        *slog.Logger
	ConfigManager *slog.Logger
	// contains filtered or unexported fields
}

PhaseALogging is the non-forwarding logger graph created before NATS. Every logger derives from the same caller-supplied local handler and base attrs.

func NewE2EPhaseA

func NewE2EPhaseA(
	output io.Writer,
	level, format string,
	baseAttrs []slog.Attr,
) (*metric.MetricsRegistry, *PhaseALogging, error)

NewE2EPhaseA creates the E2E metrics registry and explicit stdout-only logger graph as one ordered Phase-A operation.

func NewPhaseALogging

func NewPhaseALogging(local, counter slog.Handler, baseAttrs []slog.Attr) (*PhaseALogging, error)

NewPhaseALogging creates process, client, and config-manager loggers from one explicit local handler. counter is optional only because E2E explicitly requires stdout-only behavior.

func NewProductionPhaseA

func NewProductionPhaseA(
	output io.Writer,
	level, format string,
	baseAttrs []slog.Attr,
) (*metric.MetricsRegistry, *PhaseALogging, error)

NewProductionPhaseA creates the production metrics registry and local plus WARN/ERROR-counter logger graph as one ordered Phase-A operation.

func (*PhaseALogging) Steady

func (l *PhaseALogging) Steady(destination slog.Handler) *slog.Logger

Steady derives the steady-state process logger from the same local graph and base attributes. A nil destination is the explicit stdout-only/disabled path.

Jump to

Keyboard shortcuts

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