POC: native pup setup verify command - #880
Draft
tedkahwaji wants to merge 1 commit into
Draft
tedkahwaji wants to merge 1 commit into
tedkahwaji wants to merge 1 commit into
Conversation
POC. Counts APM spans, logs, or RUM events for a service over a lookback window via the analytics aggregate endpoints, optionally polling until data appears, and prints a structured result with an explorer link. Exits non-zero when nothing is found so agents and scripts can branch on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Exploring how product-setup capabilities could live in pup. Today an agent that has just instrumented a service has no single pup command to answer "is telemetry arriving yet?". This POC ports that one slice, the post-setup verification check, as a native command, to make the cost of porting setup functionality into pup concrete. It is a draft for discussion, not a merge request.
What
pup setup verify --product <apm|logs|rum> --service <name> [--env <env>] [--from 15m] [--wait 0s]/api/v2/spans/analytics/aggregate,/api/v2/logs/analytics/aggregate,/api/v2/rum/analytics/aggregate) usingraw_client::raw_post, so auth and site handling are pup's existing ones.--wait, polls every 10s until data appears or the wait elapses.found,count,query,lookback,elapsed_seconds, explorerurl) throughformatter::output, so-o,--jqand the agent envelope work as for other commands.docs/COMMANDS.md.Testing
cargo test commands::setup: 8 passed (found, not found, polling until data arrives, API error, empty service and bad duration rejected, query building, response shapes, URL encoding).cargo fmtandcargo clippy --all-targets -- -D warningsclean.cargo test: 2075 passed, 6 failed in unrelated modules (ddsql, debugger, notebook_images, notebooks, security, users) when run from inside an agent session; all 6 pass when rerun without the agent-session env vars, so they are environment-sensitive, not caused by this change.Logs (found for a busy service) and RUM (not found) behave the same way.
Cost notes
src/commands/setup.rs, and 67 lines of clap wiring insrc/main.rs. This covers three products and only the verification step.src/generated) covers spec tags only. This command chains three different request and response shapes, polling, and a pass/fail exit, which is the kind of logic pup's generator does not produce. Every future product means editing this file by hand.🤖 Generated with Claude Code