Files
adolf/qa/scenarios/runtime/docker-prometheus-smoke.yaml
alvis bedb527145
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Vendor OpenClaw source as Adolf fork baseline
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11),
free to diverge. Tree copied sans upstream .git; upstream remote added for
future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19.
Preserves docs/ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
2026-07-05 09:36:54 +00:00

155 lines
6.5 KiB
YAML

title: Docker Prometheus smoke
scenario:
id: docker-prometheus-smoke
surface: telemetry
coverage:
primary:
- telemetry.prometheus
- telemetry.prometheus-authenticated-gateway-export
secondary:
- harness.qa-lab
- docker.runtime-validation
objective: Verify a QA-lab gateway run emits protected, bounded Prometheus diagnostics metrics through the diagnostics-prometheus plugin.
successCriteria:
- The diagnostics-prometheus plugin exposes the protected scrape route.
- An unauthenticated scrape is rejected.
- A minimal QA-channel agent turn completes.
- The authenticated scrape includes release-critical diagnostics metric families.
- Prometheus output omits prompt content, session keys, auth tokens, raw ids, and file paths.
plugins:
- diagnostics-prometheus
gatewayConfigPatch:
diagnostics:
enabled: true
docsRefs:
- docs/gateway/prometheus.md
- docs/concepts/qa-e2e-automation.md
codeRefs:
- extensions/diagnostics-prometheus/src/service.ts
- src/diagnostics/internal-diagnostics.ts
- extensions/qa-lab/src/suite.ts
execution:
kind: flow
summary: Complete a minimal QA-lab turn and scrape the protected Prometheus route.
config:
prompt: Reply exactly DOCKER-PROMETHEUS-OK. Do not repeat DOCKER-PROMETHEUS-SECRET.
secretNeedle: DOCKER-PROMETHEUS-SECRET
flow:
steps:
- name: emits protected low-cardinality prometheus metrics
actions:
- call: waitForGatewayHealthy
args:
- ref: env
- 60000
- call: waitForQaChannelReady
args:
- ref: env
- 60000
- call: reset
- set: startCursor
value:
expr: state.getSnapshot().messages.length
- call: runAgentPrompt
args:
- ref: env
- sessionKey: agent:qa:docker-prometheus-smoke
message:
expr: config.prompt
timeoutMs:
expr: liveTurnTimeoutMs(env, 30000)
- call: waitForCondition
saveAs: outbound
args:
- lambda:
expr: "state.getSnapshot().messages.slice(startCursor).filter((candidate) => candidate.direction === 'outbound' && candidate.conversation.id === 'qa-operator' && String(candidate.text ?? '').trim().length > 0).at(-1)"
- expr: liveTurnTimeoutMs(env, 30000)
- expr: "env.providerMode === 'mock-openai' ? 100 : 250"
- assert:
expr: "String(outbound.text ?? '').trim().length > 0"
message: "expected non-empty qa output before scraping metrics"
- set: prometheusUrl
value:
expr: "`${env.gateway.baseUrl}/api/diagnostics/prometheus`"
- set: gatewayToken
value:
expr: "String(env.gateway.token ?? env.gateway.runtimeEnv.OPENCLAW_GATEWAY_TOKEN ?? '')"
- assert:
expr: "gatewayToken.length > 0"
message: "expected QA gateway token to be available for protected scrape"
- set: unauthenticatedScrape
value:
expr: |-
(async () => {
const response = await fetch(prometheusUrl);
await response.text().catch(() => "");
return { status: response.status };
})()
- assert:
expr: "unauthenticatedScrape.status === 401 || unauthenticatedScrape.status === 403"
message:
expr: "`expected unauthenticated prometheus scrape to be rejected, got ${unauthenticatedScrape.status}`"
- set: authenticatedScrape
value:
expr: |-
(async () => {
const response = await fetch(prometheusUrl, {
headers: { authorization: `Bearer ${gatewayToken}` },
});
const text = await response.text();
return {
status: response.status,
contentType: response.headers.get("content-type") ?? "",
text,
};
})()
- assert:
expr: "authenticatedScrape.status === 200"
message:
expr: "`expected authenticated prometheus scrape to return 200, got ${authenticatedScrape.status}`"
- assert:
expr: "authenticatedScrape.contentType.includes('text/plain')"
message:
expr: "`expected prometheus text content type, got ${authenticatedScrape.contentType}`"
- set: prometheusText
value:
expr: "String(authenticatedScrape.text ?? '')"
- assert:
expr: "prometheusText.includes('# TYPE openclaw_run_completed_total counter')"
message: "missing run completion counter"
- assert:
expr: "prometheusText.includes('# TYPE openclaw_run_duration_seconds histogram')"
message: "missing run duration histogram"
- assert:
expr: "prometheusText.includes('# TYPE openclaw_model_call_total counter')"
message: "missing model call counter"
- assert:
expr: "prometheusText.includes('# TYPE openclaw_harness_run_total counter')"
message: "missing harness run counter"
- assert:
expr: "!prometheusText.includes(config.secretNeedle)"
message: "prometheus output leaked prompt sentinel"
- assert:
expr: "!prometheusText.includes('DOCKER-PROMETHEUS-OK')"
message: "prometheus output leaked response content"
- assert:
expr: "!prometheusText.includes('agent:qa:docker-prometheus-smoke')"
message: "prometheus output leaked the session key"
- assert:
expr: "!prometheusText.includes(gatewayToken)"
message: "prometheus output leaked the gateway token"
- assert:
expr: "!/runId|sessionId|sessionKey|callId|toolCallId|messageId|providerRequestId/.test(prometheusText)"
message: "prometheus output leaked raw diagnostic identifiers"
- assert:
expr: "!/\\/tmp\\/|\\/private\\/tmp\\/|\\/app\\//.test(prometheusText)"
message: "prometheus output leaked a local file path"
- assert:
expr: "!prometheusText.includes('openclaw.content.')"
message: "prometheus output leaked content attributes"
- assert:
expr: "!/openclaw_prometheus_series_dropped_total(?:\\{[^}]*\\})?\\s+(?!0(?:\\.0+)?(?:\\s|$))/.test(prometheusText)"
message: "prometheus dropped series during the smoke"