obs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package obs provides the platform's structured logger: a JSON slog handler to stderr with correlation-id awareness.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithCorrelation

func ContextWithCorrelation(ctx context.Context, correlationID string) context.Context

ContextWithCorrelation returns a context carrying the given correlation id.

func CorrelationFromContext

func CorrelationFromContext(ctx context.Context) (string, bool)

CorrelationFromContext returns the correlation id stored in ctx, if any.

func New

func New(service string) *slog.Logger

New returns a JSON slog.Logger writing to stderr, tagged with the given service name. Every record carries "service", "time", "level", and "msg".

func WithCorrelation

func WithCorrelation(ctx context.Context, logger *slog.Logger) *slog.Logger

WithCorrelation returns logger enriched with a "correlationId" field when ctx carries one; otherwise it returns logger unchanged.

Types

This section is empty.

Directories

Path Synopsis
Package metrics is the platform's Prometheus exposition package: one Registry per service process, built once in that service's main and threaded through to (a) an HTTP middleware wrapped directly around the service's own mux (b) a GET /metrics handler on the service's own listener and (c) whichever service-specific Record*/Observe* calls that service's own code needs (authz's decision path, notification's delivery worker, the gateway's module proxy).
Package metrics is the platform's Prometheus exposition package: one Registry per service process, built once in that service's main and threaded through to (a) an HTTP middleware wrapped directly around the service's own mux (b) a GET /metrics handler on the service's own listener and (c) whichever service-specific Record*/Observe* calls that service's own code needs (authz's decision path, notification's delivery worker, the gateway's module proxy).

Jump to

Keyboard shortcuts

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