Skip to content

Commit

Permalink
Auto merge of rust-lang#125771 - Kobzol:ci-datadog-metrics, r=<try>
Browse files Browse the repository at this point in the history
[CI] Upload CI metrics to DataDog

This PR tests integration of Datadog CI custom metrics. My goal is to take various useful statistics (like the duration of stage 1 build, stage 2 build, and test execution) that we already gather into `metrics.json` and upload them as [custom metrics](https://docs.datadoghq.com/continuous_integration/pipelines/custom_commands/) into Datadog, so that we can observe job duration on a more granular level.

r? `@jdno`
  • Loading branch information
bors committed May 31, 2024
2 parents bf8fff7 + 608d825 commit a73c014
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ jobs:
# erroring about invalid credentials instead.
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'

- name: Upload Datadog metrics
if: needs.calculate_matrix.outputs.run_type == 'try'
env:
DATADOG_SITE: datadoghq.com
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
run: |
npm install -g @datadog/datadog-ci
datadog-ci measure --level job --measures "build-duration-test:100"
# This job isused to tell bors the final status of the build, as there is no practical way to detect
# when a workflow is successful listening to webhooks only in our current bors implementation (homu).
outcome:
Expand Down
10 changes: 6 additions & 4 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ pr:
# These jobs automatically inherit envs.try, to avoid repeating
# it in each job definition.
try:
- image: dist-x86_64-linux
env:
CODEGEN_BACKENDS: llvm,cranelift
<<: *job-linux-16c
- image: mingw-check
<<: *job-linux-4c
# - image: dist-x86_64-linux
# env:
# CODEGEN_BACKENDS: llvm,cranelift
# <<: *job-linux-16c

# Main CI jobs that have to be green to merge a commit into master
# These jobs automatically inherit envs.auto, to avoid repeating
Expand Down

0 comments on commit a73c014

Please sign in to comment.