fix(logs): wire --storage flag through to Datadog API#135
Merged
platinummonkey merged 3 commits intodatadog-labs:mainfrom Mar 1, 2026
Merged
Conversation
The --storage flag was accepted by the CLI but silently discarded in all four log command dispatch arms (search, list, query, aggregate). The value was matched as storage: _ in main.rs and never forwarded to the command functions, so requests always used the default index tier regardless of what the user specified. - Added LogsStorageTier import and parse_storage_tier() helper in src/commands/logs.rs with error on unrecognised values - Wired storage: Option<String> param through search(), list(), query(), and aggregate() functions (native + WASM variants) - Applied parsed tier to LogsQueryFilter via .storage_tier() builder - Fixed dispatch in src/main.rs: changed storage: _ to storage in all four LogActions match arms - Fixed three existing tests and added four new unit tests covering flex storage, online-archives storage, and invalid tier errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
thanks for the PR! please run format and clippy 👍 |
Auto-format long function signatures and call sites that exceeded the line-length limit introduced by the --storage parameter wiring. Co-Authored-By: Matthew Moon <matthew.moon@justeattakeaway.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- logs.rs: keep storage: Option<String> param for aggregate(), drop the erroneous API-key-only bail (aggregate works with OAuth like search) - test_commands.rs: keep main's test_logs_search_with_oauth success assertion; add None storage arg to match updated function signature Co-Authored-By: Matthew Moon <matthew.moon@justeattakeaway.com> Co-Authored-By: Claude Sonnet 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
The
--storageflag was accepted by all four log commands (search,list,query,aggregate) but silently discarded. Insrc/main.rsall four dispatch arms usedstorage: _, so the value was never forwarded to the command functions and requests always used the default index tier regardless of what the user specified.Changes
LogsStorageTierimport andparse_storage_tier()helper insrc/commands/logs.rswith a clear error on unrecognised values (e.g.unknown storage tier "bad"; valid values are: indexes, online-archives, flex)storage: Option<String>parameter throughsearch(),list(),query(), andaggregate()functions (native + WASM variants)LogsQueryFiltervia the.storage_tier()builder methodsrc/main.rs: changedstorage: _tostoragein all fourLogActionsmatch armsTesting
cargo test logs— all 60 tests passpup logs search --query="*" --from=15m --storage=flex --limit=5correctly reaches the Datadog Flex tier API (previously the flag was ignored and requests hit the index tier)🤖 Generated with Claude Sonnet 4.6