Add dimension/metric filter and metadata flags to reports run#1
Open
sandiegodj wants to merge 1 commit intomasterfrom
Open
Add dimension/metric filter and metadata flags to reports run#1sandiegodj wants to merge 1 commit intomasterfrom
sandiegodj wants to merge 1 commit intomasterfrom
Conversation
…ports run
The CLI had dimensionFilter/metricFilter in its request interface but
never exposed them as flags, making filtered queries impossible. This
also adds --include-metadata to surface sampling info that the API
returns but the CLI was discarding.
- --dimension-filter <json>: parse and attach to request body
- --metric-filter <json>: same pattern for metric filters
- --include-metadata: wrap output as {rows, metadata, rowCount}
- Expand RunReportResponse.metadata to include samplingMetadatas
- JSON parse validation with clear error on invalid input
- 3 new tests: filter passthrough, andGroup structure, metadata envelope
- AGENTS.md updated with new flags and examples
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
--dimension-filter <json>and--metric-filter <json>flags toga4 reports run, enabling server-side filtered queries through the CLI--include-metadataflag that wraps output as{rows, metadata, rowCount}, surfacing sampling info the API returns but the CLI was previously discardingRunReportResponsemetadata type to includesamplingMetadatasfieldsThese were the blockers for migrating the MDE calculator skill from
analytics-mcptoga4-cli. Without--dimension-filter, every query that needs "pagePath contains /pricing" or "eventName equals form_submit" was impossible through the CLI.Test plan
npm test)--include-metadataoutput parses correctly when piped tomde_calculator.py check-sampling🤖 Generated with Claude Code