Skip to content

[build-tools] Log Gradle cache restore events to Datadog#3674

Merged
AbbanMustafa merged 6 commits intomainfrom
mus/gradle-log
May 6, 2026
Merged

[build-tools] Log Gradle cache restore events to Datadog#3674
AbbanMustafa merged 6 commits intomainfrom
mus/gradle-log

Conversation

@AbbanMustafa
Copy link
Copy Markdown
Contributor

@AbbanMustafa AbbanMustafa commented May 5, 2026

Why

We want to track Gradle cache restore events in Datadog to gain visibility into time benefits across builds/users.

How

  • Added a turtleFetch call in restoreGradleCacheAsync that sends a log to the new /turtle-builds/logs endpoint when Gradle cache is successfully restored
  • Tags the log with build_id, cache_hit_type (direct hit vs prefix match), cache_key, and matched_key
  • Updated service.ts to use the new /turtle-builds/logs route with level: 'error' (replaces /turtle-builds/error-logs)
  • Updated corresponding tests

Test Plan

  • Deploy the www route first so both /logs and /error-logs are available
  • Deploy this change and verify Gradle cache restore logs appear in Datadog with correct build ID tags
  • Clean up legacy /error-logs route in www after rollout

@AbbanMustafa AbbanMustafa added the no changelog PR that doesn't require a changelog entry label May 5, 2026
@AbbanMustafa AbbanMustafa marked this pull request as ready for review May 5, 2026 05:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.51%. Comparing base (3318392) to head (cc41bee).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...ild-tools/src/steps/functions/restoreBuildCache.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3674      +/-   ##
==========================================
- Coverage   56.51%   56.51%   -0.00%     
==========================================
  Files         886      887       +1     
  Lines       38201    38416     +215     
  Branches     7950     8007      +57     
==========================================
+ Hits        21587    21707     +120     
- Misses      16516    16611      +95     
  Partials       98       98              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AbbanMustafa AbbanMustafa requested a review from sjchmiela May 5, 2026 12:33
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

);

try {
await turtleFetch(new URL('turtle-builds/logs', expoApiServerURL).toString(), 'POST', {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't this be a metric, not a log?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i want to tag by build id 💸💸💸🤫

@AbbanMustafa AbbanMustafa merged commit daa4c60 into main May 6, 2026
10 checks passed
@AbbanMustafa AbbanMustafa deleted the mus/gradle-log branch May 6, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants