Skip to content

pkg/cli (tsdump): add interval to metrics before uploading #147316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025

Conversation

arjunmahishi
Copy link
Contributor

@arjunmahishi arjunmahishi commented May 27, 2025

This commit introduces a new interval field to the DatadogSeries struct, representing the interval in seconds.

The interval is encoded in the keys used to store metrics in the TSDB. It can be either 10s or 1800s (30min). Recent metrics use a 10s interval, while older metrics (typically 10 days or older) that have been rolled up use a 30min interval.

Including the interval is crucial because Datadog relies on this information to accurately interpret and display metrics. Without the interval, Datadog may assume a default value, leading to inconsistent or misleading visualizations, especially when zooming in or out on time-series graphs. This behavior can result in discrepancies in reported values across different zoom levels, as Datadog aggregates data differently based on the assumed interval. 

Additionally, this commit adds a new end-to-end test for the tsdump-datadog upload flow. This test runs the tsdump command as a separate process, simulating user behavior, and mocks the Datadog API server to verify the upload functionality and data transformation logic.

Part of: CC-32614
Release note: None

@arjunmahishi arjunmahishi requested review from a team as code owners May 27, 2025 06:24
@arjunmahishi arjunmahishi requested review from alyshanjahani-crl, aa-joshi and Abhinav1299 and removed request for a team May 27, 2025 06:24
Copy link

blathers-crl bot commented May 27, 2025

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@arjunmahishi arjunmahishi changed the title /pkg/cli (tsdump): add interval to metrics before uploading pkg/cli (tsdump): add interval to metrics before uploading May 27, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@arjunmahishi arjunmahishi requested a review from a team as a code owner May 29, 2025 05:30
@arjunmahishi arjunmahishi force-pushed the tsdump-interval branch 3 times, most recently from 2a618b4 to 9ea2b10 Compare May 29, 2025 14:23
Copy link
Contributor

@aa-joshi aa-joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Abhinav1299 and @alyshanjahani-crl)


-- commits line 15 at r1:
It would be good if we can add context about adding time interval in DD upload requests.

This commit introduces a new interval field to the DatadogSeries struct,
representing the interval in seconds.

The interval is encoded in the keys used to store metrics in the TSDB.
It can be either 10s or 1800s (30min). Recent metrics use a 10s
interval, while older metrics (typically 10 days or older) that have
been rolled up use a 30min interval.

Including the interval is crucial because Datadog relies on this
information to accurately interpret and display metrics. Without the
interval, Datadog may assume a default value, leading to inconsistent or
misleading visualizations, especially when zooming in or out on
time-series graphs. This behavior can result in discrepancies in
reported values across different zoom levels, as Datadog aggregates data
differently based on the assumed interval. 

Additionally, this commit adds a new end-to-end test for the
tsdump-datadog upload flow. This test runs the tsdump command as a
separate process, simulating user behavior, and mocks the Datadog API
server to verify the upload functionality and data transformation logic.

Part of: CC-32614
Release note: None
Copy link
Contributor Author

@arjunmahishi arjunmahishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @aa-joshi, @Abhinav1299, and @alyshanjahani-crl)


-- commits line 15 at r1:

Previously, aa-joshi (Akshay Joshi) wrote…

It would be good if we can add context about adding time interval in DD upload requests.

Done

@arjunmahishi
Copy link
Contributor Author

TFTR!
bors r+

@craig
Copy link
Contributor

craig bot commented May 30, 2025

@craig craig bot merged commit 4f24997 into cockroachdb:master May 30, 2025
22 checks passed
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