Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pup <domain> <subgroup> <action> [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 | ✅ |
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions scripts/test_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 0 additions & 13 deletions src/commands/ddsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<i64>,
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
Expand Down
42 changes: 1 addition & 41 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,15 +1131,14 @@ 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
///
/// EXAMPLES:
/// 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
Expand Down Expand Up @@ -4535,36 +4534,6 @@ enum DdsqlActions {
#[arg(long, help = "Number of rows to skip (for pagination)")]
offset: Option<i32>,
},
/// 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-<duration> (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<i64>,
#[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
Expand Down Expand Up @@ -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?;
}
Expand Down
18 changes: 0 additions & 18 deletions src/test_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
Expand Down