ops

module
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT

README

ops

Org library for application operations surface: probe and metrics actuators, HTTP transport.

Supersedes the experimental actuator repo.

Stack: res v0.22, sdi v0.21, srv-http (HTTPMetrics auto-registers on import).

Layout

probe/                 # readiness / liveness actuator
metrics/               # Prometheus registry actuator + Metricer scrape surface
transport/http/        # OpenAPI HTTP transport + srv-http server config

Each actuator:

interface.go   # surface API (Prober / Metricer)
deps.go        # domain port interfaces
actuator.go    # SDI Compatible implementation
use/use.go     # unique.MustAddFixed / MustAddReplaceable

Zero-config

import (
    _ "github.com/omcrgnt/ops/transport/http/use"
    srvhttp "github.com/omcrgnt/srv-http" // Server types; HTTPMetrics via init
)

app.Run(&appResources, app.Pipeline{Registry: unique.Global(), ...})

One blank import registers probe actuator, metrics actuator + shared *prometheus.Registry, ops HTTP handler, and default ops server (DefaultServer, :8080).

Import srv-http for domain Server[T]HTTPMetrics singleton registers in unique.Global automatically (no separate use package).

Metrics without ops REST: _ "github.com/omcrgnt/ops/metrics/use" only (registry + actuator, no /metrics route).

Optional override: *ophttp.Server in AppResources with ecfg tags (resource → Config spec → *Server); materialize dedup removes the replaceable DefaultServer.

Codegen

task gen   # oapi-codegen from transport/http/openapi/

See docs/architecture.md.

Directories

Path Synopsis
use
Package use registers the shared Prometheus registry and metrics actuator in unique.Global.
Package use registers the shared Prometheus registry and metrics actuator in unique.Global.
use
Package use registers the probe actuator in unique.Global.
Package use registers the probe actuator in unique.Global.
transport
http
Package http provides the ops HTTP transport: OpenAPI probe routes and srv-http server config.
Package http provides the ops HTTP transport: OpenAPI probe routes and srv-http server config.
http/oapi
Package oapi provides primitives to interact with the openapi HTTP API.
Package oapi provides primitives to interact with the openapi HTTP API.
http/use
Package use registers probe actuator, metrics platform, and ops HTTP transport defaults in unique.Global.
Package use registers probe actuator, metrics platform, and ops HTTP transport defaults in unique.Global.

Jump to

Keyboard shortcuts

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