Documentation
¶
Overview ¶
Package bootstrapobservability contains the plain Phase-A construction helpers shared by the production and E2E composition roots.
Index ¶
- func ConnectClient(ctx context.Context, client *natsclient.Client, logger *slog.Logger) error
- func EnsureEffectiveStreams(ctx context.Context, cfg *config.Config, client *natsclient.Client, ...) error
- func NewClient(urls string, logger *slog.Logger, metrics *metric.MetricsRegistry) (*natsclient.Client, error)
- func NewForwardingHandler(services types.ServiceConfigs, publisher logging.NATSPublisher, ...) (slog.Handler, error)
- func NewLocalHandler(output io.Writer, level, format string) (slog.Handler, error)
- func StartConfigManager(ctx context.Context, initial *config.Config, client *natsclient.Client, ...) (*config.Manager, *config.Config, error)
- func StartValidatedConfigManager(ctx context.Context, initial *config.Config, client *natsclient.Client, ...) (*config.Manager, *config.Config, error)
- func ValidateEffectiveConfig(cfg *config.Config, logger *slog.Logger) error
- type PhaseALogging
- func NewE2EPhaseA(output io.Writer, level, format string, baseAttrs []slog.Attr) (*metric.MetricsRegistry, *PhaseALogging, error)
- func NewPhaseALogging(local, counter slog.Handler, baseAttrs []slog.Attr) (*PhaseALogging, error)
- func NewProductionPhaseA(output io.Writer, level, format string, baseAttrs []slog.Attr) (*metric.MetricsRegistry, *PhaseALogging, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectClient ¶
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 ¶
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.
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 ¶
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.