Skip to content

AI-472 Add replay-safe Google ADK metrics sample - #355

Open
xumaple wants to merge 4 commits into
mainfrom
maplexu/AI-472-adk-metrics
Open

AI-472 Add replay-safe Google ADK metrics sample#355
xumaple wants to merge 4 commits into
mainfrom
maplexu/AI-472-adk-metrics

Conversation

@xumaple

@xumaple xumaple commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR adds a Google ADK sample that exports ADK OpenTelemetry metrics through ReplaySafeMeterProvider. A deterministic local model keeps the sample API-key-free, and the Workflow includes a post-metrics replay boundary so duplicate observations are detectable.

Note: The sample pins the SDK revision that introduces ReplaySafeMeterProvider until that API is available in a release.

@xumaple
xumaple requested review from a team as code owners August 25, 2026 19:30

@DABH DABH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 0b92811. The core thesis holds and I verified it rather than taking the README's word for it — I probed _skip_recording directly and got 6 recordings live, 6 suppressed under Replayer, counts_after == counts_before — and the happy path works end to end against a real dev server. Switching this commit to Replayer and relative equality was the right response to the macOS failures; it's one indentation away from green.

One item that isn't tied to a line in this diff: metrics is missing from the suite scenario table. google_adk_agents/README.md:39-46 lists all six siblings and nothing in the repo links to google_adk_agents/metrics/README.md, so the sample is unreachable from any index.

| [metrics](./metrics/README.md) | Google ADK's OpenTelemetry metrics exported to a local Prometheus endpoint, with `ReplaySafeMeterProvider` keeping replay from double-counting observations. |

That row is only accurate once the nested pyproject.toml goes away — the suite's generic run block at :48-53 doesn't work for this scenario today. See the pyproject.toml:8 comment.

Comment thread google_adk_agents/metrics/test_metrics.py Outdated
Comment thread google_adk_agents/metrics/test_metrics.py Outdated
Comment thread google_adk_agents/metrics/test_metrics.py Outdated
Comment thread google_adk_agents/metrics/test_metrics.py Outdated
Comment thread google_adk_agents/metrics/test_metrics.py Outdated
Comment thread google_adk_agents/metrics/workflows/metrics_workflow.py Outdated
Comment thread google_adk_agents/metrics/README.md
Comment thread google_adk_agents/metrics/README.md Outdated
Comment thread google_adk_agents/metrics/README.md Outdated
Comment thread google_adk_agents/metrics/models/local_metrics_model.py
@xumaple
xumaple requested a review from a team as a code owner September 3, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants