Skip to content

Commit 41f4f29

Browse files
authored
Fix: Add workflow name to telemetry resource attributes (#493)
This PR adds the workflow name to the OpenTelemetry resource attributes in the collector configuration. This fixes the issue where GEMINI_CLI_WORKFLOW_NAME is null in metric events for customer-triggered runs. Closes #492
1 parent 642deeb commit 41f4f29

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ runs:
456456
-e "s#GITHUB_RUN_ID_PLACEHOLDER#${GITHUB_RUN_ID}#g" \
457457
-e "s#GITHUB_PR_NUMBER_PLACEHOLDER#${GITHUB_PR_NUMBER}#g" \
458458
-e "s#GITHUB_ISSUE_NUMBER_PLACEHOLDER#${GITHUB_ISSUE_NUMBER}#g" \
459+
-e "s#GITHUB_WORKFLOW_PLACEHOLDER#${GH_WORKFLOW_NAME}#g" \
459460
"${GITHUB_ACTION_PATH}/scripts/collector-gcp.yaml.template" > ".gemini/collector-gcp.yaml"
460461
461462
# Ensure credentials file has the right permissions
@@ -508,6 +509,7 @@ runs:
508509
GITHUB_RUN_ID: '${{ github.run_id }}'
509510
GITHUB_PR_NUMBER: '${{ inputs.github_pr_number }}'
510511
GITHUB_ISSUE_NUMBER: '${{ inputs.github_issue_number }}'
512+
GH_WORKFLOW_NAME: '${{ steps.sanitize_workflow_name.outputs.gh_workflow_name }}'
511513

512514
branding:
513515
icon: 'terminal'

scripts/collector-gcp.yaml.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ processors:
1818
- key: 'github.issue.number'
1919
value: 'GITHUB_ISSUE_NUMBER_PLACEHOLDER'
2020
action: 'upsert'
21+
- key: 'github.workflow'
22+
value: 'GITHUB_WORKFLOW_PLACEHOLDER'
23+
action: 'upsert'
2124
batch:
2225
send_batch_size: 100
2326
timeout: '10s'

0 commit comments

Comments
 (0)