obs

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package obs holds runeward's observability wiring: structured logging and Prometheus metrics. It has no dependency on the control plane, so any package can record metrics without creating an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncSandboxCreated

func IncSandboxCreated()

IncSandboxCreated bumps the sandbox-creation counter.

func MetricsHandler

func MetricsHandler() http.Handler

MetricsHandler serves the Prometheus exposition endpoint.

func NewLogger

func NewLogger() *slog.Logger

NewLogger builds the structured logger for the operator-facing services. $RUNEWARD_LOG_FORMAT selects "json" or "text" (default text); $RUNEWARD_LOG_LEVEL selects debug/info/warn/error (default info). Logs go to stderr.

func RecordAction

func RecordAction(tool, verdict string, durationMS int64)

RecordAction records one governed action outcome. durationMS <= 0 (denied or non-executed actions) skips the duration observation.

func SetBuildInfo

func SetBuildInfo(version string)

SetBuildInfo publishes the running version as a build_info gauge.

func StdLogger

func StdLogger(l *slog.Logger) *log.Logger

StdLogger adapts an slog.Logger to a *log.Logger, so packages that still take the stdlib logger emit through the same structured pipeline.

Types

This section is empty.

Jump to

Keyboard shortcuts

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