Skip to content

fix(ddsql): correct broken DDSQL time-series help example#605

Merged
platinummonkey merged 1 commit into
mainfrom
fix/ddsql-timeseries-example
Jun 18, 2026
Merged

fix(ddsql): correct broken DDSQL time-series help example#605
platinummonkey merged 1 commit into
mainfrom
fix/ddsql-timeseries-example

Conversation

@platinummonkey

Copy link
Copy Markdown
Collaborator

Summary

Cherry-pick of #599 (authored by @roippi) with a signed commit to satisfy the merge gate.

Fixes the pup ddsql time-series help example, which referenced a non-existent metrics dataset and caused HTTP 400 errors for anyone (or any agent) copying it verbatim.

Changes

  • src/main.rs:1083: replace SELECT avg(system.cpu.user) FROM metrics GROUP BY host (invalid) with SELECT timestamp, value, tags->'host' AS host FROM dd.metrics_timeseries('avg:system.cpu.user{*} by {host}') (spec-correct)
  • Drops the misleading --interval 300000 flag from the example

Testing

Verified by original author in #599 against the live API — broken query returns HTTP 400, corrected query returns real per-host timeseries data.

Closes #599


🤖 Generated with Claude Code

The `ddsql time-series` example in `--help` queried a bare `metrics`
table, which is not a valid DDSQL dataset and fails with:
  HTTP 400: depends on non-existent dataset "metrics"

Replace it with a verified `dd.metrics_timeseries(...)` table-function
query, the spec-correct way to read metrics via DDSQL.
@platinummonkey platinummonkey requested a review from a team as a code owner June 18, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants