diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index 9dfa0732..fcec3a1c 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -29,7 +29,7 @@ pup [options] # Nested commands | monitors | list, get, create, update, delete, search, diff | src/commands/monitors.rs | ✅ | | dashboards | list, get, create, update, diff, delete, url, annotations (list, get-page, create, update, delete) | src/commands/dashboards.rs, src/commands/annotations.rs | ✅ | | dbm | samples (search) | src/commands/dbm.rs | ✅ | -| ddsql | table, time-series, spec, schema (tables, columns) | src/commands/ddsql.rs | ✅ | +| ddsql | table, spec, schema (tables, columns) | src/commands/ddsql.rs | ✅ | | debugger | probes (list, get, create, delete, watch) | src/commands/debugger.rs | ✅ | | slos | list, get, create, update, diff, delete, status | src/commands/slos.rs | ✅ | | incidents | list, get, attachments, settings, handles, postmortem-templates | src/commands/incidents.rs | ✅ | @@ -177,7 +177,7 @@ pup infrastructure hosts list - **traces** - APM spans metrics (list, get, create, update, delete) - **rum** - Real User Monitoring (apps, metrics, retention-filters, sessions) - **events** - Infrastructure events (post, list, search, get) -- **ddsql** - DDSQL queries and discovery (table, time-series, spec, schema) +- **ddsql** - DDSQL queries and discovery (table, spec, schema) - **symdb** - Symbol Database queries (search scopes, probe locations) ### Monitoring & Alerting diff --git a/scripts/test_harness.py b/scripts/test_harness.py index 3faa6a8e..b99bccf0 100755 --- a/scripts/test_harness.py +++ b/scripts/test_harness.py @@ -1494,12 +1494,6 @@ def status(self) -> str: "category": "auth_required", "expect_json": True, }, - { - "label": "ddsql time-series", - "args": ["ddsql", "time-series", "--query=SELECT 1"], - "category": "auth_required", - "expect_json": True, - }, # ── integrations (new) ──────────────────────────────────────────────── { "label": "integrations list", diff --git a/src/commands/ddsql.rs b/src/commands/ddsql.rs index 22911971..7024d53c 100644 --- a/src/commands/ddsql.rs +++ b/src/commands/ddsql.rs @@ -793,19 +793,6 @@ pub async fn table( formatter::output(cfg, &rows) } -pub async fn time_series( - cfg: &Config, - query: &str, - from: &str, - to: &str, - _interval: Option, - limit: i32, -) -> Result<()> { - let query = resolve_query(query)?; - let rows = execute_ddsql_query(cfg, &query, from, to, Some(i64::from(limit))).await?; - formatter::output(cfg, &rows) -} - /// Transform a DDSQL columnar response into a row-based JSON array. /// /// Each column is `{"name": "col1", "values": ["a", "b"]}` under the diff --git a/src/main.rs b/src/main.rs index 8e7e01b6..1aa5a96e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1131,7 +1131,6 @@ enum Commands { /// /// COMMANDS: /// table Execute query and return table data (supports -o json/yaml/table/csv) - /// time-series Execute query and return time series data /// spec Print DDSQL reference guidance used by the editor tooling /// schema Discover DDSQL tables and columns /// @@ -1139,7 +1138,7 @@ enum Commands { /// pup ddsql table --query "SELECT * FROM reference_tables.offices_ips LIMIT 5" /// pup ddsql table --query "SELECT * FROM reference_tables.offices_ips" -o csv > results.csv /// cat query.sql | pup ddsql table --query - -o table - /// pup ddsql time-series --query "SELECT timestamp, value, tags->'host' AS host FROM dd.metrics_timeseries('avg:system.cpu.user{*} by {host}')" --from 1h + /// pup ddsql table --query "SELECT timestamp, value, tags->'host' AS host FROM dd.metrics_timeseries('avg:system.cpu.user{*} by {host}')" --from 1h /// pup ddsql spec /// pup ddsql schema tables --query ec2 --limit 100 /// pup ddsql schema columns --table-id public.aws.ec2_instance @@ -4535,36 +4534,6 @@ enum DdsqlActions { #[arg(long, help = "Number of rows to skip (for pagination)")] offset: Option, }, - /// Execute DDSQL query and return time series data - #[command(name = "time-series")] - TimeSeries { - #[arg( - long, - allow_hyphen_values = true, - help = "DDSQL query string, or use --query - to read from stdin" - )] - query: String, - #[arg( - long, - default_value = "1h", - help = "Start time. Formats: now, now- (e.g., now-24h), relative duration (e.g., 24h), RFC 3339 timestamp, Unix seconds, or Unix milliseconds" - )] - from: String, - #[arg( - long, - default_value = "now", - help = "End time. Accepts the same formats as --from (e.g., now)" - )] - to: String, - #[arg(long, help = "Aggregation interval in milliseconds (default: 60000)")] - interval: Option, - #[arg( - long, - default_value_t = 5000, - help = "Maximum number of rows to return" - )] - limit: i32, - }, /// Print DDSQL reference guidance from the editor tooling Spec, /// Discover DDSQL tables and columns @@ -17098,15 +17067,6 @@ async fn main_inner() -> anyhow::Result<()> { commands::ddsql::table(&cfg, &query, &from, &to, interval, Some(limit), offset) .await?; } - DdsqlActions::TimeSeries { - query, - from, - to, - interval, - limit, - } => { - commands::ddsql::time_series(&cfg, &query, &from, &to, interval, limit).await?; - } DdsqlActions::Spec => { commands::ddsql::spec(&cfg).await?; } diff --git a/src/test_commands.rs b/src/test_commands.rs index e63cc2b6..6d874011 100644 --- a/src/test_commands.rs +++ b/src/test_commands.rs @@ -556,24 +556,6 @@ fn test_ddsql_table_query_accepts_explicit_stdin_marker() { } } -#[test] -fn test_ddsql_time_series_query_accepts_explicit_stdin_marker() { - use clap::Parser; - - let cli = crate::Cli::try_parse_from(["pup", "ddsql", "time-series", "--query", "-"]) - .expect("ddsql time-series --query - should parse"); - - match cli.command { - crate::Commands::Ddsql { action } => match action { - crate::DdsqlActions::TimeSeries { query, .. } => { - assert_eq!(query, "-"); - } - _ => panic!("expected DdsqlActions::TimeSeries"), - }, - _ => panic!("expected Commands::Ddsql"), - } -} - #[test] fn test_ddsql_table_query_requires_explicit_value() { let result = crate::Cli::command().try_get_matches_from(["pup", "ddsql", "table", "--query"]);