Skip to content

Add Database Monitoring (DBM) query samples support #184

@veeshpath

Description

@veeshpath

Feature Request

Add support for querying Datadog Database Monitoring (DBM) query samples via pup.

Context

pup covers aggregated DBM metrics (mysql.queries.*) well, but the per-sample data — including trace tags parsed from SQL comments — is only accessible through the DD web UI.

What's Missing

DBM query samples contain metadata not available in aggregated metrics:

  • @trace.tags.* — application-level context (job name, source file, line number) extracted from SQL comments
  • Full (non-normalized) SQL text
  • Per-sample execution plan and timing

Proposed Commands

# Search query samples
pup dbm samples search --query "database_instance:my-db @trace.tags.job:*" --from 1h --limit 10

# Aggregate samples
pup dbm samples aggregate --query "database_instance:my-db" --group-by "@trace.tags.job" --compute "avg:@duration"

Use Case

Building CLI tooling for query performance investigation. The aggregated metrics tell us which queries are slow, but the trace tags tell us where in the application they come from. Currently requires switching to the DD web UI to bridge that gap.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions