-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Bug description
When running datadog-ci cloud-run instrument with v4.1.2, the instrumentation fails with an INVALID_ARGUMENT error because the dd_sls_ci label contains periods, which violate GCP Cloud Run label format constraints.
Error message:
✖ Instrumenting service [service-name]
Error: Failed to instrument service [service-name]: Error: 3 INVALID_ARGUMENT: labels: At least one label does not conform to GCP naming style. Label value 'v4.1.2' violates format constraints. The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed.
Error: Uninstrumentation failed: Error: 3 INVALID_ARGUMENT: labels: At least one label does not conform to GCP naming style. Label value 'v4.1.2' violates format constraints. The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed.The CLI attempts to add this label to the Cloud Run service:
"labels": {
"dd_sls_ci": "v4.1.2", # ❌ Periods violate GCP constraints
"env": "XXX",
"service": "XXX",
"version": "XXX"
}Root cause: GCP Cloud Run label values can only contain lowercase letters, numeric characters, underscores, and dashes. The version string v4.1.2 contains periods (.), which are not allowed.
Describe what you expected
The CLI should successfully instrument the Cloud Run service with GCP-compliant label values. The dd_sls_ci label should use a format like v4-1-2 (replacing periods with dashes or anything else) instead of v4.1.2.
Steps to reproduce the issue
- Install datadog-ci v4.1.2:
npm install -g @datadog/datadog-ci@4.1.2
- Run Cloud Run instrumentation:
datadog-ci cloud-run instrument \
--project XXX \
--service XXX \
--region us-central1 \
--env XXX \
--version XXX
- Observe the INVALID_ARGUMENT error
Note: This issue did not occur in v4.0.2 and earlier, which did not add the
dd_sls_cilabel.
Additional context
- OS version: macOS (Darwin 25.0.0)
- Node version: 24.5.0
- Package manager: npm
- datadog-ci version: v4.1.2
- GCP Project Type: Cloud Run (2nd gen / Cloud Functions)
Command
None