| name | instrumentation |
| description | Adds structured metric collection stubs to a service, exporting counters and histograms under a consistent naming scheme. Use when you want to instrument a service with metrics that follow a standard naming convention so they can be consumed by a shared dashboard. |
| x-spec-version | 1 |
instrumentation
Wires metric collection into a service by adding an exporter configuration
and a stub metrics registry. Substitute {{SERVICE_NAME}} and
{{METRICS_PORT}} before deploying.
When to use
Use when you are adding observability to a service and want a repeatable,
consistent metrics setup.
Instructions
- Review
PARAMETERS.md and fill in all required placeholders for your target service.
- Copy
assets/templates/metrics.config to your service's config directory.
- Register the metrics exporter at startup using the port in
{{METRICS_PORT}}.
- Verify the result: confirm the exporter responds on
http://localhost:{{METRICS_PORT}}/metrics.
Examples
Before:
# No metrics exporter configured.
After:
[metrics]
service = {{SERVICE_NAME}}
port = {{METRICS_PORT}}
format = prometheus
Edge cases
- Port conflict: If
{{METRICS_PORT}} is already bound, choose an alternative and update the placeholder.
- Service name collisions: Ensure
{{SERVICE_NAME}} is globally unique within your metrics namespace.
Parameters
All configurable placeholders are documented in PARAMETERS.md.