Skip to content

Add push-metrics command for Datadog integration#15

Draft
pront wants to merge 3 commits intomainfrom
feat/push-metrics-datadog
Draft

Add push-metrics command for Datadog integration#15
pront wants to merge 3 commits intomainfrom
feat/push-metrics-datadog

Conversation

@pront
Copy link
Copy Markdown
Member

@pront pront commented Apr 15, 2026

Why

We want GitHub project health data in Datadog dashboards — with the ability to slice by any combination of labels, issue types, and state.

What's new

push-metrics reads the SQLite database and pushes per-item metrics to Datadog. Each issue, PR, and discussion becomes a data point at its created_at timestamp, tagged with all its labels. This enables queries like:

github.issues{domain:vrl,type:bug}
github.prs{source:kafka,state:open}
github.issues{issue_type:feature}

Usage

# Preview (default: 2026 data only)
github-tools push-metrics --env-file vector.env --dd-api-key $DD_API_KEY --dry-run

# Push 2025+ data
github-tools push-metrics --env-file vector.env --dd-api-key $DD_API_KEY --since 2025-01-01

# EU region
github-tools push-metrics --env-file vector.env --dd-api-key $DD_API_KEY --dd-site datadoghq.eu

Metrics

Metric What Tags
github.issues 1 per issue at created_at repo, state, issue_type, all labels
github.issues.closed 1 per closed issue at closed_at same
github.prs 1 per PR at created_at repo, state, all labels
github.prs.closed 1 per closed PR at closed_at same
github.discussions 1 per discussion at created_at repo, state, category, answered

Tag format

Labels with a prefix become structured tags:

  • domain: vrldomain:vrl
  • source: kafkasource:kafka
  • type: bugtype:bug
  • sink: s3sink:s3

GitHub issue types: issue_type:bug, issue_type:feature, issue_type:task

Unprefixed labels: label:Epic, label:good first issue

Volume (Vector repo)

Since Series Data points
2026-01-01 (default) 312 1,158
2025-01-01 1,096 4,833

Test plan

  • cargo build compiles cleanly
  • --dry-run shows correct series, tags, and point counts
  • Tags correctly split label prefixes into key:value format
  • Issues carry all their labels as tags simultaneously

🤖 Generated with Claude Code

pront and others added 3 commits April 15, 2026 12:42
Reads summary CSVs and pushes custom metrics to Datadog via the v2
series API. Supports --dry-run to preview without sending.

Metrics pushed:
- github.issues.created/closed (monthly)
- github.prs.created/closed (monthly)
- github.issues.by_type / github.prs.by_type (Bug, Feature, etc.)
- github.issues.by_label / github.prs.by_label (per-label monthly)
- github.issues.total_open/total_closed (current snapshot)
- github.prs.total_open/total_closed (current snapshot)
- github.discussions.created/closed/answered (monthly)

All metrics tagged with repo:{owner}/{name}. Label metrics tagged
with label:{name}, type metrics with issue_type:{name}.

DD_API_KEY can be passed via --dd-api-key or DD_API_KEY env var.
DD_SITE for non-US1 regions via --dd-site or DD_SITE env var.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of pre-aggregated monthly summaries, each issue/PR/discussion
becomes a data point at its created_at timestamp, tagged with ALL its
labels. This enables cross-label queries in Datadog like:
  github.issues{domain:vrl,type:bug}

Label tags use the label prefix as key: "domain: vrl" -> domain:vrl,
"source: kafka" -> source:kafka. Unprefixed labels use label: key.

Defaults to --since 2026-01-01 to keep initial volume small.
312 series / 1,158 points for Vector 2026 data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Makes --dd-api-key optional — reads from DD_API_KEY in the .env file
loaded by --env-file, or from the environment. Same for DD_SITE.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant