Open jmeickle-theaiinstitute opened 7 months ago
Hi @jmeickle-theaiinstitute ! There are some limitations around adding custom tags to GitHub jobs.
We have some docs related to this. The TLDR is that if the job name is changed using the name
property OR you're using a matrix strategy to define jobs you need to make expose a DD_GITHUB_JOB_NAME
env variable pointing to the real job name.
Could this be whats going on here? 👀
datadog-ci tag --level job --tags pr_owner:<REDACTED>
shell: /usr/bin/bash -e {0}
env:
PR_COMMENTS_ENABLED: false
TAG: <REDACTED>
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
DD_ENV: ci
DD_SERVICE: fullstack
DD_API_KEY: ***
DD_GITHUB_JOB_NAME: Run e2e tests / Run E2E desktop on node 0
DD_TAGS: pr_owner:<REDACTED>
DATADOG_API_KEY: ***
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 59.2M 100 59.2M 0 0 [8]<REDACTED>
Tags sent
I've tried every possible combination of job name appearing anywhere in datadog or CICD. It's also silently failing to send tags to jobs which are not part of a matrix run. Both when tags are set as env variables, and when tags are attempted to be sent via datadog-ci, regardless of whether DD_GITHUB_JOB_NAME is provided or not provided.
[edit] Worth noting, my jobs are part of a reusable workflow triggered by a parent job
Hi @benjamin-cribb-jane , we recently had a bug that caused GitHub jobs' custom tags not to be added. We think that what might've happened is this:
DD_GITHUB_JOB_NAME
variable.DD_GITHUB_JOB_NAME
variable and it didn't work (likely due to the bug introduced at step 2).DD_GITHUB_JOB_NAME
variable?Hopefully it works now! 🤞
hey did you try those steps @benjamin-cribb-jane ? 😄
Hey there,
I'm experiencing similar issues to what's been described here.
To be specific, I'm not really seeing tags come through at the job level at all, though pipeline tags seem to work fine. I tried adding the DD_GITHUB_JOB_NAME
environment variable described above as the job name is dynamic. This is what my (reduced) GitHub Actions YAML looks like:
jobs:
build:
name: Build ${{ inputs.service }}
env:
DD_GITHUB_JOB_NAME: Build ${{ inputs.service }}
steps:
- name: Datadog CI tags
run: datadog-ci tag --level job --tags pod_name:${{ runner.name }}
In case the detail matters, technically the datadog-ci
calls are being made from a GitHub Actions composite action. The output looks like this:
Run datadog-ci tag --level job --tags pod_name:gha-runner-large-dgflp-44nnq
datadog-ci tag --level job --tags pod_name:gha-runner-large-dgflp-44nnq
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
DD_GITHUB_JOB_NAME: Build admin-api
Tags sent
But if I go into Metrics Explorer, select the "CI Pipelines" dataset, set the "Level" to "Job", and open the "by" field I can see pod_name
as an option, but if I select it nothing shows up in the graph. And if I filter with the value from the output above (e.g. pod_name:gha-runner-large-dgflp-44nnq
) nothing shows up for any time interval.
In case it helps, my org ID is splice
.
Please let me know if you have any suggestions, thank you!
Bug description
In Github Actions, when running this command in a job:
The Github Actions step output is:
(That is, it runs twice successfully)
This is a case where we have one pipeline with two parallel jobs, both running these tagging commands. Using the example above,
repro
shows up as a tag on the pipeline butjobrepro
does not show up as a tag on the job (in any run).Describe what you expected
Either the
datadog-ci
tool should tag the data, or it should fail if this is an invalid usageSteps to reproduce the issue
No response
Additional context
v2.33.1 of
datadog-ci
Command
tag