agentic-qe 3.7.9 → 3.7.11

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.
Files changed (401) hide show
  1. package/.claude/skills/.validation/README.md +111 -111
  2. package/.claude/skills/.validation/examples/chaos-engineering-output.example.json +530 -530
  3. package/.claude/skills/.validation/examples/performance-testing-output.example.json +252 -252
  4. package/.claude/skills/.validation/examples/security-testing-output.example.json +413 -413
  5. package/.claude/skills/.validation/examples/testability-scoring-output.example.json +350 -350
  6. package/.claude/skills/.validation/schemas/skill-eval.schema.json +462 -462
  7. package/.claude/skills/.validation/schemas/skill-frontmatter.schema.json +341 -341
  8. package/.claude/skills/.validation/schemas/skill-output-meta.schema.json +199 -199
  9. package/.claude/skills/.validation/schemas/skill-output.template.json +610 -610
  10. package/.claude/skills/.validation/skill-validation-mcp-integration.md +250 -250
  11. package/.claude/skills/.validation/templates/eval.template.yaml +366 -366
  12. package/.claude/skills/.validation/templates/schemas/output.json +145 -145
  13. package/.claude/skills/.validation/templates/security-testing-eval.template.yaml +725 -725
  14. package/.claude/skills/.validation/templates/skill-frontmatter.example.yaml +225 -225
  15. package/.claude/skills/.validation/test-data/invalid-output.json +5 -5
  16. package/.claude/skills/.validation/test-data/minimal-output.json +9 -9
  17. package/.claude/skills/.validation/test-data/sample-output.json +73 -73
  18. package/.claude/skills/a11y-ally/evals/a11y-ally.yaml +376 -376
  19. package/.claude/skills/a11y-ally/schemas/output.json +549 -549
  20. package/.claude/skills/accessibility-testing/evals/accessibility-testing.yaml +719 -719
  21. package/.claude/skills/accessibility-testing/schemas/output.json +776 -776
  22. package/.claude/skills/accessibility-testing/test-data/sample-output.json +191 -191
  23. package/.claude/skills/agentic-quality-engineering/schemas/output.json +577 -577
  24. package/.claude/skills/api-testing-patterns/evals/api-testing-patterns.yaml +696 -696
  25. package/.claude/skills/api-testing-patterns/schemas/output.json +845 -845
  26. package/.claude/skills/aqe-v2-v3-migration/schemas/output.json +513 -513
  27. package/.claude/skills/brutal-honesty-review/schemas/output.json +291 -291
  28. package/.claude/skills/bug-reporting-excellence/schemas/output.json +288 -288
  29. package/.claude/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -761
  30. package/.claude/skills/chaos-engineering-resilience/schemas/output.json +1205 -1205
  31. package/.claude/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +157 -157
  32. package/.claude/skills/cicd-pipeline-qe-orchestrator/schemas/output.json +542 -542
  33. package/.claude/skills/code-review-quality/schemas/output.json +264 -264
  34. package/.claude/skills/compatibility-testing/evals/compatibility-testing.yaml +410 -410
  35. package/.claude/skills/compatibility-testing/schemas/output.json +551 -551
  36. package/.claude/skills/compliance-testing/evals/compliance-testing.yaml +1107 -1107
  37. package/.claude/skills/compliance-testing/schemas/output.json +845 -845
  38. package/.claude/skills/consultancy-practices/schemas/output.json +282 -282
  39. package/.claude/skills/contract-testing/evals/contract-testing.yaml +748 -748
  40. package/.claude/skills/contract-testing/schemas/output.json +638 -638
  41. package/.claude/skills/database-testing/evals/database-testing.yaml +968 -968
  42. package/.claude/skills/database-testing/schemas/output.json +1446 -1446
  43. package/.claude/skills/debug-loop/SKILL.md +61 -61
  44. package/.claude/skills/enterprise-integration-testing/SKILL.md +735 -735
  45. package/.claude/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -158
  46. package/.claude/skills/enterprise-integration-testing/schemas/output.json +74 -74
  47. package/.claude/skills/enterprise-integration-testing/scripts/validate-config.json +25 -25
  48. package/.claude/skills/iterative-loop/SKILL.md +371 -371
  49. package/.claude/skills/localization-testing/evals/localization-testing.yaml +544 -544
  50. package/.claude/skills/localization-testing/schemas/output.json +325 -325
  51. package/.claude/skills/middleware-testing-patterns/SKILL.md +798 -798
  52. package/.claude/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +153 -153
  53. package/.claude/skills/middleware-testing-patterns/schemas/output.json +58 -58
  54. package/.claude/skills/middleware-testing-patterns/scripts/validate-config.json +25 -25
  55. package/.claude/skills/mobile-testing/evals/mobile-testing.yaml +537 -537
  56. package/.claude/skills/mobile-testing/schemas/output.json +318 -318
  57. package/.claude/skills/mutation-testing/evals/mutation-testing.yaml +652 -652
  58. package/.claude/skills/mutation-testing/schemas/output.json +707 -707
  59. package/.claude/skills/mutation-testing/test-data/sample-output.json +295 -295
  60. package/.claude/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +450 -450
  61. package/.claude/skills/n8n-expression-testing/schemas/output.json +369 -369
  62. package/.claude/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +522 -522
  63. package/.claude/skills/n8n-integration-testing-patterns/schemas/output.json +291 -291
  64. package/.claude/skills/n8n-security-testing/evals/n8n-security-testing.yaml +493 -493
  65. package/.claude/skills/n8n-security-testing/schemas/output.json +293 -293
  66. package/.claude/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +500 -500
  67. package/.claude/skills/n8n-trigger-testing-strategies/schemas/output.json +295 -295
  68. package/.claude/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +497 -497
  69. package/.claude/skills/n8n-workflow-testing-fundamentals/schemas/output.json +254 -254
  70. package/.claude/skills/observability-testing-patterns/SKILL.md +930 -930
  71. package/.claude/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +157 -157
  72. package/.claude/skills/observability-testing-patterns/schemas/output.json +58 -58
  73. package/.claude/skills/observability-testing-patterns/scripts/validate-config.json +25 -25
  74. package/.claude/skills/pentest-validation/SKILL.md +268 -268
  75. package/.claude/skills/pentest-validation/evals/pentest-validation.yaml +708 -708
  76. package/.claude/skills/pentest-validation/schemas/output.json +281 -281
  77. package/.claude/skills/performance-analysis/evals/performance-analysis.yaml +144 -144
  78. package/.claude/skills/performance-analysis/schemas/output.json +588 -588
  79. package/.claude/skills/performance-testing/evals/performance-testing.yaml +772 -772
  80. package/.claude/skills/performance-testing/schemas/output.json +1184 -1184
  81. package/.claude/skills/pr-review/SKILL.md +61 -61
  82. package/.claude/skills/qcsd-cicd-swarm/SKILL.md +2206 -2206
  83. package/.claude/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +211 -211
  84. package/.claude/skills/qcsd-cicd-swarm/schemas/output.json +86 -86
  85. package/.claude/skills/qcsd-cicd-swarm/scripts/validate-config.json +30 -30
  86. package/.claude/skills/qcsd-development-swarm/SKILL.md +2154 -2154
  87. package/.claude/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +162 -162
  88. package/.claude/skills/qcsd-development-swarm/schemas/output.json +72 -72
  89. package/.claude/skills/qcsd-development-swarm/scripts/validate-config.json +25 -25
  90. package/.claude/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -138
  91. package/.claude/skills/qcsd-ideation-swarm/schemas/output.json +568 -568
  92. package/.claude/skills/qcsd-production-swarm/SKILL.md +2781 -2781
  93. package/.claude/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -246
  94. package/.claude/skills/qcsd-production-swarm/schemas/output.json +505 -505
  95. package/.claude/skills/qcsd-production-swarm/scripts/validate-config.json +25 -25
  96. package/.claude/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +443 -443
  97. package/.claude/skills/qe-chaos-resilience/schemas/output.json +314 -314
  98. package/.claude/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +459 -459
  99. package/.claude/skills/qe-code-intelligence/schemas/output.json +315 -315
  100. package/.claude/skills/qe-contract-testing/evals/qe-contract-testing.yaml +513 -513
  101. package/.claude/skills/qe-contract-testing/schemas/output.json +295 -295
  102. package/.claude/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -494
  103. package/.claude/skills/qe-coverage-analysis/schemas/output.json +286 -286
  104. package/.claude/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +511 -511
  105. package/.claude/skills/qe-defect-intelligence/schemas/output.json +283 -283
  106. package/.claude/skills/qe-iterative-loop/schemas/output.json +264 -264
  107. package/.claude/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +144 -144
  108. package/.claude/skills/qe-learning-optimization/schemas/output.json +288 -288
  109. package/.claude/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +506 -506
  110. package/.claude/skills/qe-quality-assessment/schemas/output.json +550 -550
  111. package/.claude/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -598
  112. package/.claude/skills/qe-requirements-validation/schemas/output.json +587 -587
  113. package/.claude/skills/qe-security-compliance/evals/qe-security-compliance.yaml +595 -595
  114. package/.claude/skills/qe-security-compliance/schemas/output.json +498 -498
  115. package/.claude/skills/qe-test-execution/evals/qe-test-execution.yaml +607 -607
  116. package/.claude/skills/qe-test-execution/schemas/output.json +529 -529
  117. package/.claude/skills/qe-test-generation/evals/qe-test-generation.yaml +148 -148
  118. package/.claude/skills/qe-test-generation/schemas/output.json +439 -439
  119. package/.claude/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +142 -142
  120. package/.claude/skills/qe-visual-accessibility/schemas/output.json +491 -491
  121. package/.claude/skills/quality-metrics/evals/quality-metrics.yaml +494 -494
  122. package/.claude/skills/quality-metrics/schemas/output.json +403 -403
  123. package/.claude/skills/refactoring-patterns/schemas/output.json +475 -475
  124. package/.claude/skills/regression-testing/evals/regression-testing.yaml +504 -504
  125. package/.claude/skills/regression-testing/schemas/output.json +311 -311
  126. package/.claude/skills/release/SKILL.md +347 -347
  127. package/.claude/skills/risk-based-testing/evals/risk-based-testing.yaml +141 -141
  128. package/.claude/skills/risk-based-testing/schemas/output.json +480 -480
  129. package/.claude/skills/security-testing/evals/security-testing.yaml +789 -789
  130. package/.claude/skills/security-testing/schemas/output.json +879 -879
  131. package/.claude/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -163
  132. package/.claude/skills/security-visual-testing/schemas/output.json +486 -486
  133. package/.claude/skills/sfdipot-product-factors/SKILL.md +239 -239
  134. package/.claude/skills/sherlock-review/schemas/output.json +297 -297
  135. package/.claude/skills/shift-left-testing/evals/shift-left-testing.yaml +145 -145
  136. package/.claude/skills/shift-left-testing/schemas/output.json +459 -459
  137. package/.claude/skills/shift-right-testing/evals/shift-right-testing.yaml +147 -147
  138. package/.claude/skills/shift-right-testing/schemas/output.json +418 -418
  139. package/.claude/skills/skills-manifest.json +1 -1
  140. package/.claude/skills/tdd-london-chicago/schemas/output.json +444 -444
  141. package/.claude/skills/technical-writing/schemas/output.json +268 -268
  142. package/.claude/skills/test-automation-strategy/evals/test-automation-strategy.yaml +148 -148
  143. package/.claude/skills/test-automation-strategy/schemas/output.json +444 -444
  144. package/.claude/skills/test-data-management/evals/test-data-management.yaml +504 -504
  145. package/.claude/skills/test-data-management/schemas/output.json +284 -284
  146. package/.claude/skills/test-design-techniques/evals/test-design-techniques.yaml +142 -142
  147. package/.claude/skills/test-design-techniques/schemas/output.json +295 -295
  148. package/.claude/skills/test-environment-management/schemas/output.json +310 -310
  149. package/.claude/skills/test-idea-rewriting/SKILL.md +229 -229
  150. package/.claude/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +155 -155
  151. package/.claude/skills/test-reporting-analytics/schemas/output.json +329 -329
  152. package/.claude/skills/testability-scoring/evals/testability-scoring.yaml +814 -814
  153. package/.claude/skills/testability-scoring/resources/templates/config.template.js +84 -84
  154. package/.claude/skills/testability-scoring/schemas/output.json +606 -606
  155. package/.claude/skills/testability-scoring/scripts/generate-html-report.js +1007 -1007
  156. package/.claude/skills/verification-quality/evals/verification-quality.yaml +150 -150
  157. package/.claude/skills/verification-quality/schemas/output.json +432 -432
  158. package/.claude/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +154 -154
  159. package/.claude/skills/visual-testing-advanced/schemas/output.json +294 -294
  160. package/.claude/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +165 -165
  161. package/.claude/skills/wms-testing-patterns/schemas/output.json +150 -150
  162. package/.claude/skills/wms-testing-patterns/scripts/validate-config.json +51 -51
  163. package/CHANGELOG.md +36 -0
  164. package/README.md +171 -901
  165. package/assets/agents/v3/helpers/quality-criteria/evidence-classification.md +116 -116
  166. package/assets/agents/v3/helpers/quality-criteria/htsm-categories.md +139 -139
  167. package/assets/governance/constitution.md +202 -202
  168. package/assets/governance/shards/chaos-resilience.shard.md +221 -221
  169. package/assets/governance/shards/code-intelligence.shard.md +178 -178
  170. package/assets/governance/shards/contract-testing.shard.md +206 -206
  171. package/assets/governance/shards/coverage-analysis.shard.md +146 -146
  172. package/assets/governance/shards/defect-intelligence.shard.md +182 -182
  173. package/assets/governance/shards/learning-optimization.shard.md +248 -248
  174. package/assets/governance/shards/quality-assessment.shard.md +165 -165
  175. package/assets/governance/shards/requirements-validation.shard.md +177 -177
  176. package/assets/governance/shards/security-compliance.shard.md +196 -196
  177. package/assets/governance/shards/test-execution.shard.md +156 -156
  178. package/assets/governance/shards/test-generation.shard.md +128 -128
  179. package/assets/governance/shards/visual-accessibility.shard.md +209 -209
  180. package/assets/hooks/cross-phase-memory.yaml +253 -253
  181. package/assets/patterns/adr-051-booster-patterns.json +78 -78
  182. package/assets/patterns/adr-051-embedding-patterns.json +147 -147
  183. package/assets/patterns/adr-051-integration-summary.json +62 -62
  184. package/assets/patterns/adr-051-reasoning-patterns.json +166 -166
  185. package/assets/patterns/adr-051-router-patterns.json +113 -113
  186. package/assets/patterns/index.json +136 -136
  187. package/assets/skills/.validation/README.md +111 -111
  188. package/assets/skills/.validation/examples/chaos-engineering-output.example.json +530 -530
  189. package/assets/skills/.validation/examples/performance-testing-output.example.json +252 -252
  190. package/assets/skills/.validation/examples/security-testing-output.example.json +413 -413
  191. package/assets/skills/.validation/examples/testability-scoring-output.example.json +350 -350
  192. package/assets/skills/.validation/schemas/skill-eval.schema.json +462 -462
  193. package/assets/skills/.validation/schemas/skill-frontmatter.schema.json +341 -341
  194. package/assets/skills/.validation/schemas/skill-output-meta.schema.json +199 -199
  195. package/assets/skills/.validation/schemas/skill-output.template.json +610 -610
  196. package/assets/skills/.validation/skill-validation-mcp-integration.md +250 -250
  197. package/assets/skills/.validation/templates/eval.template.yaml +366 -366
  198. package/assets/skills/.validation/templates/schemas/output.json +145 -145
  199. package/assets/skills/.validation/templates/security-testing-eval.template.yaml +725 -725
  200. package/assets/skills/.validation/templates/skill-frontmatter.example.yaml +225 -225
  201. package/assets/skills/.validation/test-data/invalid-output.json +5 -5
  202. package/assets/skills/.validation/test-data/minimal-output.json +9 -9
  203. package/assets/skills/.validation/test-data/sample-output.json +73 -73
  204. package/assets/skills/a11y-ally/evals/a11y-ally.yaml +376 -376
  205. package/assets/skills/a11y-ally/schemas/output.json +549 -549
  206. package/assets/skills/accessibility-testing/evals/accessibility-testing.yaml +719 -719
  207. package/assets/skills/accessibility-testing/schemas/output.json +776 -776
  208. package/assets/skills/accessibility-testing/test-data/sample-output.json +191 -191
  209. package/assets/skills/agentic-quality-engineering/schemas/output.json +577 -577
  210. package/assets/skills/api-testing-patterns/evals/api-testing-patterns.yaml +696 -696
  211. package/assets/skills/api-testing-patterns/schemas/output.json +845 -845
  212. package/assets/skills/aqe-v2-v3-migration/schemas/output.json +513 -513
  213. package/assets/skills/brutal-honesty-review/schemas/output.json +291 -291
  214. package/assets/skills/bug-reporting-excellence/schemas/output.json +288 -288
  215. package/assets/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -761
  216. package/assets/skills/chaos-engineering-resilience/schemas/output.json +1205 -1205
  217. package/assets/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +157 -157
  218. package/assets/skills/cicd-pipeline-qe-orchestrator/schemas/output.json +542 -542
  219. package/assets/skills/code-review-quality/schemas/output.json +264 -264
  220. package/assets/skills/compatibility-testing/evals/compatibility-testing.yaml +410 -410
  221. package/assets/skills/compatibility-testing/schemas/output.json +551 -551
  222. package/assets/skills/compliance-testing/evals/compliance-testing.yaml +1107 -1107
  223. package/assets/skills/compliance-testing/schemas/output.json +845 -845
  224. package/assets/skills/consultancy-practices/schemas/output.json +282 -282
  225. package/assets/skills/contract-testing/evals/contract-testing.yaml +748 -748
  226. package/assets/skills/contract-testing/schemas/output.json +638 -638
  227. package/assets/skills/database-testing/evals/database-testing.yaml +968 -968
  228. package/assets/skills/database-testing/schemas/output.json +1446 -1446
  229. package/assets/skills/debug-loop/SKILL.md +61 -61
  230. package/assets/skills/enterprise-integration-testing/SKILL.md +735 -735
  231. package/assets/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -158
  232. package/assets/skills/enterprise-integration-testing/schemas/output.json +74 -74
  233. package/assets/skills/enterprise-integration-testing/scripts/validate-config.json +25 -25
  234. package/assets/skills/localization-testing/evals/localization-testing.yaml +544 -544
  235. package/assets/skills/localization-testing/schemas/output.json +325 -325
  236. package/assets/skills/middleware-testing-patterns/SKILL.md +798 -798
  237. package/assets/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +153 -153
  238. package/assets/skills/middleware-testing-patterns/schemas/output.json +58 -58
  239. package/assets/skills/middleware-testing-patterns/scripts/validate-config.json +25 -25
  240. package/assets/skills/mobile-testing/evals/mobile-testing.yaml +537 -537
  241. package/assets/skills/mobile-testing/schemas/output.json +318 -318
  242. package/assets/skills/mutation-testing/evals/mutation-testing.yaml +652 -652
  243. package/assets/skills/mutation-testing/schemas/output.json +707 -707
  244. package/assets/skills/mutation-testing/test-data/sample-output.json +295 -295
  245. package/assets/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +450 -450
  246. package/assets/skills/n8n-expression-testing/schemas/output.json +369 -369
  247. package/assets/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +522 -522
  248. package/assets/skills/n8n-integration-testing-patterns/schemas/output.json +291 -291
  249. package/assets/skills/n8n-security-testing/evals/n8n-security-testing.yaml +493 -493
  250. package/assets/skills/n8n-security-testing/schemas/output.json +293 -293
  251. package/assets/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +500 -500
  252. package/assets/skills/n8n-trigger-testing-strategies/schemas/output.json +295 -295
  253. package/assets/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +497 -497
  254. package/assets/skills/n8n-workflow-testing-fundamentals/schemas/output.json +254 -254
  255. package/assets/skills/observability-testing-patterns/SKILL.md +930 -930
  256. package/assets/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +157 -157
  257. package/assets/skills/observability-testing-patterns/schemas/output.json +58 -58
  258. package/assets/skills/observability-testing-patterns/scripts/validate-config.json +25 -25
  259. package/assets/skills/pentest-validation/SKILL.md +268 -268
  260. package/assets/skills/pentest-validation/evals/pentest-validation.yaml +708 -708
  261. package/assets/skills/pentest-validation/schemas/output.json +281 -281
  262. package/assets/skills/performance-testing/evals/performance-testing.yaml +772 -772
  263. package/assets/skills/performance-testing/schemas/output.json +1184 -1184
  264. package/assets/skills/pr-review/SKILL.md +61 -61
  265. package/assets/skills/qcsd-cicd-swarm/SKILL.md +2206 -2206
  266. package/assets/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +211 -211
  267. package/assets/skills/qcsd-cicd-swarm/schemas/output.json +86 -86
  268. package/assets/skills/qcsd-cicd-swarm/scripts/validate-config.json +30 -30
  269. package/assets/skills/qcsd-development-swarm/SKILL.md +2154 -2154
  270. package/assets/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +162 -162
  271. package/assets/skills/qcsd-development-swarm/schemas/output.json +72 -72
  272. package/assets/skills/qcsd-development-swarm/scripts/validate-config.json +25 -25
  273. package/assets/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -138
  274. package/assets/skills/qcsd-ideation-swarm/schemas/output.json +568 -568
  275. package/assets/skills/qcsd-production-swarm/SKILL.md +2781 -2781
  276. package/assets/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -246
  277. package/assets/skills/qcsd-production-swarm/schemas/output.json +505 -505
  278. package/assets/skills/qcsd-production-swarm/scripts/validate-config.json +25 -25
  279. package/assets/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +443 -443
  280. package/assets/skills/qe-chaos-resilience/schemas/output.json +314 -314
  281. package/assets/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +459 -459
  282. package/assets/skills/qe-code-intelligence/schemas/output.json +315 -315
  283. package/assets/skills/qe-contract-testing/evals/qe-contract-testing.yaml +513 -513
  284. package/assets/skills/qe-contract-testing/schemas/output.json +295 -295
  285. package/assets/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -494
  286. package/assets/skills/qe-coverage-analysis/schemas/output.json +286 -286
  287. package/assets/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +511 -511
  288. package/assets/skills/qe-defect-intelligence/schemas/output.json +283 -283
  289. package/assets/skills/qe-iterative-loop/schemas/output.json +264 -264
  290. package/assets/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +144 -144
  291. package/assets/skills/qe-learning-optimization/schemas/output.json +288 -288
  292. package/assets/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +506 -506
  293. package/assets/skills/qe-quality-assessment/schemas/output.json +550 -550
  294. package/assets/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -598
  295. package/assets/skills/qe-requirements-validation/schemas/output.json +587 -587
  296. package/assets/skills/qe-security-compliance/evals/qe-security-compliance.yaml +595 -595
  297. package/assets/skills/qe-security-compliance/schemas/output.json +498 -498
  298. package/assets/skills/qe-test-execution/evals/qe-test-execution.yaml +607 -607
  299. package/assets/skills/qe-test-execution/schemas/output.json +529 -529
  300. package/assets/skills/qe-test-generation/evals/qe-test-generation.yaml +148 -148
  301. package/assets/skills/qe-test-generation/schemas/output.json +439 -439
  302. package/assets/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +142 -142
  303. package/assets/skills/qe-visual-accessibility/schemas/output.json +491 -491
  304. package/assets/skills/quality-metrics/evals/quality-metrics.yaml +494 -494
  305. package/assets/skills/quality-metrics/schemas/output.json +403 -403
  306. package/assets/skills/refactoring-patterns/schemas/output.json +475 -475
  307. package/assets/skills/regression-testing/evals/regression-testing.yaml +504 -504
  308. package/assets/skills/regression-testing/schemas/output.json +311 -311
  309. package/assets/skills/risk-based-testing/evals/risk-based-testing.yaml +141 -141
  310. package/assets/skills/risk-based-testing/schemas/output.json +480 -480
  311. package/assets/skills/security-testing/evals/security-testing.yaml +789 -789
  312. package/assets/skills/security-testing/schemas/output.json +879 -879
  313. package/assets/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -163
  314. package/assets/skills/security-visual-testing/schemas/output.json +486 -486
  315. package/assets/skills/sfdipot-product-factors/SKILL.md +239 -239
  316. package/assets/skills/sherlock-review/schemas/output.json +297 -297
  317. package/assets/skills/shift-left-testing/evals/shift-left-testing.yaml +145 -145
  318. package/assets/skills/shift-left-testing/schemas/output.json +459 -459
  319. package/assets/skills/shift-right-testing/evals/shift-right-testing.yaml +147 -147
  320. package/assets/skills/shift-right-testing/schemas/output.json +418 -418
  321. package/assets/skills/tdd-london-chicago/schemas/output.json +444 -444
  322. package/assets/skills/technical-writing/schemas/output.json +268 -268
  323. package/assets/skills/test-automation-strategy/evals/test-automation-strategy.yaml +148 -148
  324. package/assets/skills/test-automation-strategy/schemas/output.json +444 -444
  325. package/assets/skills/test-data-management/evals/test-data-management.yaml +504 -504
  326. package/assets/skills/test-data-management/schemas/output.json +284 -284
  327. package/assets/skills/test-design-techniques/evals/test-design-techniques.yaml +142 -142
  328. package/assets/skills/test-design-techniques/schemas/output.json +295 -295
  329. package/assets/skills/test-environment-management/schemas/output.json +310 -310
  330. package/assets/skills/test-idea-rewriting/SKILL.md +229 -229
  331. package/assets/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +155 -155
  332. package/assets/skills/test-reporting-analytics/schemas/output.json +329 -329
  333. package/assets/skills/testability-scoring/evals/testability-scoring.yaml +814 -814
  334. package/assets/skills/testability-scoring/resources/templates/config.template.js +84 -84
  335. package/assets/skills/testability-scoring/schemas/output.json +606 -606
  336. package/assets/skills/testability-scoring/scripts/generate-html-report.js +1007 -1007
  337. package/assets/skills/verification-quality/evals/verification-quality.yaml +150 -150
  338. package/assets/skills/verification-quality/schemas/output.json +432 -432
  339. package/assets/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +154 -154
  340. package/assets/skills/visual-testing-advanced/schemas/output.json +294 -294
  341. package/assets/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +165 -165
  342. package/assets/skills/wms-testing-patterns/schemas/output.json +150 -150
  343. package/assets/skills/wms-testing-patterns/scripts/validate-config.json +51 -51
  344. package/assets/templates/validation-summary.json +56 -56
  345. package/dist/agents/claim-verifier/verifiers/output-verifier.d.ts +1 -0
  346. package/dist/agents/claim-verifier/verifiers/output-verifier.d.ts.map +1 -1
  347. package/dist/agents/claim-verifier/verifiers/output-verifier.js +16 -3
  348. package/dist/agents/claim-verifier/verifiers/output-verifier.js.map +1 -1
  349. package/dist/cli/bundle.js +488 -75
  350. package/dist/cli/commands/mcp.d.ts.map +1 -1
  351. package/dist/cli/commands/mcp.js +11 -9
  352. package/dist/cli/commands/mcp.js.map +1 -1
  353. package/dist/governance/adversarial-defense-integration.d.ts +29 -0
  354. package/dist/governance/adversarial-defense-integration.d.ts.map +1 -1
  355. package/dist/governance/adversarial-defense-integration.js +85 -1
  356. package/dist/governance/adversarial-defense-integration.js.map +1 -1
  357. package/dist/governance/continue-gate-integration.d.ts +7 -5
  358. package/dist/governance/continue-gate-integration.d.ts.map +1 -1
  359. package/dist/governance/continue-gate-integration.js +72 -15
  360. package/dist/governance/continue-gate-integration.js.map +1 -1
  361. package/dist/governance/deterministic-gateway-integration.d.ts +5 -0
  362. package/dist/governance/deterministic-gateway-integration.d.ts.map +1 -1
  363. package/dist/governance/deterministic-gateway-integration.js +35 -1
  364. package/dist/governance/deterministic-gateway-integration.js.map +1 -1
  365. package/dist/governance/evolution-pipeline-integration.d.ts +5 -0
  366. package/dist/governance/evolution-pipeline-integration.d.ts.map +1 -1
  367. package/dist/governance/evolution-pipeline-integration.js +57 -1
  368. package/dist/governance/evolution-pipeline-integration.js.map +1 -1
  369. package/dist/governance/memory-write-gate-integration.d.ts +6 -3
  370. package/dist/governance/memory-write-gate-integration.d.ts.map +1 -1
  371. package/dist/governance/memory-write-gate-integration.js +48 -10
  372. package/dist/governance/memory-write-gate-integration.js.map +1 -1
  373. package/dist/governance/proof-envelope-integration.d.ts +1 -0
  374. package/dist/governance/proof-envelope-integration.d.ts.map +1 -1
  375. package/dist/governance/proof-envelope-integration.js +37 -0
  376. package/dist/governance/proof-envelope-integration.js.map +1 -1
  377. package/dist/governance/shard-retriever-integration.d.ts +10 -0
  378. package/dist/governance/shard-retriever-integration.d.ts.map +1 -1
  379. package/dist/governance/shard-retriever-integration.js +50 -1
  380. package/dist/governance/shard-retriever-integration.js.map +1 -1
  381. package/dist/governance/trust-accumulator-integration.d.ts +5 -0
  382. package/dist/governance/trust-accumulator-integration.d.ts.map +1 -1
  383. package/dist/governance/trust-accumulator-integration.js +35 -2
  384. package/dist/governance/trust-accumulator-integration.js.map +1 -1
  385. package/dist/init/phases/10-workers.js +2 -2
  386. package/dist/init/phases/10-workers.js.map +1 -1
  387. package/dist/mcp/bundle.js +478 -62
  388. package/dist/mcp/protocol-server.js +2 -2
  389. package/dist/mcp/tool-registry.d.ts.map +1 -1
  390. package/dist/mcp/tool-registry.js +1 -0
  391. package/dist/mcp/tool-registry.js.map +1 -1
  392. package/dist/shared/language-detector.js +1 -1
  393. package/dist/shared/language-detector.js.map +1 -1
  394. package/dist/shared/parsers/multi-language-parser.d.ts.map +1 -1
  395. package/dist/shared/parsers/multi-language-parser.js +55 -16
  396. package/dist/shared/parsers/multi-language-parser.js.map +1 -1
  397. package/dist/shared/sql-safety.d.ts.map +1 -1
  398. package/dist/shared/sql-safety.js +7 -1
  399. package/dist/shared/sql-safety.js.map +1 -1
  400. package/package.json +6 -2
  401. package/scripts/prepare-assets.sh +8 -0
@@ -1,930 +1,930 @@
1
- ---
2
- name: observability-testing-patterns
3
- description: "Observability and monitoring validation patterns for dashboards, alerting, log aggregation, APM traces, and SLA/SLO verification. Use when testing monitoring infrastructure, dashboard accuracy, alert rules, or metric pipelines."
4
- category: specialized-testing
5
- priority: high
6
- tokenEstimate: 1600
7
- agents: [qe-integration-tester, qe-performance-tester, qe-visual-tester]
8
- implementation_status: optimized
9
- optimization_version: 1.0
10
- last_optimized: 2026-02-04
11
- dependencies: [api-testing-patterns, shift-right-testing]
12
- quick_reference_card: true
13
- tags: [observability, monitoring, kibana, elasticsearch, dashboards, alerting, metrics, logging]
14
- trust_tier: 3
15
- validation:
16
- schema_path: schemas/output.json
17
- validator_path: scripts/validate-config.json
18
- eval_path: evals/observability-testing-patterns.yaml
19
- ---
20
-
21
- # Observability Testing Patterns
22
-
23
- <default_to_action>
24
- When testing observability infrastructure, dashboards, or monitoring:
25
- 1. VALIDATE data accuracy (source data matches what the dashboard displays)
26
- 2. TEST alert rules fire correctly at defined thresholds
27
- 3. VERIFY log aggregation completeness (no missing logs across services)
28
- 4. TRACE distributed requests end-to-end through APM
29
- 5. MEASURE dashboard performance (render time, query latency)
30
- 6. CONFIRM SLA/SLO compliance through synthetic monitoring
31
- 7. TEST metric pipeline integrity from collection to display
32
-
33
- **Quick Pattern Selection:**
34
- - Dashboard shows wrong numbers -> Data accuracy validation
35
- - Alerts not firing -> Alert rule threshold testing
36
- - Missing logs in Kibana -> Log aggregation completeness
37
- - Slow dashboard -> Dashboard performance testing
38
- - Broken traces -> APM trace validation
39
- - SLA disputes -> SLO compliance validation
40
-
41
- **Critical Success Factors:**
42
- - Observability is only as good as the data it shows
43
- - A dashboard that lies is worse than no dashboard
44
- - Alert fatigue kills response times; test thresholds carefully
45
- </default_to_action>
46
-
47
- ## Quick Reference Card
48
-
49
- ### When to Use
50
- - Validating dashboard data accuracy (Kibana, Grafana, Datadog)
51
- - Testing alert rule thresholds and notification delivery
52
- - Verifying log aggregation completeness across microservices
53
- - Validating distributed tracing (APM) correctness
54
- - Measuring SLA/SLO compliance
55
- - Testing metric pipeline integrity (collection -> aggregation -> display)
56
-
57
- ### Testing Levels
58
- | Level | Purpose | Dependencies | Speed |
59
- |-------|---------|--------------|-------|
60
- | Query Validation | Elasticsearch/PromQL query accuracy | Data source | Fast |
61
- | Dashboard Accuracy | Visual matches source data | Full stack | Medium |
62
- | Alert Threshold | Trigger and notification testing | Alerting stack | Medium |
63
- | Pipeline Integrity | End-to-end metric flow | Full pipeline | Slower |
64
- | Performance | Dashboard render time, query latency | Full stack | Slower |
65
-
66
- ### Critical Test Scenarios
67
- | Scenario | Must Test | Example |
68
- |----------|----------|---------|
69
- | Data Accuracy | Dashboard = source truth | Order count on dashboard = DB count |
70
- | Alert Firing | Threshold triggers alert | Error rate > 5% fires PagerDuty |
71
- | Alert Recovery | Auto-resolve when recovered | Error rate drops below 5% clears alert |
72
- | Log Completeness | All services emit logs | 10 microservices, all logs in Kibana |
73
- | Trace Integrity | Full request path visible | Auth -> API -> DB -> Cache spans |
74
- | SLO Compliance | Error budget tracking | 99.9% availability over 30 days |
75
- | Time Accuracy | Timestamps aligned | Log timestamp matches event time |
76
-
77
- ### Tools
78
- - **Dashboards**: Kibana, Grafana, Datadog, New Relic
79
- - **Search**: Elasticsearch, OpenSearch, Loki
80
- - **Metrics**: Prometheus, InfluxDB, CloudWatch
81
- - **Tracing**: Jaeger, Zipkin, Datadog APM, OpenTelemetry
82
- - **Alerting**: PagerDuty, OpsGenie, Alertmanager
83
- - **Synthetic**: Datadog Synthetics, Checkly, Playwright
84
-
85
- ### Agent Coordination
86
- - `qe-integration-tester`: Validate data pipelines, query accuracy, log completeness
87
- - `qe-performance-tester`: Dashboard render performance, query latency
88
- - `qe-visual-tester`: Dashboard visual regression, layout accuracy
89
-
90
- ---
91
-
92
- ## Dashboard Data Accuracy Validation
93
-
94
- ### Compare Source Data to Dashboard
95
- ```javascript
96
- describe('Dashboard Data Accuracy', () => {
97
- it('order count on dashboard matches database', async () => {
98
- // Step 1: Get ground truth from source database
99
- const dbResult = await db.query(
100
- "SELECT COUNT(*) as count FROM orders WHERE created_at >= NOW() - INTERVAL '24 HOURS'"
101
- );
102
- const dbCount = parseInt(dbResult.rows[0].count);
103
-
104
- // Step 2: Query Elasticsearch (same data source as dashboard)
105
- const esResult = await esClient.search({
106
- index: 'orders-*',
107
- body: {
108
- query: {
109
- range: { created_at: { gte: 'now-24h' } }
110
- },
111
- size: 0,
112
- track_total_hits: true
113
- }
114
- });
115
- const esCount = esResult.hits.total.value;
116
-
117
- // Step 3: Compare
118
- expect(esCount).toBe(dbCount);
119
- });
120
-
121
- it('revenue metric on dashboard matches transaction totals', async () => {
122
- const dbRevenue = await db.query(
123
- "SELECT SUM(total) as revenue FROM orders WHERE status = 'COMPLETED' AND created_at >= NOW() - INTERVAL '24 HOURS'"
124
- );
125
- const expectedRevenue = parseFloat(dbRevenue.rows[0].revenue);
126
-
127
- const esResult = await esClient.search({
128
- index: 'orders-*',
129
- body: {
130
- query: {
131
- bool: {
132
- must: [
133
- { term: { status: 'COMPLETED' } },
134
- { range: { created_at: { gte: 'now-24h' } } }
135
- ]
136
- }
137
- },
138
- aggs: {
139
- total_revenue: { sum: { field: 'total' } }
140
- },
141
- size: 0
142
- }
143
- });
144
- const dashboardRevenue = esResult.aggregations.total_revenue.value;
145
-
146
- // Allow small floating point tolerance
147
- expect(Math.abs(dashboardRevenue - expectedRevenue)).toBeLessThan(0.01);
148
- });
149
-
150
- it('error rate percentage is calculated correctly', async () => {
151
- const esResult = await esClient.search({
152
- index: 'logs-*',
153
- body: {
154
- query: { range: { '@timestamp': { gte: 'now-1h' } } },
155
- aggs: {
156
- total: { value_count: { field: 'status_code' } },
157
- errors: {
158
- filter: { range: { status_code: { gte: 500 } } },
159
- aggs: { count: { value_count: { field: 'status_code' } } }
160
- }
161
- },
162
- size: 0
163
- }
164
- });
165
-
166
- const total = esResult.aggregations.total.value;
167
- const errors = esResult.aggregations.errors.count.value;
168
- const expectedErrorRate = (errors / total) * 100;
169
-
170
- // Fetch what the dashboard shows via Kibana API
171
- const dashboardPanel = await kibanaApi.get('/api/saved_objects/visualization/error-rate-gauge');
172
- const displayedErrorRate = await evaluateKibanaVisualization(dashboardPanel);
173
-
174
- expect(Math.abs(displayedErrorRate - expectedErrorRate)).toBeLessThan(0.1);
175
- });
176
- });
177
- ```
178
-
179
- ---
180
-
181
- ## Elasticsearch Query Result Validation
182
-
183
- ```javascript
184
- describe('Elasticsearch Query Validation', () => {
185
- it('validates date histogram aggregation returns correct buckets', async () => {
186
- // Insert known test data
187
- const testDocs = [];
188
- for (let hour = 0; hour < 24; hour++) {
189
- const timestamp = new Date();
190
- timestamp.setHours(hour, 0, 0, 0);
191
- testDocs.push({
192
- '@timestamp': timestamp.toISOString(),
193
- service: 'order-api',
194
- status_code: hour % 5 === 0 ? 500 : 200,
195
- response_time: 100 + (hour * 10)
196
- });
197
- }
198
-
199
- await esClient.bulk({
200
- index: 'test-logs',
201
- body: testDocs.flatMap(doc => [{ index: {} }, doc])
202
- });
203
- await esClient.indices.refresh({ index: 'test-logs' });
204
-
205
- // Run the same query the dashboard uses
206
- const result = await esClient.search({
207
- index: 'test-logs',
208
- body: {
209
- query: { match_all: {} },
210
- aggs: {
211
- requests_over_time: {
212
- date_histogram: { field: '@timestamp', fixed_interval: '1h' },
213
- aggs: {
214
- avg_response: { avg: { field: 'response_time' } },
215
- error_count: {
216
- filter: { range: { status_code: { gte: 500 } } }
217
- }
218
- }
219
- }
220
- },
221
- size: 0
222
- }
223
- });
224
-
225
- const buckets = result.aggregations.requests_over_time.buckets;
226
- expect(buckets.length).toBe(24);
227
-
228
- // Verify specific bucket values
229
- const errorBuckets = buckets.filter(b => b.error_count.doc_count > 0);
230
- expect(errorBuckets.length).toBe(5); // Hours 0, 5, 10, 15, 20
231
- });
232
-
233
- it('validates term aggregation for top services', async () => {
234
- const result = await esClient.search({
235
- index: 'logs-*',
236
- body: {
237
- query: { range: { '@timestamp': { gte: 'now-1h' } } },
238
- aggs: {
239
- top_services: {
240
- terms: { field: 'service.keyword', size: 10 }
241
- }
242
- },
243
- size: 0
244
- }
245
- });
246
-
247
- const services = result.aggregations.top_services.buckets;
248
- expect(services.length).toBeGreaterThan(0);
249
-
250
- // Each bucket should have reasonable doc counts
251
- for (const bucket of services) {
252
- expect(bucket.key).toBeDefined();
253
- expect(bucket.doc_count).toBeGreaterThan(0);
254
- }
255
- });
256
- });
257
- ```
258
-
259
- ---
260
-
261
- ## Kibana Dashboard Element Assertions
262
-
263
- ```javascript
264
- describe('Kibana Dashboard Visual Validation', () => {
265
- it('validates dashboard panels render without errors', async () => {
266
- await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
267
-
268
- // Wait for all panels to finish loading
269
- await page.waitForSelector('.embPanel__content', { state: 'visible' });
270
- await page.waitForFunction(() => {
271
- const loaders = document.querySelectorAll('.euiLoadingSpinner');
272
- return loaders.length === 0;
273
- }, { timeout: 30000 });
274
-
275
- // Check no error icons on any panel
276
- const errorPanels = await page.locator('.embPanel--error').count();
277
- expect(errorPanels).toBe(0);
278
-
279
- // Check no "No results found" where data is expected
280
- const noResultPanels = await page.locator('text="No results found"').count();
281
- expect(noResultPanels).toBe(0);
282
- });
283
-
284
- it('validates metric visualization shows correct value', async () => {
285
- await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
286
- await page.waitForLoadState('networkidle');
287
-
288
- // Get the displayed metric value
289
- const metricValue = await page.locator('[data-test-subj="metricVis-total-orders"] .mtrVis__value').textContent();
290
- const displayedCount = parseInt(metricValue.replace(/,/g, ''));
291
-
292
- // Compare with direct ES query
293
- const esResult = await esClient.count({ index: 'orders-*' });
294
-
295
- expect(displayedCount).toBe(esResult.count);
296
- });
297
-
298
- it('validates table visualization columns and sorting', async () => {
299
- await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
300
- await page.waitForLoadState('networkidle');
301
-
302
- // Verify expected columns exist
303
- const headers = await page.locator('.euiTable th').allTextContents();
304
- expect(headers).toContain('Service');
305
- expect(headers).toContain('Error Rate');
306
- expect(headers).toContain('P95 Latency');
307
-
308
- // Verify sorting works
309
- await page.click('th:has-text("Error Rate")');
310
- const firstRow = await page.locator('.euiTable tbody tr:first-child td').allTextContents();
311
- const secondRow = await page.locator('.euiTable tbody tr:nth-child(2) td').allTextContents();
312
-
313
- const firstErrorRate = parseFloat(firstRow[1]);
314
- const secondErrorRate = parseFloat(secondRow[1]);
315
- expect(firstErrorRate).toBeGreaterThanOrEqual(secondErrorRate);
316
- });
317
- });
318
- ```
319
-
320
- ---
321
-
322
- ## Alert Rule Testing
323
-
324
- ```javascript
325
- describe('Alert Rule Validation', () => {
326
- it('fires alert when error rate exceeds threshold', async () => {
327
- // Generate errors to exceed the 5% threshold
328
- const requests = [];
329
- for (let i = 0; i < 100; i++) {
330
- requests.push({
331
- '@timestamp': new Date().toISOString(),
332
- service: 'payment-api',
333
- status_code: i < 10 ? 500 : 200, // 10% error rate > 5% threshold
334
- response_time: 200
335
- });
336
- }
337
-
338
- await esClient.bulk({
339
- index: 'logs-payment',
340
- body: requests.flatMap(doc => [{ index: {} }, doc])
341
- });
342
- await esClient.indices.refresh({ index: 'logs-payment' });
343
-
344
- // Wait for alert evaluation cycle (typically 1 minute)
345
- await sleep(90000);
346
-
347
- // Check alert was fired
348
- const alerts = await alertManager.getActiveAlerts({
349
- filter: 'alertname="HighErrorRate" AND service="payment-api"'
350
- });
351
- expect(alerts.length).toBeGreaterThan(0);
352
- expect(alerts[0].labels.severity).toBe('critical');
353
- });
354
-
355
- it('alert auto-resolves when condition clears', async () => {
356
- // First trigger the alert
357
- await injectErrors('payment-api', { count: 50, total: 100 });
358
- await sleep(90000);
359
-
360
- let alerts = await alertManager.getActiveAlerts({ filter: 'alertname="HighErrorRate"' });
361
- expect(alerts.length).toBeGreaterThan(0);
362
-
363
- // Now inject healthy traffic to bring error rate below threshold
364
- await injectSuccessRequests('payment-api', { count: 1000 });
365
- await sleep(90000);
366
-
367
- // Alert should auto-resolve
368
- alerts = await alertManager.getActiveAlerts({ filter: 'alertname="HighErrorRate"' });
369
- expect(alerts.length).toBe(0);
370
- });
371
-
372
- it('alert notification reaches correct channel', async () => {
373
- // Subscribe to notification channel
374
- const notifications = [];
375
- const subscription = pagerDutyMock.onIncident((incident) => {
376
- notifications.push(incident);
377
- });
378
-
379
- // Trigger alert condition
380
- await injectErrors('critical-service', { count: 50, total: 100 });
381
- await sleep(120000);
382
-
383
- expect(notifications.length).toBeGreaterThan(0);
384
- expect(notifications[0].service.name).toBe('critical-service');
385
- expect(notifications[0].urgency).toBe('high');
386
-
387
- subscription.unsubscribe();
388
- });
389
-
390
- it('alert does not fire for brief transient spikes', async () => {
391
- // Inject a brief 30-second spike (alert requires 5 minutes sustained)
392
- await injectErrors('api-service', { count: 20, total: 50, duration: 30000 });
393
- await sleep(120000);
394
-
395
- const alerts = await alertManager.getActiveAlerts({ filter: 'alertname="HighErrorRate"' });
396
- expect(alerts.length).toBe(0); // Should NOT fire for transient spike
397
- });
398
- });
399
- ```
400
-
401
- ---
402
-
403
- ## Log Aggregation Completeness
404
-
405
- ```javascript
406
- describe('Log Aggregation Completeness', () => {
407
- it('all microservice logs appear in centralized index', async () => {
408
- const traceId = uuid();
409
- const services = ['api-gateway', 'auth-service', 'order-service', 'payment-service', 'notification-service'];
410
-
411
- // Generate a log entry with known traceId in each service
412
- for (const service of services) {
413
- await serviceLogEmitter.emit(service, {
414
- level: 'INFO',
415
- message: `Completeness test - ${traceId}`,
416
- traceId,
417
- timestamp: new Date().toISOString()
418
- });
419
- }
420
-
421
- // Wait for log pipeline to process (Filebeat -> Logstash -> Elasticsearch)
422
- await sleep(15000);
423
-
424
- // Query Elasticsearch for the trace ID
425
- const result = await esClient.search({
426
- index: 'logs-*',
427
- body: {
428
- query: { term: { 'traceId.keyword': traceId } },
429
- size: 100
430
- }
431
- });
432
-
433
- const foundServices = result.hits.hits.map(h => h._source.service);
434
-
435
- // All services should have their log entry in Elasticsearch
436
- for (const service of services) {
437
- expect(foundServices).toContain(service);
438
- }
439
- expect(foundServices.length).toBe(services.length);
440
- });
441
-
442
- it('logs retain correct structure after pipeline processing', async () => {
443
- const testLog = {
444
- level: 'ERROR',
445
- message: 'Payment declined',
446
- traceId: uuid(),
447
- userId: 'user-123',
448
- orderId: 'order-456',
449
- errorCode: 'INSUFFICIENT_FUNDS',
450
- timestamp: new Date().toISOString()
451
- };
452
-
453
- await serviceLogEmitter.emit('payment-service', testLog);
454
- await sleep(10000);
455
-
456
- const result = await esClient.search({
457
- index: 'logs-*',
458
- body: { query: { term: { 'traceId.keyword': testLog.traceId } } }
459
- });
460
-
461
- expect(result.hits.hits.length).toBe(1);
462
- const indexed = result.hits.hits[0]._source;
463
-
464
- // Verify all fields survived the pipeline
465
- expect(indexed.level).toBe('ERROR');
466
- expect(indexed.message).toBe('Payment declined');
467
- expect(indexed.userId).toBe('user-123');
468
- expect(indexed.orderId).toBe('order-456');
469
- expect(indexed.errorCode).toBe('INSUFFICIENT_FUNDS');
470
- });
471
-
472
- it('detects log volume drops indicating pipeline issues', async () => {
473
- // Get baseline log volume for the past hour
474
- const baseline = await esClient.count({
475
- index: 'logs-*',
476
- body: { query: { range: { '@timestamp': { gte: 'now-2h', lt: 'now-1h' } } } }
477
- });
478
-
479
- const current = await esClient.count({
480
- index: 'logs-*',
481
- body: { query: { range: { '@timestamp': { gte: 'now-1h' } } } }
482
- });
483
-
484
- // Current volume should be at least 50% of baseline (not a sudden drop)
485
- const ratio = current.count / baseline.count;
486
- expect(ratio).toBeGreaterThan(0.5);
487
- });
488
- });
489
- ```
490
-
491
- ---
492
-
493
- ## APM Trace Validation
494
-
495
- ```javascript
496
- describe('Distributed Trace Validation', () => {
497
- it('captures complete trace across all services', async () => {
498
- // Make a request that traverses multiple services
499
- const response = await httpClient.post('/api/orders', {
500
- customerId: 'CUST-TRACE',
501
- items: [{ sku: 'ITEM-1', qty: 1 }]
502
- });
503
-
504
- const traceId = response.headers['x-trace-id'];
505
- expect(traceId).toBeDefined();
506
-
507
- // Wait for trace to be indexed
508
- await sleep(10000);
509
-
510
- // Query Jaeger/APM for the trace
511
- const trace = await jaegerClient.getTrace(traceId);
512
-
513
- // Verify all expected spans exist
514
- const spanNames = trace.spans.map(s => s.operationName);
515
- expect(spanNames).toContain('POST /api/orders');
516
- expect(spanNames).toContain('auth.validateToken');
517
- expect(spanNames).toContain('order.create');
518
- expect(spanNames).toContain('payment.authorize');
519
- expect(spanNames).toContain('inventory.reserve');
520
- expect(spanNames).toContain('db.insert orders');
521
-
522
- // Verify parent-child relationships
523
- const apiSpan = trace.spans.find(s => s.operationName === 'POST /api/orders');
524
- const authSpan = trace.spans.find(s => s.operationName === 'auth.validateToken');
525
- expect(authSpan.references[0].refType).toBe('CHILD_OF');
526
- expect(authSpan.references[0].spanID).toBe(apiSpan.spanID);
527
- });
528
-
529
- it('traces capture error spans correctly', async () => {
530
- // Trigger a known error
531
- const response = await httpClient.post('/api/orders', {
532
- customerId: 'INVALID-CUSTOMER',
533
- items: [{ sku: 'ITEM-1', qty: 1 }]
534
- });
535
-
536
- const traceId = response.headers['x-trace-id'];
537
- await sleep(10000);
538
-
539
- const trace = await jaegerClient.getTrace(traceId);
540
-
541
- // Find error span
542
- const errorSpan = trace.spans.find(s => s.tags.some(t => t.key === 'error' && t.value === true));
543
- expect(errorSpan).toBeDefined();
544
- expect(errorSpan.logs).toContainEqual(
545
- expect.objectContaining({
546
- fields: expect.arrayContaining([
547
- expect.objectContaining({ key: 'error.message' })
548
- ])
549
- })
550
- );
551
- });
552
-
553
- it('validates trace sampling rate', async () => {
554
- const requestCount = 100;
555
- const traceIds = [];
556
-
557
- for (let i = 0; i < requestCount; i++) {
558
- const resp = await httpClient.get('/api/health');
559
- if (resp.headers['x-trace-id']) {
560
- traceIds.push(resp.headers['x-trace-id']);
561
- }
562
- }
563
-
564
- await sleep(15000);
565
-
566
- let tracesFound = 0;
567
- for (const traceId of traceIds) {
568
- try {
569
- await jaegerClient.getTrace(traceId);
570
- tracesFound++;
571
- } catch (e) {
572
- // Trace not sampled
573
- }
574
- }
575
-
576
- // With 10% sampling rate, expect roughly 10 traces (allow variance)
577
- const samplingRate = tracesFound / requestCount;
578
- expect(samplingRate).toBeGreaterThan(0.05);
579
- expect(samplingRate).toBeLessThan(0.20);
580
- });
581
- });
582
- ```
583
-
584
- ---
585
-
586
- ## SLA/SLO Validation
587
-
588
- ```javascript
589
- describe('SLA/SLO Compliance Validation', () => {
590
- it('validates 99.9% availability SLO over 30 days', async () => {
591
- const result = await prometheusClient.query(
592
- 'avg_over_time(up{job="api-service"}[30d])'
593
- );
594
- const availability = parseFloat(result.data.result[0].value[1]) * 100;
595
-
596
- expect(availability).toBeGreaterThanOrEqual(99.9);
597
-
598
- // Calculate error budget remaining
599
- const totalMinutes = 30 * 24 * 60;
600
- const allowedDowntime = totalMinutes * 0.001; // 43.2 minutes
601
- const actualDowntime = totalMinutes * (1 - availability / 100);
602
- const errorBudgetRemaining = ((allowedDowntime - actualDowntime) / allowedDowntime) * 100;
603
-
604
- expect(errorBudgetRemaining).toBeGreaterThan(0);
605
- console.log(`Error budget remaining: ${errorBudgetRemaining.toFixed(1)}%`);
606
- });
607
-
608
- it('validates P95 latency SLO', async () => {
609
- const result = await prometheusClient.query(
610
- 'histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{service="api-service"}[24h])) by (le))'
611
- );
612
- const p95Latency = parseFloat(result.data.result[0].value[1]) * 1000; // Convert to ms
613
-
614
- expect(p95Latency).toBeLessThan(500); // SLO: P95 < 500ms
615
- });
616
-
617
- it('runs synthetic monitoring check for uptime', async () => {
618
- const endpoints = [
619
- { url: '/api/health', expectedStatus: 200, maxLatency: 200 },
620
- { url: '/api/orders', expectedStatus: 401, maxLatency: 300 }, // Auth required
621
- { url: '/api/products', expectedStatus: 200, maxLatency: 500 }
622
- ];
623
-
624
- const results = [];
625
- for (const endpoint of endpoints) {
626
- const start = Date.now();
627
- const response = await httpClient.get(endpoint.url);
628
- const latency = Date.now() - start;
629
-
630
- results.push({
631
- url: endpoint.url,
632
- status: response.status,
633
- latency,
634
- statusMatch: response.status === endpoint.expectedStatus,
635
- latencyOk: latency <= endpoint.maxLatency
636
- });
637
- }
638
-
639
- // All checks should pass
640
- for (const result of results) {
641
- expect(result.statusMatch).toBe(true);
642
- expect(result.latencyOk).toBe(true);
643
- }
644
- });
645
- });
646
- ```
647
-
648
- ---
649
-
650
- ## Metric Pipeline Integrity
651
-
652
- ```javascript
653
- describe('Metric Pipeline - Collection to Display', () => {
654
- it('validates custom metric flows from app to Prometheus to Grafana', async () => {
655
- // Step 1: Emit a known custom metric from application
656
- const metricName = 'test_orders_processed_total';
657
- const expectedValue = 42;
658
- await appMetrics.set(metricName, expectedValue, { service: 'test' });
659
-
660
- // Step 2: Wait for scrape interval (15s default)
661
- await sleep(20000);
662
-
663
- // Step 3: Query Prometheus directly
664
- const promResult = await prometheusClient.query(`${metricName}{service="test"}`);
665
- const promValue = parseFloat(promResult.data.result[0].value[1]);
666
- expect(promValue).toBe(expectedValue);
667
-
668
- // Step 4: Query Grafana datasource API (same as dashboard would)
669
- const grafanaResult = await grafanaApi.post('/api/ds/query', {
670
- queries: [{
671
- datasource: { type: 'prometheus' },
672
- expr: `${metricName}{service="test"}`,
673
- refId: 'A'
674
- }]
675
- });
676
-
677
- const grafanaValue = parseFloat(grafanaResult.body.results.A.frames[0].data.values[1][0]);
678
- expect(grafanaValue).toBe(expectedValue);
679
- });
680
-
681
- it('validates histogram metric percentile accuracy', async () => {
682
- // Generate known latency distribution
683
- const latencies = [10, 20, 30, 50, 100, 200, 300, 500, 1000, 2000]; // ms
684
- for (const latency of latencies) {
685
- await appMetrics.observe('http_request_duration_ms', latency, { endpoint: '/test' });
686
- }
687
-
688
- await sleep(20000);
689
-
690
- // Verify P50 and P99
691
- const p50 = await prometheusClient.query(
692
- 'histogram_quantile(0.5, rate(http_request_duration_ms_bucket{endpoint="/test"}[5m]))'
693
- );
694
- const p99 = await prometheusClient.query(
695
- 'histogram_quantile(0.99, rate(http_request_duration_ms_bucket{endpoint="/test"}[5m]))'
696
- );
697
-
698
- const p50Value = parseFloat(p50.data.result[0].value[1]);
699
- const p99Value = parseFloat(p99.data.result[0].value[1]);
700
-
701
- // P50 should be around 100ms (median of our distribution)
702
- expect(p50Value).toBeGreaterThan(50);
703
- expect(p50Value).toBeLessThan(300);
704
-
705
- // P99 should be around 2000ms
706
- expect(p99Value).toBeGreaterThan(1000);
707
- });
708
- });
709
- ```
710
-
711
- ---
712
-
713
- ## Dashboard Performance Testing
714
-
715
- ```javascript
716
- describe('Dashboard Performance', () => {
717
- it('dashboard loads within acceptable time', async () => {
718
- const start = Date.now();
719
-
720
- await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
721
-
722
- // Wait for all panels to finish loading
723
- await page.waitForFunction(() => {
724
- const spinners = document.querySelectorAll('.euiLoadingSpinner');
725
- return spinners.length === 0;
726
- }, { timeout: 30000 });
727
-
728
- const loadTime = Date.now() - start;
729
-
730
- expect(loadTime).toBeLessThan(10000); // Dashboard should load in under 10s
731
- });
732
-
733
- it('dashboard handles large time range without timeout', async () => {
734
- // Set time range to 30 days
735
- await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview?_g=(time:(from:now-30d,to:now))`);
736
-
737
- // Should complete without timeout error
738
- await page.waitForFunction(() => {
739
- const errors = document.querySelectorAll('.embPanel--error');
740
- const spinners = document.querySelectorAll('.euiLoadingSpinner');
741
- return errors.length === 0 && spinners.length === 0;
742
- }, { timeout: 60000 });
743
-
744
- const errorPanels = await page.locator('.embPanel--error').count();
745
- expect(errorPanels).toBe(0);
746
- });
747
-
748
- it('Elasticsearch query performance is within bounds', async () => {
749
- const queries = [
750
- { name: 'date_histogram', body: { aggs: { over_time: { date_histogram: { field: '@timestamp', fixed_interval: '1h' } } }, size: 0 } },
751
- { name: 'terms_agg', body: { aggs: { top_services: { terms: { field: 'service.keyword', size: 20 } } }, size: 0 } },
752
- { name: 'percentiles', body: { aggs: { latency: { percentiles: { field: 'response_time', percents: [50, 90, 95, 99] } } }, size: 0 } }
753
- ];
754
-
755
- for (const query of queries) {
756
- const start = Date.now();
757
- await esClient.search({ index: 'logs-*', body: { query: { range: { '@timestamp': { gte: 'now-24h' } } }, ...query.body } });
758
- const elapsed = Date.now() - start;
759
-
760
- expect(elapsed).toBeLessThan(5000); // Each query under 5s
761
- }
762
- });
763
- });
764
- ```
765
-
766
- ---
767
-
768
- ## Time-Series Data Accuracy
769
-
770
- ```javascript
771
- describe('Time-Series Data Accuracy', () => {
772
- it('validates no data gaps in time-series metrics', async () => {
773
- const result = await prometheusClient.queryRange(
774
- 'up{job="api-service"}',
775
- { start: 'now-24h', end: 'now', step: '5m' }
776
- );
777
-
778
- const values = result.data.result[0].values;
779
- const expectedPoints = (24 * 60) / 5; // 288 data points for 24h at 5m intervals
780
-
781
- // Allow up to 5% missing data points
782
- expect(values.length).toBeGreaterThan(expectedPoints * 0.95);
783
-
784
- // Check for gaps longer than 15 minutes (3 consecutive missing points)
785
- for (let i = 1; i < values.length; i++) {
786
- const gap = values[i][0] - values[i - 1][0]; // timestamp difference
787
- expect(gap).toBeLessThanOrEqual(900); // No gap > 15 minutes
788
- }
789
- });
790
-
791
- it('validates timestamp alignment across sources', async () => {
792
- // Generate event with precise timestamp
793
- const eventTime = new Date();
794
- const traceId = uuid();
795
-
796
- await httpClient.post('/api/test-event', { traceId });
797
- await sleep(15000);
798
-
799
- // Check timestamp in logs
800
- const logResult = await esClient.search({
801
- index: 'logs-*',
802
- body: { query: { term: { 'traceId.keyword': traceId } } }
803
- });
804
- const logTimestamp = new Date(logResult.hits.hits[0]._source['@timestamp']);
805
-
806
- // Check timestamp in metrics (approximate)
807
- // Timestamps should be within 5 seconds of each other
808
- const diff = Math.abs(logTimestamp.getTime() - eventTime.getTime());
809
- expect(diff).toBeLessThan(5000);
810
- });
811
- });
812
- ```
813
-
814
- ---
815
-
816
- ## Best Practices
817
-
818
- ### Do This
819
- - Compare dashboard values against source-of-truth databases
820
- - Test alert thresholds with known data to verify exact firing conditions
821
- - Validate log completeness by injecting traceable test events
822
- - Test alert recovery (auto-resolve) not just alert firing
823
- - Monitor log volume as a proxy for pipeline health
824
- - Validate sampling rates for APM traces
825
- - Test dashboards at realistic time ranges (not just last 15 minutes)
826
-
827
- ### Avoid This
828
- - Trusting dashboard numbers without source validation
829
- - Testing alerts only with manual threshold checks in the UI
830
- - Ignoring log pipeline latency (logs may take seconds to minutes to appear)
831
- - Skipping alert fatigue testing (too many false positives)
832
- - Assuming metrics are accurate without end-to-end pipeline validation
833
- - Testing only with small data volumes (performance issues appear at scale)
834
- - Forgetting to test alert notification delivery (PagerDuty, Slack, email)
835
-
836
- ---
837
-
838
- ## Agent-Assisted Observability Testing
839
-
840
- ```typescript
841
- // Data accuracy validation
842
- await Task("Dashboard Data Accuracy Validation", {
843
- dashboard: 'operations-overview',
844
- panels: ['order-count', 'revenue-total', 'error-rate'],
845
- sourceDatabase: 'orders-db',
846
- compareFields: ['count', 'sum(total)', 'error_percentage'],
847
- tolerance: 0.01
848
- }, "qe-integration-tester");
849
-
850
- // Dashboard performance testing
851
- await Task("Dashboard Performance Benchmark", {
852
- dashboardUrl: 'http://kibana:5601/app/dashboards#/view/operations-overview',
853
- timeRanges: ['15m', '1h', '24h', '7d', '30d'],
854
- maxLoadTime: 10000,
855
- maxQueryTime: 5000,
856
- captureScreenshots: true
857
- }, "qe-performance-tester");
858
-
859
- // Dashboard visual regression
860
- await Task("Dashboard Visual Regression", {
861
- dashboardUrl: 'http://kibana:5601/app/dashboards#/view/operations-overview',
862
- baselineScreenshots: 'baseline/dashboards/',
863
- threshold: 0.05,
864
- ignoreRegions: ['timestamp-header', 'dynamic-counters']
865
- }, "qe-visual-tester");
866
-
867
- // Alert rule validation
868
- await Task("Alert Rule Comprehensive Test", {
869
- alertRules: ['HighErrorRate', 'HighLatency', 'ServiceDown'],
870
- testFiring: true,
871
- testRecovery: true,
872
- testNotificationChannel: true,
873
- validateSilencing: true
874
- }, "qe-integration-tester");
875
- ```
876
-
877
- ---
878
-
879
- ## Agent Coordination Hints
880
-
881
- ### Memory Namespace
882
- ```
883
- aqe/observability-testing/
884
- dashboards/ - Dashboard test results and screenshots
885
- alerts/ - Alert rule test outcomes
886
- logs/ - Log completeness validation results
887
- traces/ - APM trace validation results
888
- slo/ - SLA/SLO compliance metrics
889
- pipelines/ - Metric pipeline integrity checks
890
- performance/ - Dashboard and query performance benchmarks
891
- ```
892
-
893
- ### Fleet Coordination
894
- ```typescript
895
- const observabilityFleet = await FleetManager.coordinate({
896
- strategy: 'observability-testing',
897
- agents: [
898
- 'qe-integration-tester', // Data accuracy, log completeness, alert rules
899
- 'qe-performance-tester', // Dashboard load time, query latency
900
- 'qe-visual-tester' // Dashboard visual regression
901
- ],
902
- topology: 'mesh'
903
- });
904
-
905
- await observabilityFleet.execute({
906
- targets: [
907
- { type: 'dashboard', id: 'operations-overview', checks: ['accuracy', 'performance', 'visual'] },
908
- { type: 'alerts', rules: ['HighErrorRate', 'HighLatency'], checks: ['fire', 'resolve', 'notify'] },
909
- { type: 'logs', services: ['api', 'auth', 'payment'], checks: ['completeness', 'structure'] },
910
- { type: 'traces', endpoints: ['/api/orders'], checks: ['spans', 'errors', 'sampling'] }
911
- ]
912
- });
913
- ```
914
-
915
- ---
916
-
917
- ## Related Skills
918
- - [api-testing-patterns](../api-testing-patterns/) - API testing for services feeding observability
919
- - [shift-right-testing](../shift-right-testing/) - Production monitoring and observability
920
- - [performance-testing](../performance-testing/) - Performance baselines and SLO definition
921
- - [chaos-engineering-resilience](../chaos-engineering-resilience/) - Fault injection to validate alerting
922
- - [visual-testing-advanced](../visual-testing-advanced/) - Dashboard visual regression
923
-
924
- ---
925
-
926
- ## Remember
927
-
928
- Observability testing is about proving that your monitoring tells the truth. A dashboard that shows green when the system is on fire is worse than no dashboard at all. Validate data accuracy by comparing against source databases, test alert thresholds with controlled data injection, and verify log completeness by tracing known events through the entire pipeline.
929
-
930
- **With Agents:** Agents automate the tedious comparison of dashboard values against source databases, systematically test alert thresholds with synthetic load, and validate log pipeline completeness across all services. Use agents to continuously verify that your observability stack is trustworthy.
1
+ ---
2
+ name: observability-testing-patterns
3
+ description: "Observability and monitoring validation patterns for dashboards, alerting, log aggregation, APM traces, and SLA/SLO verification. Use when testing monitoring infrastructure, dashboard accuracy, alert rules, or metric pipelines."
4
+ category: specialized-testing
5
+ priority: high
6
+ tokenEstimate: 1600
7
+ agents: [qe-integration-tester, qe-performance-tester, qe-visual-tester]
8
+ implementation_status: optimized
9
+ optimization_version: 1.0
10
+ last_optimized: 2026-02-04
11
+ dependencies: [api-testing-patterns, shift-right-testing]
12
+ quick_reference_card: true
13
+ tags: [observability, monitoring, kibana, elasticsearch, dashboards, alerting, metrics, logging]
14
+ trust_tier: 3
15
+ validation:
16
+ schema_path: schemas/output.json
17
+ validator_path: scripts/validate-config.json
18
+ eval_path: evals/observability-testing-patterns.yaml
19
+ ---
20
+
21
+ # Observability Testing Patterns
22
+
23
+ <default_to_action>
24
+ When testing observability infrastructure, dashboards, or monitoring:
25
+ 1. VALIDATE data accuracy (source data matches what the dashboard displays)
26
+ 2. TEST alert rules fire correctly at defined thresholds
27
+ 3. VERIFY log aggregation completeness (no missing logs across services)
28
+ 4. TRACE distributed requests end-to-end through APM
29
+ 5. MEASURE dashboard performance (render time, query latency)
30
+ 6. CONFIRM SLA/SLO compliance through synthetic monitoring
31
+ 7. TEST metric pipeline integrity from collection to display
32
+
33
+ **Quick Pattern Selection:**
34
+ - Dashboard shows wrong numbers -> Data accuracy validation
35
+ - Alerts not firing -> Alert rule threshold testing
36
+ - Missing logs in Kibana -> Log aggregation completeness
37
+ - Slow dashboard -> Dashboard performance testing
38
+ - Broken traces -> APM trace validation
39
+ - SLA disputes -> SLO compliance validation
40
+
41
+ **Critical Success Factors:**
42
+ - Observability is only as good as the data it shows
43
+ - A dashboard that lies is worse than no dashboard
44
+ - Alert fatigue kills response times; test thresholds carefully
45
+ </default_to_action>
46
+
47
+ ## Quick Reference Card
48
+
49
+ ### When to Use
50
+ - Validating dashboard data accuracy (Kibana, Grafana, Datadog)
51
+ - Testing alert rule thresholds and notification delivery
52
+ - Verifying log aggregation completeness across microservices
53
+ - Validating distributed tracing (APM) correctness
54
+ - Measuring SLA/SLO compliance
55
+ - Testing metric pipeline integrity (collection -> aggregation -> display)
56
+
57
+ ### Testing Levels
58
+ | Level | Purpose | Dependencies | Speed |
59
+ |-------|---------|--------------|-------|
60
+ | Query Validation | Elasticsearch/PromQL query accuracy | Data source | Fast |
61
+ | Dashboard Accuracy | Visual matches source data | Full stack | Medium |
62
+ | Alert Threshold | Trigger and notification testing | Alerting stack | Medium |
63
+ | Pipeline Integrity | End-to-end metric flow | Full pipeline | Slower |
64
+ | Performance | Dashboard render time, query latency | Full stack | Slower |
65
+
66
+ ### Critical Test Scenarios
67
+ | Scenario | Must Test | Example |
68
+ |----------|----------|---------|
69
+ | Data Accuracy | Dashboard = source truth | Order count on dashboard = DB count |
70
+ | Alert Firing | Threshold triggers alert | Error rate > 5% fires PagerDuty |
71
+ | Alert Recovery | Auto-resolve when recovered | Error rate drops below 5% clears alert |
72
+ | Log Completeness | All services emit logs | 10 microservices, all logs in Kibana |
73
+ | Trace Integrity | Full request path visible | Auth -> API -> DB -> Cache spans |
74
+ | SLO Compliance | Error budget tracking | 99.9% availability over 30 days |
75
+ | Time Accuracy | Timestamps aligned | Log timestamp matches event time |
76
+
77
+ ### Tools
78
+ - **Dashboards**: Kibana, Grafana, Datadog, New Relic
79
+ - **Search**: Elasticsearch, OpenSearch, Loki
80
+ - **Metrics**: Prometheus, InfluxDB, CloudWatch
81
+ - **Tracing**: Jaeger, Zipkin, Datadog APM, OpenTelemetry
82
+ - **Alerting**: PagerDuty, OpsGenie, Alertmanager
83
+ - **Synthetic**: Datadog Synthetics, Checkly, Playwright
84
+
85
+ ### Agent Coordination
86
+ - `qe-integration-tester`: Validate data pipelines, query accuracy, log completeness
87
+ - `qe-performance-tester`: Dashboard render performance, query latency
88
+ - `qe-visual-tester`: Dashboard visual regression, layout accuracy
89
+
90
+ ---
91
+
92
+ ## Dashboard Data Accuracy Validation
93
+
94
+ ### Compare Source Data to Dashboard
95
+ ```javascript
96
+ describe('Dashboard Data Accuracy', () => {
97
+ it('order count on dashboard matches database', async () => {
98
+ // Step 1: Get ground truth from source database
99
+ const dbResult = await db.query(
100
+ "SELECT COUNT(*) as count FROM orders WHERE created_at >= NOW() - INTERVAL '24 HOURS'"
101
+ );
102
+ const dbCount = parseInt(dbResult.rows[0].count);
103
+
104
+ // Step 2: Query Elasticsearch (same data source as dashboard)
105
+ const esResult = await esClient.search({
106
+ index: 'orders-*',
107
+ body: {
108
+ query: {
109
+ range: { created_at: { gte: 'now-24h' } }
110
+ },
111
+ size: 0,
112
+ track_total_hits: true
113
+ }
114
+ });
115
+ const esCount = esResult.hits.total.value;
116
+
117
+ // Step 3: Compare
118
+ expect(esCount).toBe(dbCount);
119
+ });
120
+
121
+ it('revenue metric on dashboard matches transaction totals', async () => {
122
+ const dbRevenue = await db.query(
123
+ "SELECT SUM(total) as revenue FROM orders WHERE status = 'COMPLETED' AND created_at >= NOW() - INTERVAL '24 HOURS'"
124
+ );
125
+ const expectedRevenue = parseFloat(dbRevenue.rows[0].revenue);
126
+
127
+ const esResult = await esClient.search({
128
+ index: 'orders-*',
129
+ body: {
130
+ query: {
131
+ bool: {
132
+ must: [
133
+ { term: { status: 'COMPLETED' } },
134
+ { range: { created_at: { gte: 'now-24h' } } }
135
+ ]
136
+ }
137
+ },
138
+ aggs: {
139
+ total_revenue: { sum: { field: 'total' } }
140
+ },
141
+ size: 0
142
+ }
143
+ });
144
+ const dashboardRevenue = esResult.aggregations.total_revenue.value;
145
+
146
+ // Allow small floating point tolerance
147
+ expect(Math.abs(dashboardRevenue - expectedRevenue)).toBeLessThan(0.01);
148
+ });
149
+
150
+ it('error rate percentage is calculated correctly', async () => {
151
+ const esResult = await esClient.search({
152
+ index: 'logs-*',
153
+ body: {
154
+ query: { range: { '@timestamp': { gte: 'now-1h' } } },
155
+ aggs: {
156
+ total: { value_count: { field: 'status_code' } },
157
+ errors: {
158
+ filter: { range: { status_code: { gte: 500 } } },
159
+ aggs: { count: { value_count: { field: 'status_code' } } }
160
+ }
161
+ },
162
+ size: 0
163
+ }
164
+ });
165
+
166
+ const total = esResult.aggregations.total.value;
167
+ const errors = esResult.aggregations.errors.count.value;
168
+ const expectedErrorRate = (errors / total) * 100;
169
+
170
+ // Fetch what the dashboard shows via Kibana API
171
+ const dashboardPanel = await kibanaApi.get('/api/saved_objects/visualization/error-rate-gauge');
172
+ const displayedErrorRate = await evaluateKibanaVisualization(dashboardPanel);
173
+
174
+ expect(Math.abs(displayedErrorRate - expectedErrorRate)).toBeLessThan(0.1);
175
+ });
176
+ });
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Elasticsearch Query Result Validation
182
+
183
+ ```javascript
184
+ describe('Elasticsearch Query Validation', () => {
185
+ it('validates date histogram aggregation returns correct buckets', async () => {
186
+ // Insert known test data
187
+ const testDocs = [];
188
+ for (let hour = 0; hour < 24; hour++) {
189
+ const timestamp = new Date();
190
+ timestamp.setHours(hour, 0, 0, 0);
191
+ testDocs.push({
192
+ '@timestamp': timestamp.toISOString(),
193
+ service: 'order-api',
194
+ status_code: hour % 5 === 0 ? 500 : 200,
195
+ response_time: 100 + (hour * 10)
196
+ });
197
+ }
198
+
199
+ await esClient.bulk({
200
+ index: 'test-logs',
201
+ body: testDocs.flatMap(doc => [{ index: {} }, doc])
202
+ });
203
+ await esClient.indices.refresh({ index: 'test-logs' });
204
+
205
+ // Run the same query the dashboard uses
206
+ const result = await esClient.search({
207
+ index: 'test-logs',
208
+ body: {
209
+ query: { match_all: {} },
210
+ aggs: {
211
+ requests_over_time: {
212
+ date_histogram: { field: '@timestamp', fixed_interval: '1h' },
213
+ aggs: {
214
+ avg_response: { avg: { field: 'response_time' } },
215
+ error_count: {
216
+ filter: { range: { status_code: { gte: 500 } } }
217
+ }
218
+ }
219
+ }
220
+ },
221
+ size: 0
222
+ }
223
+ });
224
+
225
+ const buckets = result.aggregations.requests_over_time.buckets;
226
+ expect(buckets.length).toBe(24);
227
+
228
+ // Verify specific bucket values
229
+ const errorBuckets = buckets.filter(b => b.error_count.doc_count > 0);
230
+ expect(errorBuckets.length).toBe(5); // Hours 0, 5, 10, 15, 20
231
+ });
232
+
233
+ it('validates term aggregation for top services', async () => {
234
+ const result = await esClient.search({
235
+ index: 'logs-*',
236
+ body: {
237
+ query: { range: { '@timestamp': { gte: 'now-1h' } } },
238
+ aggs: {
239
+ top_services: {
240
+ terms: { field: 'service.keyword', size: 10 }
241
+ }
242
+ },
243
+ size: 0
244
+ }
245
+ });
246
+
247
+ const services = result.aggregations.top_services.buckets;
248
+ expect(services.length).toBeGreaterThan(0);
249
+
250
+ // Each bucket should have reasonable doc counts
251
+ for (const bucket of services) {
252
+ expect(bucket.key).toBeDefined();
253
+ expect(bucket.doc_count).toBeGreaterThan(0);
254
+ }
255
+ });
256
+ });
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Kibana Dashboard Element Assertions
262
+
263
+ ```javascript
264
+ describe('Kibana Dashboard Visual Validation', () => {
265
+ it('validates dashboard panels render without errors', async () => {
266
+ await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
267
+
268
+ // Wait for all panels to finish loading
269
+ await page.waitForSelector('.embPanel__content', { state: 'visible' });
270
+ await page.waitForFunction(() => {
271
+ const loaders = document.querySelectorAll('.euiLoadingSpinner');
272
+ return loaders.length === 0;
273
+ }, { timeout: 30000 });
274
+
275
+ // Check no error icons on any panel
276
+ const errorPanels = await page.locator('.embPanel--error').count();
277
+ expect(errorPanels).toBe(0);
278
+
279
+ // Check no "No results found" where data is expected
280
+ const noResultPanels = await page.locator('text="No results found"').count();
281
+ expect(noResultPanels).toBe(0);
282
+ });
283
+
284
+ it('validates metric visualization shows correct value', async () => {
285
+ await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
286
+ await page.waitForLoadState('networkidle');
287
+
288
+ // Get the displayed metric value
289
+ const metricValue = await page.locator('[data-test-subj="metricVis-total-orders"] .mtrVis__value').textContent();
290
+ const displayedCount = parseInt(metricValue.replace(/,/g, ''));
291
+
292
+ // Compare with direct ES query
293
+ const esResult = await esClient.count({ index: 'orders-*' });
294
+
295
+ expect(displayedCount).toBe(esResult.count);
296
+ });
297
+
298
+ it('validates table visualization columns and sorting', async () => {
299
+ await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
300
+ await page.waitForLoadState('networkidle');
301
+
302
+ // Verify expected columns exist
303
+ const headers = await page.locator('.euiTable th').allTextContents();
304
+ expect(headers).toContain('Service');
305
+ expect(headers).toContain('Error Rate');
306
+ expect(headers).toContain('P95 Latency');
307
+
308
+ // Verify sorting works
309
+ await page.click('th:has-text("Error Rate")');
310
+ const firstRow = await page.locator('.euiTable tbody tr:first-child td').allTextContents();
311
+ const secondRow = await page.locator('.euiTable tbody tr:nth-child(2) td').allTextContents();
312
+
313
+ const firstErrorRate = parseFloat(firstRow[1]);
314
+ const secondErrorRate = parseFloat(secondRow[1]);
315
+ expect(firstErrorRate).toBeGreaterThanOrEqual(secondErrorRate);
316
+ });
317
+ });
318
+ ```
319
+
320
+ ---
321
+
322
+ ## Alert Rule Testing
323
+
324
+ ```javascript
325
+ describe('Alert Rule Validation', () => {
326
+ it('fires alert when error rate exceeds threshold', async () => {
327
+ // Generate errors to exceed the 5% threshold
328
+ const requests = [];
329
+ for (let i = 0; i < 100; i++) {
330
+ requests.push({
331
+ '@timestamp': new Date().toISOString(),
332
+ service: 'payment-api',
333
+ status_code: i < 10 ? 500 : 200, // 10% error rate > 5% threshold
334
+ response_time: 200
335
+ });
336
+ }
337
+
338
+ await esClient.bulk({
339
+ index: 'logs-payment',
340
+ body: requests.flatMap(doc => [{ index: {} }, doc])
341
+ });
342
+ await esClient.indices.refresh({ index: 'logs-payment' });
343
+
344
+ // Wait for alert evaluation cycle (typically 1 minute)
345
+ await sleep(90000);
346
+
347
+ // Check alert was fired
348
+ const alerts = await alertManager.getActiveAlerts({
349
+ filter: 'alertname="HighErrorRate" AND service="payment-api"'
350
+ });
351
+ expect(alerts.length).toBeGreaterThan(0);
352
+ expect(alerts[0].labels.severity).toBe('critical');
353
+ });
354
+
355
+ it('alert auto-resolves when condition clears', async () => {
356
+ // First trigger the alert
357
+ await injectErrors('payment-api', { count: 50, total: 100 });
358
+ await sleep(90000);
359
+
360
+ let alerts = await alertManager.getActiveAlerts({ filter: 'alertname="HighErrorRate"' });
361
+ expect(alerts.length).toBeGreaterThan(0);
362
+
363
+ // Now inject healthy traffic to bring error rate below threshold
364
+ await injectSuccessRequests('payment-api', { count: 1000 });
365
+ await sleep(90000);
366
+
367
+ // Alert should auto-resolve
368
+ alerts = await alertManager.getActiveAlerts({ filter: 'alertname="HighErrorRate"' });
369
+ expect(alerts.length).toBe(0);
370
+ });
371
+
372
+ it('alert notification reaches correct channel', async () => {
373
+ // Subscribe to notification channel
374
+ const notifications = [];
375
+ const subscription = pagerDutyMock.onIncident((incident) => {
376
+ notifications.push(incident);
377
+ });
378
+
379
+ // Trigger alert condition
380
+ await injectErrors('critical-service', { count: 50, total: 100 });
381
+ await sleep(120000);
382
+
383
+ expect(notifications.length).toBeGreaterThan(0);
384
+ expect(notifications[0].service.name).toBe('critical-service');
385
+ expect(notifications[0].urgency).toBe('high');
386
+
387
+ subscription.unsubscribe();
388
+ });
389
+
390
+ it('alert does not fire for brief transient spikes', async () => {
391
+ // Inject a brief 30-second spike (alert requires 5 minutes sustained)
392
+ await injectErrors('api-service', { count: 20, total: 50, duration: 30000 });
393
+ await sleep(120000);
394
+
395
+ const alerts = await alertManager.getActiveAlerts({ filter: 'alertname="HighErrorRate"' });
396
+ expect(alerts.length).toBe(0); // Should NOT fire for transient spike
397
+ });
398
+ });
399
+ ```
400
+
401
+ ---
402
+
403
+ ## Log Aggregation Completeness
404
+
405
+ ```javascript
406
+ describe('Log Aggregation Completeness', () => {
407
+ it('all microservice logs appear in centralized index', async () => {
408
+ const traceId = uuid();
409
+ const services = ['api-gateway', 'auth-service', 'order-service', 'payment-service', 'notification-service'];
410
+
411
+ // Generate a log entry with known traceId in each service
412
+ for (const service of services) {
413
+ await serviceLogEmitter.emit(service, {
414
+ level: 'INFO',
415
+ message: `Completeness test - ${traceId}`,
416
+ traceId,
417
+ timestamp: new Date().toISOString()
418
+ });
419
+ }
420
+
421
+ // Wait for log pipeline to process (Filebeat -> Logstash -> Elasticsearch)
422
+ await sleep(15000);
423
+
424
+ // Query Elasticsearch for the trace ID
425
+ const result = await esClient.search({
426
+ index: 'logs-*',
427
+ body: {
428
+ query: { term: { 'traceId.keyword': traceId } },
429
+ size: 100
430
+ }
431
+ });
432
+
433
+ const foundServices = result.hits.hits.map(h => h._source.service);
434
+
435
+ // All services should have their log entry in Elasticsearch
436
+ for (const service of services) {
437
+ expect(foundServices).toContain(service);
438
+ }
439
+ expect(foundServices.length).toBe(services.length);
440
+ });
441
+
442
+ it('logs retain correct structure after pipeline processing', async () => {
443
+ const testLog = {
444
+ level: 'ERROR',
445
+ message: 'Payment declined',
446
+ traceId: uuid(),
447
+ userId: 'user-123',
448
+ orderId: 'order-456',
449
+ errorCode: 'INSUFFICIENT_FUNDS',
450
+ timestamp: new Date().toISOString()
451
+ };
452
+
453
+ await serviceLogEmitter.emit('payment-service', testLog);
454
+ await sleep(10000);
455
+
456
+ const result = await esClient.search({
457
+ index: 'logs-*',
458
+ body: { query: { term: { 'traceId.keyword': testLog.traceId } } }
459
+ });
460
+
461
+ expect(result.hits.hits.length).toBe(1);
462
+ const indexed = result.hits.hits[0]._source;
463
+
464
+ // Verify all fields survived the pipeline
465
+ expect(indexed.level).toBe('ERROR');
466
+ expect(indexed.message).toBe('Payment declined');
467
+ expect(indexed.userId).toBe('user-123');
468
+ expect(indexed.orderId).toBe('order-456');
469
+ expect(indexed.errorCode).toBe('INSUFFICIENT_FUNDS');
470
+ });
471
+
472
+ it('detects log volume drops indicating pipeline issues', async () => {
473
+ // Get baseline log volume for the past hour
474
+ const baseline = await esClient.count({
475
+ index: 'logs-*',
476
+ body: { query: { range: { '@timestamp': { gte: 'now-2h', lt: 'now-1h' } } } }
477
+ });
478
+
479
+ const current = await esClient.count({
480
+ index: 'logs-*',
481
+ body: { query: { range: { '@timestamp': { gte: 'now-1h' } } } }
482
+ });
483
+
484
+ // Current volume should be at least 50% of baseline (not a sudden drop)
485
+ const ratio = current.count / baseline.count;
486
+ expect(ratio).toBeGreaterThan(0.5);
487
+ });
488
+ });
489
+ ```
490
+
491
+ ---
492
+
493
+ ## APM Trace Validation
494
+
495
+ ```javascript
496
+ describe('Distributed Trace Validation', () => {
497
+ it('captures complete trace across all services', async () => {
498
+ // Make a request that traverses multiple services
499
+ const response = await httpClient.post('/api/orders', {
500
+ customerId: 'CUST-TRACE',
501
+ items: [{ sku: 'ITEM-1', qty: 1 }]
502
+ });
503
+
504
+ const traceId = response.headers['x-trace-id'];
505
+ expect(traceId).toBeDefined();
506
+
507
+ // Wait for trace to be indexed
508
+ await sleep(10000);
509
+
510
+ // Query Jaeger/APM for the trace
511
+ const trace = await jaegerClient.getTrace(traceId);
512
+
513
+ // Verify all expected spans exist
514
+ const spanNames = trace.spans.map(s => s.operationName);
515
+ expect(spanNames).toContain('POST /api/orders');
516
+ expect(spanNames).toContain('auth.validateToken');
517
+ expect(spanNames).toContain('order.create');
518
+ expect(spanNames).toContain('payment.authorize');
519
+ expect(spanNames).toContain('inventory.reserve');
520
+ expect(spanNames).toContain('db.insert orders');
521
+
522
+ // Verify parent-child relationships
523
+ const apiSpan = trace.spans.find(s => s.operationName === 'POST /api/orders');
524
+ const authSpan = trace.spans.find(s => s.operationName === 'auth.validateToken');
525
+ expect(authSpan.references[0].refType).toBe('CHILD_OF');
526
+ expect(authSpan.references[0].spanID).toBe(apiSpan.spanID);
527
+ });
528
+
529
+ it('traces capture error spans correctly', async () => {
530
+ // Trigger a known error
531
+ const response = await httpClient.post('/api/orders', {
532
+ customerId: 'INVALID-CUSTOMER',
533
+ items: [{ sku: 'ITEM-1', qty: 1 }]
534
+ });
535
+
536
+ const traceId = response.headers['x-trace-id'];
537
+ await sleep(10000);
538
+
539
+ const trace = await jaegerClient.getTrace(traceId);
540
+
541
+ // Find error span
542
+ const errorSpan = trace.spans.find(s => s.tags.some(t => t.key === 'error' && t.value === true));
543
+ expect(errorSpan).toBeDefined();
544
+ expect(errorSpan.logs).toContainEqual(
545
+ expect.objectContaining({
546
+ fields: expect.arrayContaining([
547
+ expect.objectContaining({ key: 'error.message' })
548
+ ])
549
+ })
550
+ );
551
+ });
552
+
553
+ it('validates trace sampling rate', async () => {
554
+ const requestCount = 100;
555
+ const traceIds = [];
556
+
557
+ for (let i = 0; i < requestCount; i++) {
558
+ const resp = await httpClient.get('/api/health');
559
+ if (resp.headers['x-trace-id']) {
560
+ traceIds.push(resp.headers['x-trace-id']);
561
+ }
562
+ }
563
+
564
+ await sleep(15000);
565
+
566
+ let tracesFound = 0;
567
+ for (const traceId of traceIds) {
568
+ try {
569
+ await jaegerClient.getTrace(traceId);
570
+ tracesFound++;
571
+ } catch (e) {
572
+ // Trace not sampled
573
+ }
574
+ }
575
+
576
+ // With 10% sampling rate, expect roughly 10 traces (allow variance)
577
+ const samplingRate = tracesFound / requestCount;
578
+ expect(samplingRate).toBeGreaterThan(0.05);
579
+ expect(samplingRate).toBeLessThan(0.20);
580
+ });
581
+ });
582
+ ```
583
+
584
+ ---
585
+
586
+ ## SLA/SLO Validation
587
+
588
+ ```javascript
589
+ describe('SLA/SLO Compliance Validation', () => {
590
+ it('validates 99.9% availability SLO over 30 days', async () => {
591
+ const result = await prometheusClient.query(
592
+ 'avg_over_time(up{job="api-service"}[30d])'
593
+ );
594
+ const availability = parseFloat(result.data.result[0].value[1]) * 100;
595
+
596
+ expect(availability).toBeGreaterThanOrEqual(99.9);
597
+
598
+ // Calculate error budget remaining
599
+ const totalMinutes = 30 * 24 * 60;
600
+ const allowedDowntime = totalMinutes * 0.001; // 43.2 minutes
601
+ const actualDowntime = totalMinutes * (1 - availability / 100);
602
+ const errorBudgetRemaining = ((allowedDowntime - actualDowntime) / allowedDowntime) * 100;
603
+
604
+ expect(errorBudgetRemaining).toBeGreaterThan(0);
605
+ console.log(`Error budget remaining: ${errorBudgetRemaining.toFixed(1)}%`);
606
+ });
607
+
608
+ it('validates P95 latency SLO', async () => {
609
+ const result = await prometheusClient.query(
610
+ 'histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{service="api-service"}[24h])) by (le))'
611
+ );
612
+ const p95Latency = parseFloat(result.data.result[0].value[1]) * 1000; // Convert to ms
613
+
614
+ expect(p95Latency).toBeLessThan(500); // SLO: P95 < 500ms
615
+ });
616
+
617
+ it('runs synthetic monitoring check for uptime', async () => {
618
+ const endpoints = [
619
+ { url: '/api/health', expectedStatus: 200, maxLatency: 200 },
620
+ { url: '/api/orders', expectedStatus: 401, maxLatency: 300 }, // Auth required
621
+ { url: '/api/products', expectedStatus: 200, maxLatency: 500 }
622
+ ];
623
+
624
+ const results = [];
625
+ for (const endpoint of endpoints) {
626
+ const start = Date.now();
627
+ const response = await httpClient.get(endpoint.url);
628
+ const latency = Date.now() - start;
629
+
630
+ results.push({
631
+ url: endpoint.url,
632
+ status: response.status,
633
+ latency,
634
+ statusMatch: response.status === endpoint.expectedStatus,
635
+ latencyOk: latency <= endpoint.maxLatency
636
+ });
637
+ }
638
+
639
+ // All checks should pass
640
+ for (const result of results) {
641
+ expect(result.statusMatch).toBe(true);
642
+ expect(result.latencyOk).toBe(true);
643
+ }
644
+ });
645
+ });
646
+ ```
647
+
648
+ ---
649
+
650
+ ## Metric Pipeline Integrity
651
+
652
+ ```javascript
653
+ describe('Metric Pipeline - Collection to Display', () => {
654
+ it('validates custom metric flows from app to Prometheus to Grafana', async () => {
655
+ // Step 1: Emit a known custom metric from application
656
+ const metricName = 'test_orders_processed_total';
657
+ const expectedValue = 42;
658
+ await appMetrics.set(metricName, expectedValue, { service: 'test' });
659
+
660
+ // Step 2: Wait for scrape interval (15s default)
661
+ await sleep(20000);
662
+
663
+ // Step 3: Query Prometheus directly
664
+ const promResult = await prometheusClient.query(`${metricName}{service="test"}`);
665
+ const promValue = parseFloat(promResult.data.result[0].value[1]);
666
+ expect(promValue).toBe(expectedValue);
667
+
668
+ // Step 4: Query Grafana datasource API (same as dashboard would)
669
+ const grafanaResult = await grafanaApi.post('/api/ds/query', {
670
+ queries: [{
671
+ datasource: { type: 'prometheus' },
672
+ expr: `${metricName}{service="test"}`,
673
+ refId: 'A'
674
+ }]
675
+ });
676
+
677
+ const grafanaValue = parseFloat(grafanaResult.body.results.A.frames[0].data.values[1][0]);
678
+ expect(grafanaValue).toBe(expectedValue);
679
+ });
680
+
681
+ it('validates histogram metric percentile accuracy', async () => {
682
+ // Generate known latency distribution
683
+ const latencies = [10, 20, 30, 50, 100, 200, 300, 500, 1000, 2000]; // ms
684
+ for (const latency of latencies) {
685
+ await appMetrics.observe('http_request_duration_ms', latency, { endpoint: '/test' });
686
+ }
687
+
688
+ await sleep(20000);
689
+
690
+ // Verify P50 and P99
691
+ const p50 = await prometheusClient.query(
692
+ 'histogram_quantile(0.5, rate(http_request_duration_ms_bucket{endpoint="/test"}[5m]))'
693
+ );
694
+ const p99 = await prometheusClient.query(
695
+ 'histogram_quantile(0.99, rate(http_request_duration_ms_bucket{endpoint="/test"}[5m]))'
696
+ );
697
+
698
+ const p50Value = parseFloat(p50.data.result[0].value[1]);
699
+ const p99Value = parseFloat(p99.data.result[0].value[1]);
700
+
701
+ // P50 should be around 100ms (median of our distribution)
702
+ expect(p50Value).toBeGreaterThan(50);
703
+ expect(p50Value).toBeLessThan(300);
704
+
705
+ // P99 should be around 2000ms
706
+ expect(p99Value).toBeGreaterThan(1000);
707
+ });
708
+ });
709
+ ```
710
+
711
+ ---
712
+
713
+ ## Dashboard Performance Testing
714
+
715
+ ```javascript
716
+ describe('Dashboard Performance', () => {
717
+ it('dashboard loads within acceptable time', async () => {
718
+ const start = Date.now();
719
+
720
+ await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview`);
721
+
722
+ // Wait for all panels to finish loading
723
+ await page.waitForFunction(() => {
724
+ const spinners = document.querySelectorAll('.euiLoadingSpinner');
725
+ return spinners.length === 0;
726
+ }, { timeout: 30000 });
727
+
728
+ const loadTime = Date.now() - start;
729
+
730
+ expect(loadTime).toBeLessThan(10000); // Dashboard should load in under 10s
731
+ });
732
+
733
+ it('dashboard handles large time range without timeout', async () => {
734
+ // Set time range to 30 days
735
+ await page.goto(`${kibanaUrl}/app/dashboards#/view/operations-overview?_g=(time:(from:now-30d,to:now))`);
736
+
737
+ // Should complete without timeout error
738
+ await page.waitForFunction(() => {
739
+ const errors = document.querySelectorAll('.embPanel--error');
740
+ const spinners = document.querySelectorAll('.euiLoadingSpinner');
741
+ return errors.length === 0 && spinners.length === 0;
742
+ }, { timeout: 60000 });
743
+
744
+ const errorPanels = await page.locator('.embPanel--error').count();
745
+ expect(errorPanels).toBe(0);
746
+ });
747
+
748
+ it('Elasticsearch query performance is within bounds', async () => {
749
+ const queries = [
750
+ { name: 'date_histogram', body: { aggs: { over_time: { date_histogram: { field: '@timestamp', fixed_interval: '1h' } } }, size: 0 } },
751
+ { name: 'terms_agg', body: { aggs: { top_services: { terms: { field: 'service.keyword', size: 20 } } }, size: 0 } },
752
+ { name: 'percentiles', body: { aggs: { latency: { percentiles: { field: 'response_time', percents: [50, 90, 95, 99] } } }, size: 0 } }
753
+ ];
754
+
755
+ for (const query of queries) {
756
+ const start = Date.now();
757
+ await esClient.search({ index: 'logs-*', body: { query: { range: { '@timestamp': { gte: 'now-24h' } } }, ...query.body } });
758
+ const elapsed = Date.now() - start;
759
+
760
+ expect(elapsed).toBeLessThan(5000); // Each query under 5s
761
+ }
762
+ });
763
+ });
764
+ ```
765
+
766
+ ---
767
+
768
+ ## Time-Series Data Accuracy
769
+
770
+ ```javascript
771
+ describe('Time-Series Data Accuracy', () => {
772
+ it('validates no data gaps in time-series metrics', async () => {
773
+ const result = await prometheusClient.queryRange(
774
+ 'up{job="api-service"}',
775
+ { start: 'now-24h', end: 'now', step: '5m' }
776
+ );
777
+
778
+ const values = result.data.result[0].values;
779
+ const expectedPoints = (24 * 60) / 5; // 288 data points for 24h at 5m intervals
780
+
781
+ // Allow up to 5% missing data points
782
+ expect(values.length).toBeGreaterThan(expectedPoints * 0.95);
783
+
784
+ // Check for gaps longer than 15 minutes (3 consecutive missing points)
785
+ for (let i = 1; i < values.length; i++) {
786
+ const gap = values[i][0] - values[i - 1][0]; // timestamp difference
787
+ expect(gap).toBeLessThanOrEqual(900); // No gap > 15 minutes
788
+ }
789
+ });
790
+
791
+ it('validates timestamp alignment across sources', async () => {
792
+ // Generate event with precise timestamp
793
+ const eventTime = new Date();
794
+ const traceId = uuid();
795
+
796
+ await httpClient.post('/api/test-event', { traceId });
797
+ await sleep(15000);
798
+
799
+ // Check timestamp in logs
800
+ const logResult = await esClient.search({
801
+ index: 'logs-*',
802
+ body: { query: { term: { 'traceId.keyword': traceId } } }
803
+ });
804
+ const logTimestamp = new Date(logResult.hits.hits[0]._source['@timestamp']);
805
+
806
+ // Check timestamp in metrics (approximate)
807
+ // Timestamps should be within 5 seconds of each other
808
+ const diff = Math.abs(logTimestamp.getTime() - eventTime.getTime());
809
+ expect(diff).toBeLessThan(5000);
810
+ });
811
+ });
812
+ ```
813
+
814
+ ---
815
+
816
+ ## Best Practices
817
+
818
+ ### Do This
819
+ - Compare dashboard values against source-of-truth databases
820
+ - Test alert thresholds with known data to verify exact firing conditions
821
+ - Validate log completeness by injecting traceable test events
822
+ - Test alert recovery (auto-resolve) not just alert firing
823
+ - Monitor log volume as a proxy for pipeline health
824
+ - Validate sampling rates for APM traces
825
+ - Test dashboards at realistic time ranges (not just last 15 minutes)
826
+
827
+ ### Avoid This
828
+ - Trusting dashboard numbers without source validation
829
+ - Testing alerts only with manual threshold checks in the UI
830
+ - Ignoring log pipeline latency (logs may take seconds to minutes to appear)
831
+ - Skipping alert fatigue testing (too many false positives)
832
+ - Assuming metrics are accurate without end-to-end pipeline validation
833
+ - Testing only with small data volumes (performance issues appear at scale)
834
+ - Forgetting to test alert notification delivery (PagerDuty, Slack, email)
835
+
836
+ ---
837
+
838
+ ## Agent-Assisted Observability Testing
839
+
840
+ ```typescript
841
+ // Data accuracy validation
842
+ await Task("Dashboard Data Accuracy Validation", {
843
+ dashboard: 'operations-overview',
844
+ panels: ['order-count', 'revenue-total', 'error-rate'],
845
+ sourceDatabase: 'orders-db',
846
+ compareFields: ['count', 'sum(total)', 'error_percentage'],
847
+ tolerance: 0.01
848
+ }, "qe-integration-tester");
849
+
850
+ // Dashboard performance testing
851
+ await Task("Dashboard Performance Benchmark", {
852
+ dashboardUrl: 'http://kibana:5601/app/dashboards#/view/operations-overview',
853
+ timeRanges: ['15m', '1h', '24h', '7d', '30d'],
854
+ maxLoadTime: 10000,
855
+ maxQueryTime: 5000,
856
+ captureScreenshots: true
857
+ }, "qe-performance-tester");
858
+
859
+ // Dashboard visual regression
860
+ await Task("Dashboard Visual Regression", {
861
+ dashboardUrl: 'http://kibana:5601/app/dashboards#/view/operations-overview',
862
+ baselineScreenshots: 'baseline/dashboards/',
863
+ threshold: 0.05,
864
+ ignoreRegions: ['timestamp-header', 'dynamic-counters']
865
+ }, "qe-visual-tester");
866
+
867
+ // Alert rule validation
868
+ await Task("Alert Rule Comprehensive Test", {
869
+ alertRules: ['HighErrorRate', 'HighLatency', 'ServiceDown'],
870
+ testFiring: true,
871
+ testRecovery: true,
872
+ testNotificationChannel: true,
873
+ validateSilencing: true
874
+ }, "qe-integration-tester");
875
+ ```
876
+
877
+ ---
878
+
879
+ ## Agent Coordination Hints
880
+
881
+ ### Memory Namespace
882
+ ```
883
+ aqe/observability-testing/
884
+ dashboards/ - Dashboard test results and screenshots
885
+ alerts/ - Alert rule test outcomes
886
+ logs/ - Log completeness validation results
887
+ traces/ - APM trace validation results
888
+ slo/ - SLA/SLO compliance metrics
889
+ pipelines/ - Metric pipeline integrity checks
890
+ performance/ - Dashboard and query performance benchmarks
891
+ ```
892
+
893
+ ### Fleet Coordination
894
+ ```typescript
895
+ const observabilityFleet = await FleetManager.coordinate({
896
+ strategy: 'observability-testing',
897
+ agents: [
898
+ 'qe-integration-tester', // Data accuracy, log completeness, alert rules
899
+ 'qe-performance-tester', // Dashboard load time, query latency
900
+ 'qe-visual-tester' // Dashboard visual regression
901
+ ],
902
+ topology: 'mesh'
903
+ });
904
+
905
+ await observabilityFleet.execute({
906
+ targets: [
907
+ { type: 'dashboard', id: 'operations-overview', checks: ['accuracy', 'performance', 'visual'] },
908
+ { type: 'alerts', rules: ['HighErrorRate', 'HighLatency'], checks: ['fire', 'resolve', 'notify'] },
909
+ { type: 'logs', services: ['api', 'auth', 'payment'], checks: ['completeness', 'structure'] },
910
+ { type: 'traces', endpoints: ['/api/orders'], checks: ['spans', 'errors', 'sampling'] }
911
+ ]
912
+ });
913
+ ```
914
+
915
+ ---
916
+
917
+ ## Related Skills
918
+ - [api-testing-patterns](../api-testing-patterns/) - API testing for services feeding observability
919
+ - [shift-right-testing](../shift-right-testing/) - Production monitoring and observability
920
+ - [performance-testing](../performance-testing/) - Performance baselines and SLO definition
921
+ - [chaos-engineering-resilience](../chaos-engineering-resilience/) - Fault injection to validate alerting
922
+ - [visual-testing-advanced](../visual-testing-advanced/) - Dashboard visual regression
923
+
924
+ ---
925
+
926
+ ## Remember
927
+
928
+ Observability testing is about proving that your monitoring tells the truth. A dashboard that shows green when the system is on fire is worse than no dashboard at all. Validate data accuracy by comparing against source databases, test alert thresholds with controlled data injection, and verify log completeness by tracing known events through the entire pipeline.
929
+
930
+ **With Agents:** Agents automate the tedious comparison of dashboard values against source databases, systematically test alert thresholds with synthetic load, and validate log pipeline completeness across all services. Use agents to continuously verify that your observability stack is trustworthy.