Problem
The GEMINI_CLI_WORKFLOW_NAME (or github_workflow_name) is consistently appearing as null in metric events for customer-triggered runs of the run-gemini-cli action.
Findings
During investigation of the telemetry flow, we found two reasons why this field is missing:
- Missing from Collector Config (Action Repo): In
action.yml and scripts/collector-gcp.yaml.template, we explicitly inject repository, run ID, PR number, and issue number into the telemetry data using sed replacements. However, there is no entry for the workflow name in this list, so it doesn't get added by the collector.
- Missing from CLI's Common Attributes (CLI Repo): The CLI's OpenTelemetry SDK initialization in
sdk.ts (and getCommonAttributes in telemetryAttributes.ts) does not include the workflow name in the resource attributes. It only includes session ID, installation ID, and interactive mode.
Proposed Solutions
- Option A: Update
collector-gcp.yaml.template and action.yml in the action repo to inject the workflow name as a resource attribute (e.g., github.workflow). This is preferred as it doesn't require a CLI release.
- Option B: Modify the CLI codebase (
sdk.ts) to read GH_WORKFLOW_NAME from the environment and add it to the OpenTelemetry resource attributes.
Problem
The
GEMINI_CLI_WORKFLOW_NAME(orgithub_workflow_name) is consistently appearing asnullin metric events for customer-triggered runs of therun-gemini-cliaction.Findings
During investigation of the telemetry flow, we found two reasons why this field is missing:
action.ymlandscripts/collector-gcp.yaml.template, we explicitly inject repository, run ID, PR number, and issue number into the telemetry data usingsedreplacements. However, there is no entry for the workflow name in this list, so it doesn't get added by the collector.sdk.ts(andgetCommonAttributesintelemetryAttributes.ts) does not include the workflow name in the resource attributes. It only includes session ID, installation ID, and interactive mode.Proposed Solutions
collector-gcp.yaml.templateandaction.ymlin the action repo to inject the workflow name as a resource attribute (e.g.,github.workflow). This is preferred as it doesn't require a CLI release.sdk.ts) to readGH_WORKFLOW_NAMEfrom the environment and add it to the OpenTelemetry resource attributes.