Skip to content

cli: add cost estimate and success logging to tsdump upload #148575

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jordanlewis
Copy link
Member

@jordanlewis jordanlewis commented Jun 19, 2025

This PR adds a cost estimate to the tsdump Datadog upload command to help people understand how much a tsdump upload costs (roughly $.20 per single-node upload, $2 per 10-node upload, or $20 per 100-node upload).

It also adds structured success logging so that it's possible to see historical information about the uploads that were sent to Datadog.

Epic: none
Release note: None

@jordanlewis jordanlewis requested review from a team as code owners June 19, 2025 20:05
@jordanlewis jordanlewis requested review from dhartunian, arjunmahishi, aa-joshi and Abhinav1299 and removed request for a team June 19, 2025 20:05
Copy link

blathers-crl bot commented Jun 19, 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.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis jordanlewis requested review from a team as code owners June 19, 2025 23:37
@jordanlewis jordanlewis changed the title cli: add cost estimate to tsdump upload cli: add cost estimate and success logging to tsdump upload Jun 19, 2025
@jordanlewis
Copy link
Member Author

jordanlewis commented Jun 19, 2025

Hi @aa-joshi @arjunmahishi, I created this PR to help understand overall costs of tsdump uploading in Datadog. Please take a look. The goal is that we should be able to audit the count of tsdump upload requests, the total number of series, and the estimated cost and compare it against what Datadog charges us for the historical ingest.

I also took the opportunity to replace the manually constructed REST API calls with usage of the Datadog Go client. If there's a reason why we weren't using that before, I can certainly back out that part of the change.

@jordanlewis jordanlewis force-pushed the tsdump-upload-cost branch 4 times, most recently from db37ade to a498385 Compare June 20, 2025 05:32
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.

Thanks for Datadog client migration changes!
I have added few suggestions.

This commit adds a cost estimate to the tsdump Datadog upload command to
help people understand how much a tsdump upload costs (roughly $.20 per
single-node upload, $2 per 10-node upload, or $20 per 100-node upload).

Release note: None
Previously, we used raw POST requests in the tsdump uploader. Now, we
use the Datadog API client which is already linked in elsewhere in the
CockroachDB binary, for use in the cockroach workload command.

Epic: none
Release note: None
Upload a log message to Datadog upon completion of a tsdump upload, with
structured information for the count of uploaded timeseries, the
duration, and the estimated cost of the operation.

Epic: none
Release note: None
@jordanlewis
Copy link
Member Author

Thanks for the review! Please take another look.

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.

:lgtm:

Reviewed 4 of 8 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @Abhinav1299, @arjunmahishi, @dhartunian, and @jordanlewis)

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.

3 participants