chore: add script to catalog DD routes per scope#2343
Merged
ava-silver merged 2 commits intoJun 9, 2026
Conversation
This comment has been minimized.
This comment has been minimized.
ava-silver
marked this pull request as ready for review
June 8, 2026 16:37
duncanista
approved these changes
Jun 8, 2026
GabrielAnca
approved these changes
Jun 9, 2026
GabrielAnca
left a comment
Contributor
There was a problem hiding this comment.
Looks great! One small improvement proposed
Drarig29
reviewed
Jun 9, 2026
Drarig29
approved these changes
Jun 9, 2026
ava-silver
deleted the
ava.silver/chore/add-script-to-catalog-used-endpoints
branch
June 9, 2026 14:44
Merged
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.

What and why?
Adds
bin/catalog-endpoints.ts-- a dev script that statically analyzes the codebase and producesendpoints.csv: a mapping of CLI scopes to the Datadog API routes they call, with HTTP methods. This supports SEAL (Smart Edge Audit Logs) passive observability -- CI will upload the CSV to S3 to keep a reference table current so audit log data can be enriched with CLI command context.Right now uses a grep-based approach, but we could switch to an AST parsing approach or something else in the future if we want more capability
Example output:
How?
packages/plugin-*/srcandpackages/base/src/commands/*/to collect scopes and their source filesdatadogRoute('...')calls via regex; resolves HTTP method by scanning up to 5 lines before / 2 lines after each call formethod: 'VERB'(handles lowercase,METHOD_POST-style constants; defaults toGET)helpers/serverless/flare.tsas a special case -- greps which scopes import it and attributes its routes to each importer (lambda,cloud-run)helpers/apikey.ts(/api/v1/validate) andhelpers/upload.ts(/v1/input) as they're too cross-cuttingendpoints.csvat the repo root (gitignored)Run with
yarn catalog-endpoints.Review checklist