Skip to content

pkg/cli: map sys_uptime to sys.uptime.count in tsdump datadog upload#169738

Open
aa-joshi wants to merge 1 commit intocockroachdb:masterfrom
aa-joshi:tsdump_uptime_metrics
Open

pkg/cli: map sys_uptime to sys.uptime.count in tsdump datadog upload#169738
aa-joshi wants to merge 1 commit intocockroachdb:masterfrom
aa-joshi:tsdump_uptime_metrics

Conversation

@aa-joshi
Copy link
Copy Markdown
Contributor

@aa-joshi aa-joshi commented May 5, 2026

The sys.uptime metric is emitted with different names and types depending on the ingestion pipeline:

  • CRDB -> Datadog agent -> Datadog: emits sys.uptime.count as a count.
  • Cockroach Cloud CRDB -> OTel -> Datadog: emits sys.uptime as a gauge.
  • CRDB -> tsdump -> Datadog: emits sys.uptime as a count.

Datadog expects a single metric type per metric name. When tsdump uploads sys.uptime as a count, it conflicts with the gauge variant from the OTel pipeline, causing inconsistent metric evaluation.

The auto-generated Datadog metric mapping (cockroachdb_datadog_metrics.yaml) maps sys_uptime to sys.uptime, matching the Datadog integration's own naming. Since that file is generated at build time from the upstream Datadog integration source, the fix cannot go there.

Instead, add a tsdump-specific name override that takes precedence over the generated mapping. This emits the metric as sys.uptime.count, giving a clear distinction between the counter and gauge variants. Long term we should standardize the metric type across all CRDB ingestion pipelines.

Epic: None
Release note: None

The sys.uptime metric is emitted with different names and types
depending on the ingestion pipeline:

- CRDB -> Datadog agent -> Datadog: emits sys.uptime.count as a count.
- Cockroach Cloud CRDB -> OTel -> Datadog: emits sys.uptime as a gauge.
- CRDB -> tsdump -> Datadog: emits sys.uptime as a count.

Datadog expects a single metric type per metric name. When tsdump
uploads sys.uptime as a count, it conflicts with the gauge variant
from the OTel pipeline, causing inconsistent metric evaluation.

The auto-generated Datadog metric mapping (cockroachdb_datadog_metrics.yaml)
maps sys_uptime to sys.uptime, matching the Datadog integration's own
naming. Since that file is generated at build time from the upstream
Datadog integration source, the fix cannot go there.

Instead, add a tsdump-specific name override that takes precedence over
the generated mapping. This emits the metric as sys.uptime.count,
giving a clear distinction between the counter and gauge variants.
Long term we should standardize the metric type across all CRDB
ingestion pipelines.

Epic: None
Release note: None
@aa-joshi aa-joshi requested review from a team as code owners May 5, 2026 12:25
@aa-joshi aa-joshi requested review from alyshanjahani-crl and arjunmahishi and removed request for a team May 5, 2026 12:25
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 5, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@aa-joshi aa-joshi changed the title Tsdump uptime metrics pkg/cli: map sys_uptime to sys.uptime.count in tsdump datadog upload May 5, 2026
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.

2 participants