Skip to content

Commit

Permalink
upload job info if debug mode set
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Nov 13, 2024
1 parent 2ac444d commit 4a44423
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8,994 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/test-child-workflow.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/test-telemetry-setup.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream
# This workflow is meant to imitate the behavior of RAPIDS project PR workflows, such as


Expand Down Expand Up @@ -91,3 +92,5 @@ jobs:
echo "Verify that job names (also called service name) are correct"
job_names="$(jq -c '[.batches[].resource.attributes[] | select(.key == "service.name") | .value.stringValue] | unique' trace_record.json)"
[ "$job_names" = '["child-workflow / Jobby McJobface (with)","child-workflow / Jobby McJobface (without)","test-telemetry plus something"]' ] || exit 1
=======
>>>>>>> Stashed changes
7 changes: 3 additions & 4 deletions telemetry-dispatch-write-summary/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Clone/checkout specific fork/ref of shared-actions repo and call its _telemetry-finalize-root-span script'
name: Dispatch to summarize
description: |
The purpose of this wrapper is to keep it easy for external consumers to switch branches of
the shared-actions repo when they are changing something about shared-actions and need to test it
Expand All @@ -7,7 +7,8 @@ description: |
This script is meant to be standalone in that it should not require external inputs from
consumers. Consumers may set SHARED_ACTIONS_REPO and SHARED_ACTIONS_REF to test changes
in their customized shared-actions repo, but they should not add inputs to those scripts.
Instead, they should add those inputs to the variables that get stashed in _stash-base-env-vars.
Instead, they should add those inputs to the variables that get stashed in
telemetry-impls/stash-base-env-vars.
inputs:
cert_concat:
description: Concatenation of certs (CA;Client;ClientKey)
Expand All @@ -16,8 +17,6 @@ inputs:
Additional attributes to add to OTEL_RESOURCE_ATTRIBUTES.
See https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_resource_attributes

Do not include any leading or trailing join characters (,)

runs:
using: 'composite'
steps:
Expand Down
25 changes: 19 additions & 6 deletions telemetry-impls/github-actions-job-info/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: 'Github Actions Job info'
description: 'Outputs a trace identifier computed from the GitHub runtime environment. Requires the gha-tools repo to be on PATH.'
outputs:
job-info:
description: 'A JSON blob that contains job metadata, including name, start/stop time, and steps info. This is seemingly the only programmatic access to the job name.'
value: ${{ toJSON(steps.get-job-info.outputs.job_info_json) }}
description: |
Obtains job metadata from the GitHub Actions API.
Provides this as a file on disk, job_info.json.
runs:
using: 'composite'
Expand All @@ -26,6 +24,16 @@ runs:
per_page: 100
});
const jobs = await github.paginate(opts);
if (core.getBooleanInput('debug') || core.isDebug()) {
try {
fs.writeFileSync('all_jobs.json', JSON.stringify(jobs));
} catch(err) {
console.error(err)
throw(err)
}
}
// We know what the run ID is, but we don't know which specific job we're being run from.
// https://github.com/orgs/community/discussions/8945
return jobs.find((job) => {
Expand Down Expand Up @@ -55,10 +63,15 @@ runs:
throw "Telemetry values were not available. Please see debug logs for more info."
}
core.setOutput("job_info_json", this_job);
try {
fs.writeFileSync('job_info.json', JSON.stringify(this_job));
} catch(err) {
console.error(err)
throw(err)
}
- name: Upload job_info_json if in debug mode
if: runner.debug == '1'
uses: actions/upload-artifact@v4
with:
name: github-job-info
path: all_jobs.json
Loading

0 comments on commit 4a44423

Please sign in to comment.