-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use OpenTelemetry python API; simplify actions
- Loading branch information
Showing
23 changed files
with
802 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: test-artifact-cleanup | ||
# During this workflow, we upload a file that follows the 'telemetry-tools-*' | ||
# After running the clean-up-artifacts action, the artifact should no longer show up | ||
# in the web UI. | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
telemetry-setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Create dummy file | ||
shell: bash | ||
run: echo "Dumbo" > file.txt | ||
- name: Upload dummy file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: telemetry-tools-attrs-1234 | ||
path: file.txt | ||
- name: Clean up telemetry intermediary artifacts | ||
uses: ./telemetry-impls/clean-up-artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: telemetry-dispatch-setup | ||
description: | | ||
This script sets important environment variables that may be used by tools that | ||
implement OpenTelemetry. This script also stores attributes (metadata) for the | ||
current job, so that this metadata can be associated with spans during the final | ||
parsing of job metadata. | ||
This action should be called at the beginning of child workflows, generally as the first | ||
step in any job other than computing the matrix. | ||
inputs: | ||
extra_attributes: | ||
description: "comma-separated key=value attributes to associate with the current job" | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: rapidsai/shared-actions/telemetry-impls/load-then-clone@empty-certs | ||
# overrides loaded value | ||
- name: Set OTEL_SERVICE_NAME from job | ||
uses: ./shared-actions/telemetry-impls/set-otel-service-name | ||
- name: Store attributes to use as metadata when creating spans | ||
# This also sets OTEL_RESOURCE_ATTRIBUTES, for any subsequent steps | ||
# in the calling workflow that might use it. | ||
uses: ./shared-actions/telemetry-impls/stash-job-attributes | ||
with: | ||
extra_attributes: ${{ inputs.extra_attributes }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
name: dispatch-stash-base-env-vars | ||
name: telemetry-dispatch-stash-base-env-vars | ||
description: | | ||
Clones a particular branch/ref of a shared-actions repo, then | ||
call the stash-base-env-vars implementation script, which writes | ||
some environment variables so that downstream jobs can refer to them. | ||
Stores base environment variables in a file and uploads that file | ||
as an artifact. | ||
Inputs here are all assumed to be env vars set outside of this script. | ||
Set them in your main repo's workflows. | ||
This action should only be called once in a build, | ||
at the start of the top-level workflow. All other jobs in the top | ||
level workflow should come after this job. It is generally enough | ||
to have only the checks and devcontainers jobs explicitly depend on | ||
it and have everything else be downstream of them. | ||
runs: | ||
using: 'composite' | ||
steps: | ||
# We can't use the load-then-clone action because the env vars file | ||
# that it needs is something that we create here. | ||
- name: Clone shared-actions repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.SHARED_ACTIONS_REPO || 'rapidsai/shared-actions' }} | ||
ref: ${{ env.SHARED_ACTIONS_REF || 'main' }} | ||
path: ./shared-actions | ||
- name: Get traceparent representation of current workflow | ||
uses: ./shared-actions/telemetry-impls/traceparent | ||
- name: Stash base env vars | ||
uses: ./shared-actions/telemetry-impls/stash-base-env-vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: dispatch-stash-attributes | ||
description: | | ||
Clones a particular branch/ref of a shared-actions repo, then | ||
call the stash-attributes implementation script, which writes | ||
some environment variables so that downstream jobs can refer to them. | ||
Inputs here are all assumed to be env vars set outside of this script. | ||
Set them in your main repo's workflows. | ||
inputs: | ||
extra_attributes: | ||
description: "comma-separated key=value attributes to associate with the current job" | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: rapidsai/shared-actions/telemetry-impls/load-then-clone@empty-certs | ||
- name: Stash current job's OTEL_RESOURCE_ATTRIBUTES | ||
uses: ./shared-actions/telemetry-impls/stash-job-attributes | ||
with: | ||
extra_attributes: ${{ inputs.extra_attributes }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: telemetry-dispatch-summarize | ||
description: | | ||
This action is run in a final job on the top-level workflow, after all other | ||
jobs are completed. This action downloads the JSON records of all jobs from | ||
the current run. It then associates metadata records that were uploaded with | ||
the telemetry-dispatch-stash-job-attributes action with jobs. This is | ||
effectively label metadata. Finally, this action creates OpenTelemetry spans | ||
with the timing and label metadata, and sends it to the configured Tempo | ||
endpoint (or forwarder). | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: rapidsai/shared-actions/telemetry-impls/load-then-clone@empty-certs | ||
- uses: ./shared-actions/telemetry-impls/summarize |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.