oh-my-agent-commandcode 0.0.0-stage → 20.38.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -2
- package/filter-test-output.sh +52 -0
- package/mods/oma.ts +347 -0
- package/package.json +30 -4
- package/skills/_shared/conditional/experiment-ledger.md +28 -0
- package/skills/_shared/conditional/exploration-loop.md +22 -0
- package/skills/_shared/conditional/quality-score.md +33 -0
- package/skills/_shared/core/anti-ai-prose.md +191 -0
- package/skills/_shared/core/api-contracts/README.md +28 -0
- package/skills/_shared/core/api-contracts/template.md +90 -0
- package/skills/_shared/core/clarification-protocol.md +23 -0
- package/skills/_shared/core/code-intelligence.md +46 -0
- package/skills/_shared/core/collaboration-policy.md +28 -0
- package/skills/_shared/core/common-checklist.md +28 -0
- package/skills/_shared/core/context-budget.md +22 -0
- package/skills/_shared/core/context-loading.md +34 -0
- package/skills/_shared/core/difficulty-guide.md +26 -0
- package/skills/_shared/core/execution-policy.md +31 -0
- package/skills/_shared/core/lessons-learned.md +33 -0
- package/skills/_shared/core/prompt-structure.md +18 -0
- package/skills/_shared/core/quality-principles.md +11 -0
- package/skills/_shared/core/session-metrics.md +35 -0
- package/skills/_shared/core/skill-routing.md +39 -0
- package/skills/_shared/core/test-approach.md +54 -0
- package/skills/_shared/core/vendor-detection.md +52 -0
- package/skills/_shared/runtime/memory-protocol.md +118 -0
- package/skills/_shared/runtime/result-contract.md +64 -0
- package/skills/_shared/ui-interaction-quality.md +133 -0
- package/skills/oma-academic-writing/SKILL.md +181 -0
- package/skills/oma-academic-writing/resources/abstract-guide.md +51 -0
- package/skills/oma-academic-writing/resources/academic-verb-tiers.md +42 -0
- package/skills/oma-academic-writing/resources/anti-ai-checklist.md +52 -0
- package/skills/oma-academic-writing/resources/hedging-guide.md +132 -0
- package/skills/oma-academic-writing/resources/sentence-structure-reference.md +151 -0
- package/skills/oma-architecture/SKILL.md +203 -0
- package/skills/oma-architecture/resources/api-evolution.md +41 -0
- package/skills/oma-architecture/resources/checklist.md +42 -0
- package/skills/oma-architecture/resources/execution-protocol.md +115 -0
- package/skills/oma-architecture/resources/methodology-selection.md +92 -0
- package/skills/oma-architecture/resources/migration-patterns.md +28 -0
- package/skills/oma-architecture/resources/output-templates.md +111 -0
- package/skills/oma-architecture/resources/stakeholder-synthesis.md +80 -0
- package/skills/oma-backend/SKILL.md +202 -0
- package/skills/oma-backend/resources/checklist.md +45 -0
- package/skills/oma-backend/resources/error-playbook.md +97 -0
- package/skills/oma-backend/resources/execution-protocol.md +39 -0
- package/skills/oma-backend/resources/orm-reference.md +61 -0
- package/skills/oma-backend/variants/node/api-template.ts +315 -0
- package/skills/oma-backend/variants/node/snippets.md +475 -0
- package/skills/oma-backend/variants/node/stack.yaml +21 -0
- package/skills/oma-backend/variants/node/tech-stack.md +33 -0
- package/skills/oma-backend/variants/python/api-template.py +378 -0
- package/skills/oma-backend/variants/python/snippets.md +199 -0
- package/skills/oma-backend/variants/python/stack.yaml +18 -0
- package/skills/oma-backend/variants/python/tech-stack.md +45 -0
- package/skills/oma-backend/variants/rust/api-template.rs +635 -0
- package/skills/oma-backend/variants/rust/snippets.md +471 -0
- package/skills/oma-backend/variants/rust/stack.yaml +20 -0
- package/skills/oma-backend/variants/rust/tech-stack.md +36 -0
- package/skills/oma-backend/variants/stack.schema.json +73 -0
- package/skills/oma-brainstorm/SKILL.md +166 -0
- package/skills/oma-brainstorm/resources/triz-lite.md +117 -0
- package/skills/oma-coordination/SKILL.md +171 -0
- package/skills/oma-db/SKILL.md +201 -0
- package/skills/oma-db/resources/anti-patterns.md +177 -0
- package/skills/oma-db/resources/checklist.md +67 -0
- package/skills/oma-db/resources/document-templates.md +107 -0
- package/skills/oma-db/resources/error-playbook.md +50 -0
- package/skills/oma-db/resources/examples.md +170 -0
- package/skills/oma-db/resources/execution-protocol.md +127 -0
- package/skills/oma-db/resources/iso-controls.md +98 -0
- package/skills/oma-db/resources/migration-playbook.md +93 -0
- package/skills/oma-db/resources/query-tuning.md +57 -0
- package/skills/oma-db/resources/vector-db.md +159 -0
- package/skills/oma-debug/SKILL.md +146 -0
- package/skills/oma-debug/resources/bug-report-template.md +327 -0
- package/skills/oma-debug/resources/checklist.md +31 -0
- package/skills/oma-debug/resources/common-patterns.md +734 -0
- package/skills/oma-debug/resources/debugging-checklist.md +364 -0
- package/skills/oma-debug/resources/error-playbook.md +94 -0
- package/skills/oma-debug/resources/execution-protocol.md +40 -0
- package/skills/oma-design/SKILL.md +135 -0
- package/skills/oma-design/resources/asset-strategy.md +34 -0
- package/skills/oma-design/resources/checklist.md +63 -0
- package/skills/oma-design/resources/data-grid.md +48 -0
- package/skills/oma-design/resources/design-md-spec.md +107 -0
- package/skills/oma-design/resources/design-tokens.md +53 -0
- package/skills/oma-design/resources/error-playbook.md +18 -0
- package/skills/oma-design/resources/execution-protocol.md +95 -0
- package/skills/oma-design/resources/external-design-skills.md +130 -0
- package/skills/oma-design/resources/getdesign-fetcher.md +104 -0
- package/skills/oma-design/resources/product-interface-review.md +59 -0
- package/skills/oma-design/resources/redesign-protocol.md +52 -0
- package/skills/oma-design/resources/stitch-integration.md +244 -0
- package/skills/oma-dev-workflow/SKILL.md +375 -0
- package/skills/oma-dev-workflow/resources/affected-checks.py +58 -0
- package/skills/oma-dev-workflow/resources/api-workflows.md +58 -0
- package/skills/oma-dev-workflow/resources/database-patterns.md +107 -0
- package/skills/oma-dev-workflow/resources/i18n-patterns.md +63 -0
- package/skills/oma-dev-workflow/resources/release-coordination.md +240 -0
- package/skills/oma-dev-workflow/resources/tooling-profiles.md +217 -0
- package/skills/oma-dev-workflow/resources/troubleshooting.md +78 -0
- package/skills/oma-dev-workflow/resources/validation-pipeline.md +246 -0
- package/skills/oma-docs/SKILL.md +77 -0
- package/skills/oma-docs/resources/commands.md +76 -0
- package/skills/oma-explanation/SKILL.md +212 -0
- package/skills/oma-explanation/resources/document-structure.md +115 -0
- package/skills/oma-explanation/resources/draft-format.md +199 -0
- package/skills/oma-explanation/resources/html-contract.md +102 -0
- package/skills/oma-frontend/SKILL.md +227 -0
- package/skills/oma-frontend/resources/angular-rules.md +110 -0
- package/skills/oma-frontend/resources/checklist.md +76 -0
- package/skills/oma-frontend/resources/error-playbook.md +125 -0
- package/skills/oma-frontend/resources/execution-protocol.md +46 -0
- package/skills/oma-frontend/resources/snippets.md +354 -0
- package/skills/oma-frontend/resources/specialized-visual-implementation.md +193 -0
- package/skills/oma-frontend/resources/tailwind-rules.md +83 -0
- package/skills/oma-frontend/resources/tech-stack.md +156 -0
- package/skills/oma-hwp/SKILL.md +166 -0
- package/skills/oma-hwp/config/hwp-config.yaml +35 -0
- package/skills/oma-hwp/resources/balanced-tables.ts +39 -0
- package/skills/oma-hwp/resources/execution-protocol.md +145 -0
- package/skills/oma-hwp/resources/flatten-tables.ts +101 -0
- package/skills/oma-hwp/resources/package.json +13 -0
- package/skills/oma-hwp/resources/troubleshooting.md +70 -0
- package/skills/oma-hwp/resources/tsconfig.json +10 -0
- package/skills/oma-hwp/resources/turndown-plugin-gfm.d.ts +9 -0
- package/skills/oma-image/SKILL.md +142 -0
- package/skills/oma-image/config/image-config.yaml +70 -0
- package/skills/oma-image/resources/checklist.md +18 -0
- package/skills/oma-image/resources/execution-protocol.md +117 -0
- package/skills/oma-image/resources/invocation.md +105 -0
- package/skills/oma-image/resources/prompt-tips.md +71 -0
- package/skills/oma-image/resources/vendor-matrix.md +90 -0
- package/skills/oma-market/SKILL.md +142 -0
- package/skills/oma-market/resources/checklist.md +12 -0
- package/skills/oma-market/resources/error-playbook.md +12 -0
- package/skills/oma-market/resources/execution-protocol.md +60 -0
- package/skills/oma-market/resources/frameworks/pestel.md +101 -0
- package/skills/oma-market/resources/frameworks/porters-5f.md +90 -0
- package/skills/oma-market/resources/frameworks/swot.md +61 -0
- package/skills/oma-market/resources/intent-rules.md +35 -0
- package/skills/oma-market/resources/output-laws.md +53 -0
- package/skills/oma-mobile/SKILL.md +168 -0
- package/skills/oma-mobile/resources/checklist.md +77 -0
- package/skills/oma-mobile/resources/error-playbook.md +198 -0
- package/skills/oma-mobile/resources/execution-protocol.md +47 -0
- package/skills/oma-mobile/resources/screen-template.dart +331 -0
- package/skills/oma-mobile/resources/screen-template.swift +239 -0
- package/skills/oma-mobile/resources/screen-template.tsx +179 -0
- package/skills/oma-mobile/resources/tech-stack.md +69 -0
- package/skills/oma-mobile/variants/README.md +45 -0
- package/skills/oma-mobile/variants/flutter/api-template.dart +461 -0
- package/skills/oma-mobile/variants/flutter/snippets.md +1353 -0
- package/skills/oma-mobile/variants/flutter/stack.yaml +21 -0
- package/skills/oma-mobile/variants/flutter/tech-stack.md +201 -0
- package/skills/oma-mobile/variants/kotlin-android/api-template.kt +182 -0
- package/skills/oma-mobile/variants/kotlin-android/snippets.md +871 -0
- package/skills/oma-mobile/variants/kotlin-android/stack.yaml +32 -0
- package/skills/oma-mobile/variants/kotlin-android/tech-stack.md +159 -0
- package/skills/oma-mobile/variants/react-native/api-template.ts +531 -0
- package/skills/oma-mobile/variants/react-native/snippets.md +1014 -0
- package/skills/oma-mobile/variants/react-native/stack.yaml +22 -0
- package/skills/oma-mobile/variants/react-native/tech-stack.md +192 -0
- package/skills/oma-mobile/variants/stack.schema.json +68 -0
- package/skills/oma-mobile/variants/swift-ios/api-template.swift +165 -0
- package/skills/oma-mobile/variants/swift-ios/snippets.md +1028 -0
- package/skills/oma-mobile/variants/swift-ios/stack.yaml +25 -0
- package/skills/oma-mobile/variants/swift-ios/tech-stack.md +174 -0
- package/skills/oma-observability/SKILL.md +225 -0
- package/skills/oma-observability/resources/anti-patterns.md +555 -0
- package/skills/oma-observability/resources/boundaries/cross-application.md +348 -0
- package/skills/oma-observability/resources/boundaries/multi-tenant.md +290 -0
- package/skills/oma-observability/resources/boundaries/release.md +372 -0
- package/skills/oma-observability/resources/boundaries/slo.md +225 -0
- package/skills/oma-observability/resources/checklist.md +123 -0
- package/skills/oma-observability/resources/examples.md +448 -0
- package/skills/oma-observability/resources/execution-protocol.md +166 -0
- package/skills/oma-observability/resources/incident-forensics.md +348 -0
- package/skills/oma-observability/resources/intent-rules.md +307 -0
- package/skills/oma-observability/resources/layers/L3-network.md +281 -0
- package/skills/oma-observability/resources/layers/L4-transport.md +299 -0
- package/skills/oma-observability/resources/layers/L7-application/crash-analytics.md +359 -0
- package/skills/oma-observability/resources/layers/L7-application/mobile-rum.md +278 -0
- package/skills/oma-observability/resources/layers/L7-application/waf.md +246 -0
- package/skills/oma-observability/resources/layers/L7-application/web-rum.md +350 -0
- package/skills/oma-observability/resources/layers/mesh.md +368 -0
- package/skills/oma-observability/resources/matrix.md +177 -0
- package/skills/oma-observability/resources/meta-observability.md +605 -0
- package/skills/oma-observability/resources/observability-as-code.md +666 -0
- package/skills/oma-observability/resources/signals/audit.md +310 -0
- package/skills/oma-observability/resources/signals/cost.md +303 -0
- package/skills/oma-observability/resources/signals/logs.md +263 -0
- package/skills/oma-observability/resources/signals/metrics.md +478 -0
- package/skills/oma-observability/resources/signals/privacy.md +351 -0
- package/skills/oma-observability/resources/signals/profiles.md +245 -0
- package/skills/oma-observability/resources/signals/traces.md +360 -0
- package/skills/oma-observability/resources/standards.md +214 -0
- package/skills/oma-observability/resources/transport/collector-topology.md +308 -0
- package/skills/oma-observability/resources/transport/otlp-grpc-vs-http.md +256 -0
- package/skills/oma-observability/resources/transport/sampling-recipes.md +297 -0
- package/skills/oma-observability/resources/transport/udp-statsd-mtu.md +167 -0
- package/skills/oma-observability/resources/vendor-categories.md +352 -0
- package/skills/oma-orchestration/SKILL.md +302 -0
- package/skills/oma-orchestration/config/cli-config.yaml +92 -0
- package/skills/oma-orchestration/resources/memory-schema.md +232 -0
- package/skills/oma-orchestration/resources/subagent-prompt-template.md +30 -0
- package/skills/oma-orchestration/scripts/parallel-run.sh +6 -0
- package/skills/oma-orchestration/scripts/spawn-agent.sh +5 -0
- package/skills/oma-orchestration/scripts/verify.sh +20 -0
- package/skills/oma-orchestration/templates/backend-task.md +19 -0
- package/skills/oma-orchestration/templates/debug-task.md +16 -0
- package/skills/oma-orchestration/templates/frontend-task.md +18 -0
- package/skills/oma-orchestration/templates/mobile-task.md +18 -0
- package/skills/oma-orchestration/templates/qa-task.md +16 -0
- package/skills/oma-orchestration/templates/tasks-example.yaml +15 -0
- package/skills/oma-pdf/SKILL.md +162 -0
- package/skills/oma-pdf/config/pdf-config.yaml +27 -0
- package/skills/oma-pdf/resources/execution-protocol.md +127 -0
- package/skills/oma-pm/SKILL.md +157 -0
- package/skills/oma-pm/resources/error-playbook.md +75 -0
- package/skills/oma-pm/resources/examples.md +439 -0
- package/skills/oma-pm/resources/execution-protocol.md +62 -0
- package/skills/oma-pm/resources/iso-planning.md +110 -0
- package/skills/oma-pm/resources/plan-phase-protocol.md +66 -0
- package/skills/oma-pm/resources/task-template.json +86 -0
- package/skills/oma-qa/SKILL.md +141 -0
- package/skills/oma-qa/resources/checklist.md +339 -0
- package/skills/oma-qa/resources/error-playbook.md +98 -0
- package/skills/oma-qa/resources/execution-protocol.md +169 -0
- package/skills/oma-qa/resources/iso-quality.md +82 -0
- package/skills/oma-qa/resources/verify-ship-protocol.md +116 -0
- package/skills/oma-recap/SKILL.md +245 -0
- package/skills/oma-recap/resources/output-formats.md +83 -0
- package/skills/oma-refactor/SKILL.md +184 -0
- package/skills/oma-refactor/resources/definition.md +108 -0
- package/skills/oma-refactor/resources/governance.md +33 -0
- package/skills/oma-refactor/resources/hotspots.py +44 -0
- package/skills/oma-refactor/resources/measurement.md +93 -0
- package/skills/oma-scholar/SKILL.md +276 -0
- package/skills/oma-scholar/config/scholar-config.yaml +79 -0
- package/skills/oma-scholar/resources/api-endpoints.md +174 -0
- package/skills/oma-scholar/resources/checklist.md +92 -0
- package/skills/oma-scholar/resources/execution-protocol.md +224 -0
- package/skills/oma-scholar/resources/fallback-providers.md +143 -0
- package/skills/oma-scholar/resources/setup-openalex.md +85 -0
- package/skills/oma-scholar/resources/sidecar-spec.md +341 -0
- package/skills/oma-scholar/resources/upstream-spec-cache.md +972 -0
- package/skills/oma-scm/SKILL.md +103 -0
- package/skills/oma-scm/resources/cm-operations.md +56 -0
- package/skills/oma-scm/resources/codeowners-playbook.md +45 -0
- package/skills/oma-scm/resources/conventional-commits.md +108 -0
- package/skills/oma-scm/resources/merge-risk.md +76 -0
- package/skills/oma-scm/resources/onboarding-risk-signals.md +71 -0
- package/skills/oma-search/SKILL.md +125 -0
- package/skills/oma-search/resources/checklist.md +36 -0
- package/skills/oma-search/resources/error-playbook.md +66 -0
- package/skills/oma-search/resources/examples.md +80 -0
- package/skills/oma-search/resources/execution-protocol.md +86 -0
- package/skills/oma-search/resources/intent-rules.md +47 -0
- package/skills/oma-search/resources/trust-registry.md +53 -0
- package/skills/oma-security/SKILL.md +172 -0
- package/skills/oma-security/resources/artex.md +108 -0
- package/skills/oma-security/resources/ci.md +134 -0
- package/skills/oma-security/resources/cisco-source.md +108 -0
- package/skills/oma-security/resources/deepsec-config.md +45 -0
- package/skills/oma-security/resources/deepsec-matchers.md +35 -0
- package/skills/oma-security/resources/deepsec-scanning.md +45 -0
- package/skills/oma-security/resources/deepsec-setup.md +41 -0
- package/skills/oma-security/resources/findings-contract.md +408 -0
- package/skills/oma-security/resources/mcp-scanning.md +122 -0
- package/skills/oma-security/resources/skill-scanning.md +106 -0
- package/skills/oma-security/resources/validation.md +71 -0
- package/skills/oma-skill-creation/SKILL.md +84 -0
- package/skills/oma-skill-creation/resources/prompt-evaluation.md +36 -0
- package/skills/oma-skill-creation/resources/ssl-lite-template.md +108 -0
- package/skills/oma-skill-creation/resources/validation-checklist.md +101 -0
- package/skills/oma-slide/SKILL.md +277 -0
- package/skills/oma-slide/resources/animation-patterns.md +245 -0
- package/skills/oma-slide/resources/assets/deck-stage.js +514 -0
- package/skills/oma-slide/resources/assets/viewport-base.css +257 -0
- package/skills/oma-slide/resources/canva-integration.md +203 -0
- package/skills/oma-slide/resources/checklist.md +46 -0
- package/skills/oma-slide/resources/design-doctrine.md +260 -0
- package/skills/oma-slide/resources/fixed-stage.md +232 -0
- package/skills/oma-slide/resources/generation-protocol.md +393 -0
- package/skills/oma-slide/resources/native-pptx.md +84 -0
- package/skills/oma-slide/resources/selection-index.json +461 -0
- package/skills/oma-slide/resources/style-presets.LICENSE +10 -0
- package/skills/oma-slide/resources/style-presets.md +520 -0
- package/skills/oma-tf-infra/SKILL.md +201 -0
- package/skills/oma-tf-infra/resources/checklist.md +53 -0
- package/skills/oma-tf-infra/resources/cost-optimization.md +574 -0
- package/skills/oma-tf-infra/resources/error-playbook.md +68 -0
- package/skills/oma-tf-infra/resources/examples.md +38 -0
- package/skills/oma-tf-infra/resources/execution-protocol.md +129 -0
- package/skills/oma-tf-infra/resources/iso-42001-infra.md +229 -0
- package/skills/oma-tf-infra/resources/multi-cloud-examples.md +241 -0
- package/skills/oma-tf-infra/resources/policy-testing-examples.md +332 -0
- package/skills/oma-translation/SKILL.md +229 -0
- package/skills/oma-translation/resources/anti-ai-patterns.md +104 -0
- package/skills/oma-translation/resources/lang/_template.md +73 -0
- package/skills/oma-translation/resources/lang/en.md +123 -0
- package/skills/oma-translation/resources/lang/ja.md +274 -0
- package/skills/oma-translation/resources/lang/ko.md +228 -0
- package/skills/oma-translation/resources/lang/zh.md +285 -0
- package/skills/oma-translation/resources/style-skills.md +104 -0
- package/skills/oma-translation/resources/translation-rubric.md +126 -0
- package/skills/oma-video/SKILL.md +229 -0
- package/skills/oma-video/config/video-config.yaml +60 -0
- package/skills/oma-video/resources/checklist.md +26 -0
- package/skills/oma-video/resources/execution-protocol.md +122 -0
- package/skills/oma-video/resources/existing-media.md +185 -0
- package/skills/oma-video/resources/hyperframes-authoring/README.md +44 -0
- package/skills/oma-video/resources/hyperframes-authoring/demo.md +31 -0
- package/skills/oma-video/resources/hyperframes-authoring/explainer.md +10 -0
- package/skills/oma-video/resources/hyperframes-authoring/shorts.md +10 -0
- package/skills/oma-video/resources/motion-principles.md +81 -0
- package/skills/oma-video/resources/mpt/driver.py +301 -0
- package/skills/oma-video/resources/prompt-tips.md +75 -0
- package/skills/oma-video/resources/script-schema.md +81 -0
- package/skills/oma-video/resources/sound-design.md +127 -0
- package/skills/oma-video/resources/strudel/package.json +11 -0
- package/skills/oma-video/resources/strudel/page.html +87 -0
- package/skills/oma-video/resources/strudel/render.mjs +295 -0
- package/skills/oma-video/resources/vendor-matrix.md +124 -0
- package/skills/oma-voice/SKILL.md +249 -0
- package/skills/oma-voice/config/voice-config.yaml +30 -0
- package/skills/oma-voice/resources/audio-processing.md +119 -0
- package/skills/oma-voice/resources/checklist.md +47 -0
- package/skills/oma-voice/resources/execution-protocol.md +215 -0
- package/skills/oma-voice/resources/prompt-tips.md +43 -0
- package/skills/oma-voice/resources/voice-matrix.md +51 -0
- package/skills/oma-voice/resources/voicestudio.md +87 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
---
|
|
2
|
+
cross_ref: "meta-observability.md §Section F for pipeline alerts; boundaries/slo.md §5,7 for SLO math"
|
|
3
|
+
notes:
|
|
4
|
+
- "Versions: Grafonnet 11.x; OTel Operator v1beta1; Terraform Grafana provider ~> 3.0"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Observability-as-Code
|
|
8
|
+
|
|
9
|
+
## 1. Why Observability-as-Code
|
|
10
|
+
|
|
11
|
+
UI-edited dashboards and alerts accumulate silent debt:
|
|
12
|
+
|
|
13
|
+
- **No DR / no rollback.** A dashboard overwritten in the Grafana UI cannot be reverted without a backup.
|
|
14
|
+
- **No peer review.** Alert thresholds edited live bypass the same change-management gates required for code.
|
|
15
|
+
- **Scale problem.** 100+ dashboards across N environments managed by hand drift within weeks. Each environment develops its own undocumented fork.
|
|
16
|
+
- **Compliance.** SOC 2 change-management controls require an audit trail for every change to detection and response configuration. Git history provides that trail; Grafana's internal change log does not. Cross-ref `signals/audit.md` for evidence-specific integrity and retention controls.
|
|
17
|
+
|
|
18
|
+
The non-negotiable principle: version every observability artifact; dashboards, alert rules, SLO definitions, collector config; in git, applied via CI/CD.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. Dashboards-as-Code
|
|
23
|
+
|
|
24
|
+
### 2.1 Grafana Jsonnet / Grafonnet
|
|
25
|
+
|
|
26
|
+
Source: <https://grafana.github.io/grafonnet/> (Grafonnet 11.x, replacing legacy grafonnet-lib)
|
|
27
|
+
|
|
28
|
+
Grafonnet is a Jsonnet library that generates Grafana's JSON dashboard model declaratively. Dashboards are composed programmatically; panels, data sources, variables, and annotations are all typed functions.
|
|
29
|
+
|
|
30
|
+
```jsonnet
|
|
31
|
+
// dashboards/collector-health.jsonnet
|
|
32
|
+
local grafonnet = import 'grafonnet/main.libsonnet';
|
|
33
|
+
local dashboard = grafonnet.dashboard;
|
|
34
|
+
local panel = grafonnet.panel;
|
|
35
|
+
local prometheus = grafonnet.query.prometheus;
|
|
36
|
+
|
|
37
|
+
dashboard.new('OTel Collector Health')
|
|
38
|
+
+ dashboard.withUid('otelcol-health-v1')
|
|
39
|
+
+ dashboard.withRefresh('30s')
|
|
40
|
+
+ dashboard.withPanels([
|
|
41
|
+
panel.timeSeries.new('Synthetic Trace Delivery Ratio')
|
|
42
|
+
+ panel.timeSeries.withTargets([
|
|
43
|
+
prometheus.new(
|
|
44
|
+
'$datasource',
|
|
45
|
+
|||
|
|
46
|
+
sum(rate(telemetry_probe_completed_total{result="delivered"}[5m]))
|
|
47
|
+
/ (sum(rate(telemetry_probe_completed_total[5m])) > 0)
|
|
48
|
+
|||
|
|
49
|
+
),
|
|
50
|
+
]),
|
|
51
|
+
])
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Render to JSON and apply:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
jsonnet -J vendor dashboards/collector-health.jsonnet > dist/collector-health.json
|
|
58
|
+
# CI step: grafana-cli dashboards import dist/collector-health.json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Lint Jsonnet in CI:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
jsonnetfmt --test dashboards/*.jsonnet
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2.2 Perses (CNCF Sandbox)
|
|
68
|
+
|
|
69
|
+
Source: <https://perses.dev>; CNCF Sandbox (accepted 2024-08-29; <https://www.cncf.io/projects/perses/>). YAML-first, vendor-neutral dashboard definition targeting a future CNCF standard for dashboards-as-code. Stricter schema than Grafana JSON; import from Grafana JSON is under development.
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
# dashboards/collector-health.yaml (Perses)
|
|
73
|
+
kind: Dashboard
|
|
74
|
+
metadata:
|
|
75
|
+
name: otelcol-health
|
|
76
|
+
project: observability
|
|
77
|
+
spec:
|
|
78
|
+
duration: 30m
|
|
79
|
+
panels:
|
|
80
|
+
delivery_ratio:
|
|
81
|
+
kind: TimeSeriesChart
|
|
82
|
+
spec:
|
|
83
|
+
queries:
|
|
84
|
+
- kind: TimeSeriesQuery
|
|
85
|
+
spec:
|
|
86
|
+
plugin:
|
|
87
|
+
kind: PrometheusTimeSeriesQuery
|
|
88
|
+
spec:
|
|
89
|
+
query: >
|
|
90
|
+
sum(rate(telemetry_probe_completed_total{result="delivered"}[5m]))
|
|
91
|
+
/ (sum(rate(telemetry_probe_completed_total[5m])) > 0)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The delivery panel requires the custom completed-probe metric from `meta-observability.md §A6`; default Collector counters are not an end-to-end delivery ratio.
|
|
95
|
+
|
|
96
|
+
Use Perses when vendor-neutral YAML is a hard requirement (e.g., multi-backend environments). See Section 12 for current maturity notes.
|
|
97
|
+
|
|
98
|
+
### 2.3 Datadog Terraform Provider
|
|
99
|
+
|
|
100
|
+
```hcl
|
|
101
|
+
resource "datadog_dashboard_json" "collector_health" {
|
|
102
|
+
dashboard = file("${path.module}/dashboards/collector-health.json")
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 2.4 Honeycomb Terraform Provider
|
|
107
|
+
|
|
108
|
+
```hcl
|
|
109
|
+
resource "honeycombio_board" "slo_burn_rate" {
|
|
110
|
+
name = "SLO Burn Rate"
|
|
111
|
+
description = "Multi-window burn-rate overview"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 2.5 GitOps Workflow for Dashboards
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
git PR (dashboard Jsonnet / YAML)
|
|
119
|
+
→ CI: jsonnet lint + render to JSON
|
|
120
|
+
→ peer review
|
|
121
|
+
→ merge to main
|
|
122
|
+
→ CD (Argo CD / Flux) applies to Grafana via API or ConfigMap
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 3. Alerts-as-Code
|
|
128
|
+
|
|
129
|
+
### 3.1 PrometheusRule CRD (Prometheus Operator)
|
|
130
|
+
|
|
131
|
+
The `PrometheusRule` custom resource (group `monitoring.coreos.com/v1`) is the standard Kubernetes-native format for alert rules when running Prometheus Operator or kube-prometheus-stack.
|
|
132
|
+
|
|
133
|
+
Full burn-rate example in Section 6.
|
|
134
|
+
|
|
135
|
+
### 3.2 Alertmanager YAML
|
|
136
|
+
|
|
137
|
+
Notification routing is versioned alongside alert rules:
|
|
138
|
+
|
|
139
|
+
```yaml
|
|
140
|
+
# alertmanager-config.yaml
|
|
141
|
+
route:
|
|
142
|
+
group_by: [alertname, cluster, service]
|
|
143
|
+
group_wait: 30s
|
|
144
|
+
group_interval: 5m
|
|
145
|
+
repeat_interval: 4h
|
|
146
|
+
receiver: slack-critical
|
|
147
|
+
routes:
|
|
148
|
+
- matchers:
|
|
149
|
+
- severity="warning"
|
|
150
|
+
receiver: slack-warning
|
|
151
|
+
|
|
152
|
+
receivers:
|
|
153
|
+
- name: slack-critical
|
|
154
|
+
slack_configs:
|
|
155
|
+
- api_url: "${SLACK_WEBHOOK_URL}" # injected from Secret; never hardcoded
|
|
156
|
+
channel: "#incidents"
|
|
157
|
+
title: "{{ .GroupLabels.alertname }}"
|
|
158
|
+
text: "{{ range .Alerts }}{{ .Annotations.description }}{{ end }}"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 3.3 Terraform Grafana Provider (Grafana Cloud Alerts)
|
|
162
|
+
|
|
163
|
+
Source: <https://github.com/grafana/terraform-provider-grafana>
|
|
164
|
+
|
|
165
|
+
```hcl
|
|
166
|
+
resource "grafana_rule_group" "slo_burn_rate" {
|
|
167
|
+
name = "slo-burn-rate"
|
|
168
|
+
folder_uid = grafana_folder.observability.uid
|
|
169
|
+
interval_seconds = 60
|
|
170
|
+
|
|
171
|
+
rule {
|
|
172
|
+
name = "SloBurnRateFast"
|
|
173
|
+
condition = "A"
|
|
174
|
+
|
|
175
|
+
data {
|
|
176
|
+
ref_id = "A"
|
|
177
|
+
datasource_uid = var.prometheus_datasource_uid
|
|
178
|
+
model = jsonencode({
|
|
179
|
+
expr = "(sum(rate(http_requests_total{status=~\"5..\"}[1h])) / sum(rate(http_requests_total[1h]))) / (1 - 0.999) > 14.4"
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
annotations = { summary = "Fast burn: SLO budget burning at 14.4x rate" }
|
|
184
|
+
labels = { severity = "critical" }
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 3.4 GitHub Actions Alert Pipeline
|
|
190
|
+
|
|
191
|
+
```yaml
|
|
192
|
+
# .github/workflows/alerts.yaml
|
|
193
|
+
on:
|
|
194
|
+
push:
|
|
195
|
+
paths: ["alerts/**"]
|
|
196
|
+
|
|
197
|
+
jobs:
|
|
198
|
+
validate:
|
|
199
|
+
runs-on: ubuntu-latest
|
|
200
|
+
steps:
|
|
201
|
+
- uses: actions/checkout@v4
|
|
202
|
+
# CI runner must already provide pinned promtool, amtool, and mikefarah/yq v4.
|
|
203
|
+
- name: Extract and check Prometheus rules
|
|
204
|
+
run: |
|
|
205
|
+
mkdir -p rendered-rules
|
|
206
|
+
for rule in alerts/*.yaml; do
|
|
207
|
+
rendered="rendered-rules/$(basename "$rule")"
|
|
208
|
+
yq eval '.spec' "$rule" > "$rendered"
|
|
209
|
+
promtool check rules "$rendered"
|
|
210
|
+
done
|
|
211
|
+
- name: Lint Alertmanager config
|
|
212
|
+
run: amtool check-config alertmanager-config.yaml
|
|
213
|
+
apply:
|
|
214
|
+
needs: validate
|
|
215
|
+
if: github.ref == 'refs/heads/main'
|
|
216
|
+
runs-on: ubuntu-latest
|
|
217
|
+
steps:
|
|
218
|
+
- uses: actions/checkout@v4
|
|
219
|
+
- name: Apply via kubectl
|
|
220
|
+
run: kubectl apply -f alerts/
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 4. SLO-as-Code
|
|
226
|
+
|
|
227
|
+
### 4.1 OpenSLO YAML
|
|
228
|
+
|
|
229
|
+
Source: <https://openslo.com>; community-driven (not CNCF). Use a consumer or adapter explicitly supporting OpenSLO v1. Cross-ref `boundaries/slo.md §5` for the full OpenSLO spec example.
|
|
230
|
+
|
|
231
|
+
```yaml
|
|
232
|
+
apiVersion: openslo/v1
|
|
233
|
+
kind: SLO
|
|
234
|
+
metadata:
|
|
235
|
+
name: checkout-availability
|
|
236
|
+
spec:
|
|
237
|
+
service: checkout
|
|
238
|
+
budgetingMethod: Occurrences
|
|
239
|
+
timeWindow:
|
|
240
|
+
- duration: 28d
|
|
241
|
+
isRolling: true
|
|
242
|
+
objectives:
|
|
243
|
+
- target: 0.999
|
|
244
|
+
indicator:
|
|
245
|
+
metadata:
|
|
246
|
+
name: checkout-success-ratio
|
|
247
|
+
spec:
|
|
248
|
+
ratioMetric:
|
|
249
|
+
counter: false # queries return window counts, not monotonic counters
|
|
250
|
+
good:
|
|
251
|
+
metricSource:
|
|
252
|
+
type: Prometheus
|
|
253
|
+
spec:
|
|
254
|
+
query: sum(increase(http_requests_total{service="checkout",status=~"2..|3.."}[28d]))
|
|
255
|
+
total:
|
|
256
|
+
metricSource:
|
|
257
|
+
type: Prometheus
|
|
258
|
+
spec:
|
|
259
|
+
query: sum(increase(http_requests_total{service="checkout"}[28d]))
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
The v1 structure follows <https://openslo.com/specification/>.
|
|
263
|
+
`metricSource.spec` is implementation-defined: verify the chosen consumer's
|
|
264
|
+
Prometheus adapter, window evaluation, and counter semantics. This example
|
|
265
|
+
does not imply Sloth or Pyrra directly accepts OpenSLO; native definitions
|
|
266
|
+
require a verified adapter/conversion if OpenSLO is the input.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
### 4.2 Sloth: YAML to PrometheusRule
|
|
271
|
+
|
|
272
|
+
Source: <https://sloth.dev>; generates multi-window burn-rate `PrometheusRule` CRDs from a concise YAML definition.
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
# sloth/checkout-slo.yaml
|
|
276
|
+
version: prometheus/v1
|
|
277
|
+
service: checkout
|
|
278
|
+
slos:
|
|
279
|
+
- name: availability
|
|
280
|
+
objective: 99.9
|
|
281
|
+
description: "Checkout HTTP availability"
|
|
282
|
+
sli:
|
|
283
|
+
events:
|
|
284
|
+
error_query: sum(rate(http_requests_total{service="checkout",status=~"5.."}[{{.window}}]))
|
|
285
|
+
total_query: sum(rate(http_requests_total{service="checkout"}[{{.window}}]))
|
|
286
|
+
alerting:
|
|
287
|
+
page_alert:
|
|
288
|
+
labels: { severity: critical }
|
|
289
|
+
ticket_alert:
|
|
290
|
+
labels: { severity: warning }
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
sloth generate -i sloth/checkout-slo.yaml | kubectl apply -f -
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### 4.3 Pyrra: Kubernetes CRD Operator
|
|
298
|
+
|
|
299
|
+
Source: <https://github.com/pyrra-dev/pyrra>; Kubernetes operator that reconciles `ServiceLevelObjective` CRDs directly into `PrometheusRule` + recording rules.
|
|
300
|
+
|
|
301
|
+
```yaml
|
|
302
|
+
apiVersion: pyrra.dev/v1alpha1
|
|
303
|
+
kind: ServiceLevelObjective
|
|
304
|
+
metadata:
|
|
305
|
+
name: checkout-availability
|
|
306
|
+
namespace: monitoring
|
|
307
|
+
spec:
|
|
308
|
+
target: "99.9"
|
|
309
|
+
window: 28d
|
|
310
|
+
indicator:
|
|
311
|
+
ratio:
|
|
312
|
+
errors:
|
|
313
|
+
metric: http_requests_total{service="checkout",status=~"5.."}
|
|
314
|
+
total:
|
|
315
|
+
metric: http_requests_total{service="checkout"}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Pyrra reconciles this into recording rules and PrometheusRule alerts automatically; no separate generation step.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 5. OTel Collector-as-Code
|
|
323
|
+
|
|
324
|
+
### 5.1 OTel Operator: OpenTelemetryCollector CRD
|
|
325
|
+
|
|
326
|
+
Source: <https://github.com/open-telemetry/opentelemetry-operator>
|
|
327
|
+
|
|
328
|
+
The `OpenTelemetryCollector` CRD (`v1beta1`, beta) is the Kubernetes-native way to manage collector config as code. Four `spec.mode` values map to the four deployment strategies; cross-ref `transport/collector-topology.md §1`:
|
|
329
|
+
|
|
330
|
+
```yaml
|
|
331
|
+
apiVersion: opentelemetry.io/v1beta1
|
|
332
|
+
kind: OpenTelemetryCollector
|
|
333
|
+
metadata:
|
|
334
|
+
name: otelcol-daemonset
|
|
335
|
+
namespace: observability
|
|
336
|
+
spec:
|
|
337
|
+
mode: daemonset # deployment | daemonset | statefulset | sidecar
|
|
338
|
+
image: otel/opentelemetry-collector-contrib:0.122.1 # pin to current contrib release; verify tag exists via docker pull before apply
|
|
339
|
+
config:
|
|
340
|
+
receivers:
|
|
341
|
+
otlp:
|
|
342
|
+
protocols:
|
|
343
|
+
grpc:
|
|
344
|
+
endpoint: 0.0.0.0:4317
|
|
345
|
+
hostmetrics:
|
|
346
|
+
collection_interval: 30s
|
|
347
|
+
scrapers:
|
|
348
|
+
cpu: {}
|
|
349
|
+
memory: {}
|
|
350
|
+
processors:
|
|
351
|
+
memory_limiter:
|
|
352
|
+
check_interval: 1s
|
|
353
|
+
limit_percentage: 75
|
|
354
|
+
spike_limit_percentage: 20
|
|
355
|
+
batch: {}
|
|
356
|
+
exporters:
|
|
357
|
+
otlp:
|
|
358
|
+
endpoint: otelcol-gateway:4317
|
|
359
|
+
tls:
|
|
360
|
+
insecure: false
|
|
361
|
+
service:
|
|
362
|
+
pipelines:
|
|
363
|
+
traces:
|
|
364
|
+
receivers: [otlp]
|
|
365
|
+
processors: [memory_limiter, batch]
|
|
366
|
+
exporters: [otlp]
|
|
367
|
+
metrics:
|
|
368
|
+
receivers: [otlp, hostmetrics]
|
|
369
|
+
processors: [memory_limiter, batch]
|
|
370
|
+
exporters: [otlp]
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
The `Instrumentation` CR enables auto-injection into application pods. Cross-ref `layers/mesh.md §OTel Operator Instrumentation CR`.
|
|
374
|
+
|
|
375
|
+
### 5.2 Terraform: Helm Release or kubernetes_manifest
|
|
376
|
+
|
|
377
|
+
```hcl
|
|
378
|
+
resource "helm_release" "otel_operator" {
|
|
379
|
+
name = "opentelemetry-operator"
|
|
380
|
+
repository = "https://open-telemetry.github.io/opentelemetry-helm-charts"
|
|
381
|
+
chart = "opentelemetry-operator"
|
|
382
|
+
namespace = "observability"
|
|
383
|
+
version = "0.78.0" # pin to current stable; verify via `helm search repo opentelemetry/opentelemetry-operator --versions`
|
|
384
|
+
|
|
385
|
+
set {
|
|
386
|
+
name = "manager.collectorImage.repository"
|
|
387
|
+
value = "otel/opentelemetry-collector-contrib"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
resource "kubernetes_manifest" "otelcol_daemonset" {
|
|
392
|
+
manifest = yamldecode(file("${path.module}/manifests/otelcol-daemonset.yaml"))
|
|
393
|
+
depends_on = [helm_release.otel_operator]
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### 5.3 CI Validation for Collector Config
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
# otelcol validate — verifies config syntax and component availability
|
|
401
|
+
otelcol validate --config otelcol-config.yaml
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Add to CI before any collector config change merges.
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## 6. Burn-Rate Multi-Window Alert (Concrete PromQL)
|
|
409
|
+
|
|
410
|
+
Multi-window burn-rate alerting from `boundaries/slo.md §7`. Two alert pairs protect against fast budget exhaustion and slow invisible drain.
|
|
411
|
+
|
|
412
|
+
- **Fast burn**: about 2.14% of a 28-day budget consumed in 1h (14.4x rate), gated by a 5m short window to suppress transient spikes.
|
|
413
|
+
- **Slow burn**: about 5.36% of a 28-day budget consumed in 6h (6x rate), gated by a 30m short window.
|
|
414
|
+
|
|
415
|
+
Error budget denominator for 99.9% SLO: `1 - 0.999 = 0.001`.
|
|
416
|
+
|
|
417
|
+
```yaml
|
|
418
|
+
apiVersion: monitoring.coreos.com/v1
|
|
419
|
+
kind: PrometheusRule
|
|
420
|
+
metadata:
|
|
421
|
+
name: checkout-slo-burn-rate
|
|
422
|
+
namespace: monitoring
|
|
423
|
+
labels:
|
|
424
|
+
prometheus: kube-prometheus
|
|
425
|
+
role: alert-rules
|
|
426
|
+
spec:
|
|
427
|
+
groups:
|
|
428
|
+
- name: checkout.slo.burn_rate
|
|
429
|
+
interval: 30s
|
|
430
|
+
rules:
|
|
431
|
+
# Fast burn — 1h / 5m windows
|
|
432
|
+
- alert: CheckoutSLOBurnRateFast
|
|
433
|
+
expr: |
|
|
434
|
+
(
|
|
435
|
+
sum(rate(http_requests_total{service="checkout",status=~"5.."}[1h]))
|
|
436
|
+
/ sum(rate(http_requests_total{service="checkout"}[1h]))
|
|
437
|
+
) / (1 - 0.999) > 14.4
|
|
438
|
+
and
|
|
439
|
+
(
|
|
440
|
+
sum(rate(http_requests_total{service="checkout",status=~"5.."}[5m]))
|
|
441
|
+
/ sum(rate(http_requests_total{service="checkout"}[5m]))
|
|
442
|
+
) / (1 - 0.999) > 14.4
|
|
443
|
+
for: 2m
|
|
444
|
+
labels:
|
|
445
|
+
severity: critical
|
|
446
|
+
slo: checkout-availability
|
|
447
|
+
annotations:
|
|
448
|
+
summary: "Checkout SLO fast burn above 14.4x"
|
|
449
|
+
description: >
|
|
450
|
+
Burn rate is {{ $value }} times the budget rate.
|
|
451
|
+
At 14.4x, a full 28-day budget lasts about 46.7 hours;
|
|
452
|
+
remaining-budget exhaustion depends on budget already spent.
|
|
453
|
+
runbook: "https://wiki.example.com/runbooks/checkout-slo-fast-burn"
|
|
454
|
+
|
|
455
|
+
# Slow burn — 6h / 30m windows
|
|
456
|
+
- alert: CheckoutSLOBurnRateSlow
|
|
457
|
+
expr: |
|
|
458
|
+
(
|
|
459
|
+
sum(rate(http_requests_total{service="checkout",status=~"5.."}[6h]))
|
|
460
|
+
/ sum(rate(http_requests_total{service="checkout"}[6h]))
|
|
461
|
+
) / (1 - 0.999) > 6
|
|
462
|
+
and
|
|
463
|
+
(
|
|
464
|
+
sum(rate(http_requests_total{service="checkout",status=~"5.."}[30m]))
|
|
465
|
+
/ sum(rate(http_requests_total{service="checkout"}[30m]))
|
|
466
|
+
) / (1 - 0.999) > 6
|
|
467
|
+
for: 15m
|
|
468
|
+
labels:
|
|
469
|
+
severity: warning
|
|
470
|
+
slo: checkout-availability
|
|
471
|
+
annotations:
|
|
472
|
+
summary: "Checkout SLO slow burn: budget exhausting in < 5 days"
|
|
473
|
+
description: >
|
|
474
|
+
Burn rate is {{ $value }} times the budget rate.
|
|
475
|
+
At 6x, a full 28-day budget lasts about 4.67 days;
|
|
476
|
+
remaining-budget exhaustion depends on budget already spent.
|
|
477
|
+
runbook: "https://wiki.example.com/runbooks/checkout-slo-slow-burn"
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## 7. GitOps Integration
|
|
483
|
+
|
|
484
|
+
### 7.1 Argo CD
|
|
485
|
+
|
|
486
|
+
Source: <https://argoproj.github.io/cd/>
|
|
487
|
+
|
|
488
|
+
Use the app-of-apps pattern to manage the observability stack as a first-class application:
|
|
489
|
+
|
|
490
|
+
```
|
|
491
|
+
observability-root (App of Apps)
|
|
492
|
+
├── prometheus-stack (App)
|
|
493
|
+
├── otel-operator (App)
|
|
494
|
+
├── otelcol-daemonset (App) ← OpenTelemetryCollector CRD
|
|
495
|
+
├── otelcol-gateway (App)
|
|
496
|
+
├── dashboards (App) ← Grafonnet rendered JSON in ConfigMap
|
|
497
|
+
└── alert-rules (App) ← PrometheusRule CRDs
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
Argo CD reconciles git state to the cluster on every commit. Drift is detected and surfaced in the Argo CD UI.
|
|
501
|
+
|
|
502
|
+
### 7.2 Flux (CNCF Graduated)
|
|
503
|
+
|
|
504
|
+
Source: <https://fluxcd.io>
|
|
505
|
+
|
|
506
|
+
Flux `Kustomization` resources watch git paths and apply them to the cluster. Flagger (a Flux ecosystem project) handles progressive delivery gates; cross-ref `boundaries/release.md` for canary/blue-green integration.
|
|
507
|
+
|
|
508
|
+
```yaml
|
|
509
|
+
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
|
510
|
+
kind: Kustomization
|
|
511
|
+
metadata:
|
|
512
|
+
name: observability-alerts
|
|
513
|
+
namespace: flux-system
|
|
514
|
+
spec:
|
|
515
|
+
interval: 5m
|
|
516
|
+
path: ./alerts
|
|
517
|
+
prune: true
|
|
518
|
+
sourceRef:
|
|
519
|
+
kind: GitRepository
|
|
520
|
+
name: observability-repo
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### 7.3 Self-Observability of the GitOps Stack
|
|
524
|
+
|
|
525
|
+
The observability stack is itself observed via meta-observability. Cross-ref `meta-observability.md §Section A` for the pipeline self-health metrics that must remain green to trust any downstream alert or dashboard. Argo CD and Flux both expose Prometheus metrics; scrape them with the same DaemonSet collector.
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## 8. Immutable Review Workflow
|
|
530
|
+
|
|
531
|
+
All observability changes flow through the same review gate as application code:
|
|
532
|
+
|
|
533
|
+
| Step | Tool | What is checked |
|
|
534
|
+
|------|------|----------------|
|
|
535
|
+
| Open PR | GitHub / GitLab | Diff shows intent |
|
|
536
|
+
| CI: PromQL / rule lint | Extract `.spec`, then `promtool check rules` | Raw `groups` rule syntax and PromQL; validate the Kubernetes CRD separately |
|
|
537
|
+
| CI: Collector config lint | `otelcol validate` | Collector YAML syntax and component graph |
|
|
538
|
+
| CI: Jsonnet lint | `jsonnetfmt --test` | Grafonnet formatting |
|
|
539
|
+
| CI: Dashboard lint | Grafana dashboard linter | Panel best practices (no orphan panels, datasource vars set) |
|
|
540
|
+
| Peer review | GitHub CODEOWNERS | At least one SRE approval |
|
|
541
|
+
| Merge → main | CI gate | All checks must pass |
|
|
542
|
+
| CD apply | Argo CD / Flux | Reconciles to cluster; Argo CD marks Synced |
|
|
543
|
+
|
|
544
|
+
Audit trail: git history records reviewed configuration changes. Select access, integrity, and retention controls for the required evidence; see `signals/audit.md`. WORM is conditional on the approved obligation.
|
|
545
|
+
|
|
546
|
+
---
|
|
547
|
+
|
|
548
|
+
## 9. Secrets Management for Observability Stack
|
|
549
|
+
|
|
550
|
+
Backend API keys, Grafana service account tokens, and OAuth client secrets MUST NOT be committed to git; even in encrypted form inside dashboard YAML.
|
|
551
|
+
|
|
552
|
+
| Pattern | Tool | Notes |
|
|
553
|
+
|---------|------|-------|
|
|
554
|
+
| Kubernetes secrets from Vault | External Secrets Operator | Syncs Vault path → Kubernetes Secret |
|
|
555
|
+
| Encrypted secrets in git | Sealed Secrets (Bitnami) | `SealedSecret` CRD; encrypted with cluster public key |
|
|
556
|
+
| Cloud-native secret store | AWS Secrets Manager, GCP Secret Manager | Pull via ESO provider |
|
|
557
|
+
|
|
558
|
+
Reference secrets in `OpenTelemetryCollector` CRD and Terraform via `secretKeyRef`, never inline:
|
|
559
|
+
|
|
560
|
+
```yaml
|
|
561
|
+
env:
|
|
562
|
+
- name: GRAFANA_API_TOKEN
|
|
563
|
+
valueFrom:
|
|
564
|
+
secretKeyRef:
|
|
565
|
+
name: grafana-credentials
|
|
566
|
+
key: api-token
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
---
|
|
570
|
+
|
|
571
|
+
## 10. Environment Separation
|
|
572
|
+
|
|
573
|
+
| Concern | Approach |
|
|
574
|
+
|---------|----------|
|
|
575
|
+
| Separate namespaces | `observability-dev`, `observability-staging`, `observability-prod` |
|
|
576
|
+
| Dashboard parameterization | Grafana template variable `$env` filters all queries; built into Grafonnet at render time |
|
|
577
|
+
| Kustomize overlays | Base config + `overlays/dev`, `overlays/prod` for resource limits, replica counts, retention |
|
|
578
|
+
| Helm values | `values-dev.yaml`, `values-prod.yaml` per environment |
|
|
579
|
+
|
|
580
|
+
Never duplicate dashboard JSON per environment. Parameterize via variables; let the environment label filter do the work.
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
## 11. Testing Observability-as-Code
|
|
585
|
+
|
|
586
|
+
| Test type | Method | Tooling |
|
|
587
|
+
|-----------|--------|---------|
|
|
588
|
+
| Dashboard preview | Import rendered JSON into ephemeral Grafana via API; visual check | `grafana-cli`, Grafana HTTP API |
|
|
589
|
+
| Alert firing validation | Inject synthetic metric spike (set error counter to trigger threshold); confirm alert fires and routes | `promtool test rules` with `rule_test` fixtures |
|
|
590
|
+
| Collector config unit test | Feed sample OTLP telemetry fixtures through `otelcol` in test mode | `otelcol_test` package; `file` exporter to assert output |
|
|
591
|
+
|
|
592
|
+
```yaml
|
|
593
|
+
# promtool rule test — tests/checkout_slo_test.yaml
|
|
594
|
+
# First extract the CRD .spec to the raw groups file referenced here.
|
|
595
|
+
rule_files:
|
|
596
|
+
- ../rendered-rules/checkout-slo-burn-rate.yaml
|
|
597
|
+
|
|
598
|
+
tests:
|
|
599
|
+
- interval: 1m
|
|
600
|
+
input_series:
|
|
601
|
+
- series: 'http_requests_total{service="checkout",status="500"}'
|
|
602
|
+
values: "0+100x10" # 100 errors/min for 10 minutes
|
|
603
|
+
- series: 'http_requests_total{service="checkout",status="200"}'
|
|
604
|
+
values: "0+900x10" # 900 success/min
|
|
605
|
+
alert_rule_test:
|
|
606
|
+
- eval_time: 10m
|
|
607
|
+
alertname: CheckoutSLOBurnRateFast
|
|
608
|
+
exp_alerts:
|
|
609
|
+
- exp_labels:
|
|
610
|
+
severity: critical
|
|
611
|
+
slo: checkout-availability
|
|
612
|
+
exp_annotations:
|
|
613
|
+
summary: "Checkout SLO fast burn above 14.4x"
|
|
614
|
+
description: >
|
|
615
|
+
Burn rate is 100 times the budget rate.
|
|
616
|
+
At 14.4x, a full 28-day budget lasts about 46.7 hours;
|
|
617
|
+
remaining-budget exhaustion depends on budget already spent.
|
|
618
|
+
runbook: "https://wiki.example.com/runbooks/checkout-slo-fast-burn"
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
## 12. Perses CNCF Sandbox Specifics
|
|
624
|
+
|
|
625
|
+
Source: <https://perses.dev> | CNCF Sandbox status as of 2026-Q2.
|
|
626
|
+
|
|
627
|
+
- YAML schema is stricter and more opinionated than Grafana JSON; dashboards are more portable but migration from Grafana JSON requires manual mapping (import tooling is under active development).
|
|
628
|
+
- Perses CLI (`percli`) provides `apply`, `get`, `delete`, and `lint` subcommands mirroring `kubectl`.
|
|
629
|
+
- Use Perses when: the organization requires a vendor-neutral CNCF-blessed format, or is evaluating a Grafana alternative.
|
|
630
|
+
- Do not use Perses as the sole dashboard-as-code solution in production yet unless the team accepts the current schema instability risk. Track promotion to CNCF Incubating as the stability signal.
|
|
631
|
+
|
|
632
|
+
---
|
|
633
|
+
|
|
634
|
+
## 13. Matrix Coverage Note
|
|
635
|
+
|
|
636
|
+
Observability-as-code is cross-cutting: it covers every row in `matrix.md` (all layers, all boundaries, all signals). It has no dedicated matrix row. Think of it as the delivery mechanism for everything else in the skill; the how, not the what.
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
640
|
+
## 14. Anti-Patterns
|
|
641
|
+
|
|
642
|
+
Append to `anti-patterns.md §Section I: As-Code and GitOps`:
|
|
643
|
+
|
|
644
|
+
| # | Anti-pattern | Consequence | Fix |
|
|
645
|
+
|---|-------------|-------------|-----|
|
|
646
|
+
| I-1 | Dashboards edited directly in Grafana UI | No rollback; peer review bypassed; drift from git within hours | All edits via PR; Grafana provisioning blocks UI edits (`allowUiUpdates: false`) |
|
|
647
|
+
| I-2 | Alert rules without automated tests | False alarms or silent failures reach production undetected | Add `promtool test rules` fixtures to CI for every new alert |
|
|
648
|
+
| I-3 | Secrets (API tokens, DSNs) committed in dashboard YAML or `values.yaml` | Credentials exposed in git history permanently | External Secrets Operator or Sealed Secrets; never inline |
|
|
649
|
+
| I-4 | No CI validation for PrometheusRule or Collector config | Invalid YAML / broken PromQL deployed to production; alerts silently stop firing | Validate CRD schema, extract `.spec` for `promtool check rules`, and use `otelcol validate` with the selected Collector distribution |
|
|
650
|
+
| I-5 | Environment-specific dashboards duplicated instead of parameterized | N copies of the same dashboard diverge; maintenance multiplied by N | Template variable `$env`; single parameterized source of truth |
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
## Cross-References
|
|
655
|
+
|
|
656
|
+
| Topic | File |
|
|
657
|
+
|-------|------|
|
|
658
|
+
| SLO math and error budget formula | `boundaries/slo.md §4` |
|
|
659
|
+
| OpenSLO YAML full example | `boundaries/slo.md §5` |
|
|
660
|
+
| Burn-rate multi-window alert math | `boundaries/slo.md §7` |
|
|
661
|
+
| OTel Operator four deployment modes | `transport/collector-topology.md §1` |
|
|
662
|
+
| Instrumentation CR for auto-injection | `layers/mesh.md §OTel Operator Instrumentation CR` |
|
|
663
|
+
| Pipeline self-health alerts (meta) | `meta-observability.md §Section F` |
|
|
664
|
+
| Evidence-specific audit integrity and retention | `signals/audit.md` |
|
|
665
|
+
| Progressive delivery (Flagger) | `boundaries/release.md` |
|
|
666
|
+
| Anti-patterns full list | `anti-patterns.md` |
|