Monitoring API (wire format)
Generated Protocol Buffer messages and gRPC service stubs for the piko.monitoring.v1 API. This is the wire-format definition consumed by Piko's CLI and TUI to introspect a running app, not a Go API you call directly.
Overview
The package is the gen/ directory containing monitoring.pb.go and monitoring_grpc.pb.go, produced by protoc-gen-go and protoc-gen-go-grpc from monitoring.proto. The files carry a "DO NOT EDIT" banner, and regenerating them from the proto definition keeps the wire format authoritative across versions. There is no constructor, no service implementation, and no factory. Those live in monitoring_transport_grpc, the package that hosts the gRPC server.
The role of monitoring_api is the contract. It defines the request and response messages for runtime introspection (registered routes, telemetry spans, metrics, health, profiling, watchdog state, rate limiter state) and the gRPC service stubs both ends use. The Piko server registers these stubs, and the CLI and TUI import the same generated package to dial the running app's monitoring port. Every side compiles against one set of stubs, so there is no separate client SDK to keep in sync.
You import the package directly only if you are building a custom client, for example an alternative TUI or a Prometheus-style exporter that scrapes the monitoring service. For the typical case of the standard CLI talking to a running app, you register monitoring_transport_grpc.Transport() on the running app and the CLI handles the rest.
Exposed services
The contract defines every service stub, but the transport registers each one only when its domain dependency exists. The health service registers always. The metrics service registers when a telemetry, system stats, or resource provider is present. Each inspector (orchestrator, registry, dispatcher, rate limiter, provider info, profiling, watchdog) registers only when its own dependency is non-nil. The exposed surface tracks what the app actually wired, so a client may find that, for example, the watchdog or metrics service is absent when the matching subsystem is off.
The transport registers gRPC reflection by default, which advertises the full service list over the wire. The server-side comment recommends turning it off in production. Disable it with monitoring_transport_grpc.WithReflection(false).
Requirements
- Generated code only, no native dependencies, no system libraries. The package is an indirect dependency of any code that touches the monitoring transport.
google.golang.org/grpcandgoogle.golang.org/protobufarrive as transitive dependencies.
Configuration
There is no configuration. The package contains type definitions and gRPC stubs, not a runtime component.
Bootstrap
There is no bootstrap. To expose the monitoring service from your application, register the transport. See Monitoring gRPC Transport for the full wiring.
import (
"piko.sh/piko"
"piko.sh/piko/wdk/monitoring/monitoring_transport_grpc"
)
ssr := piko.New(
piko.WithMonitoring(
piko.WithMonitoringTransport(monitoring_transport_grpc.Transport()),
),
)
See also
The actual server-side wiring:
- Monitoring gRPC Transport, registers the gRPC server that implements this API.
The typical OTEL data source consumed via this API:
- OpenTelemetry SDK,
OtelServiceFactories()feeds spans and metrics into theTelemetryStoreexposed through the metrics service in this contract.
External:
piko.sh/piko/wdk/monitoring/monitoring_api/gen, generated Go documentation for the proto types and gRPC stubs.- gRPC for Go, generated client usage if you are building a custom consumer.