Command: Generate observability spec (via /o11y-engineer)
Goal: Define use-case-driven observability specifications that serve as contracts between development and operations teams.
An observability spec answers the question: “What telemetry should this service produce, and why?”
It is structured around use cases – questions that telemetry data should be able to answer. Each use case drives the definition of trace, log, and metric contracts.
metadata:
service: "registration-service"
version: "1.0"
created_by: "o11y-engineer"
use_cases:
- id: uc-001
question: "What is the p95 latency for user registration?"
signal: traces
slo_boundary: "p95 < 500ms"
priority: critical
trace_contracts:
# Expected spans and attributes
log_contracts:
# Structured log requirements
metric_contracts:
# Expected metrics and dimensions
correlation_contracts:
# How signals link together
attribute_ownership:
app_managed: [...] # Set in application code
collector_managed: [...] # Set by collector pipeline
redacted: [...] # PII cleaned by transform processor
Every trace, log, and metric contract traces back to a use case. If a piece of telemetry doesn’t answer a question, it shouldn’t exist.
Attributes are categorized into three ownership types:
| Type | Who Sets It | Examples |
|---|---|---|
app_managed |
Application code | http.route, user.type, custom business attributes |
collector_managed |
OTel Collector pipeline | k8s.pod.name, deployment.environment |
redacted |
Transform processor | user.email -> REDACTED |
This prevents developers from setting attributes that the collector will set (creating duplicates) and ensures PII is handled consistently.
Spans are categorized by boundary type:
The spec is saved to observability-specs/{service}-spec.yaml.
A companion epic with instrumentation stories is generated at _bmad-output/epics/. Each story includes:
spec_reference – Points to the relevant spec sectiontest_criteria – Testable assertions for validationAfter defining specs, proceed to Phase 3: Collector Configuration to build the collector pipeline that supports the spec requirements.