Skip to content

opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools and instances, prefer K_CONFIGURATION over FUNCTION_TARGET, and clean up #5352 - #5363

Open
DylanRussell wants to merge 4 commits into
open-telemetry:mainfrom
DylanRussell:fix-gcp-resourcedetector-cloud-run
Open

DylanRussell wants to merge 4 commits into
open-telemetry:mainfrom
DylanRussell:fix-gcp-resourcedetector-cloud-run

Conversation

@DylanRussell

@DylanRussell DylanRussell commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #5352 in opentelemetry-resourcedetector-gcp (matching open-telemetry/opentelemetry-go-contrib#10350 and open-telemetry/opentelemetry-java-contrib#3233):

  • Check K_CONFIGURATION before FUNCTION_TARGET: Cloud Run functions (gcloud run deploy --function) and Cloud Functions (2nd gen) both run as Cloud Run services and set both K_CONFIGURATION and FUNCTION_TARGET, whereas Cloud Functions (1st gen) only sets FUNCTION_TARGET.
  • Add Cloud Run worker pool detection: detects CLOUD_RUN_WORKER_POOL and optional CLOUD_RUN_REVISION (faas.version) per the worker pools contract as gcp_cloud_run with cloud.resource_id=//run.googleapis.com/projects/{project}/locations/{region}/workerPools/{name}.
  • Add Cloud Run instance detection: detects CLOUD_RUN_INSTANCE (docs) as gcp_cloud_run with cloud.resource_id=//run.googleapis.com/projects/{project}/locations/{region}/instances/{name}.
  • Cleanups from opentelemetry-resourcedetector-gcp: populate cloud.resource_id and detect Cloud Run Jobs #5352: drop redundant project_id parameter on _make_resource, update stale _faas.py reference comment to opentelemetry-go-contrib, and clarify .changelog/5352.added.

Tested live on GCP across Cloud Run services, jobs, worker pools, instances, and functions.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (Cloud Functions 2nd gen now reports cloud.platform=gcp_cloud_run instead of gcp_cloud_functions)

Checklist:

  • I am a human and not a bot
  • I have run tox -e precommit
  • I have run tox -e typecheck
  • I have run the relevant tests and linting tox environments

…efer K_CONFIGURATION over FUNCTION_TARGET, and clean up open-telemetry#5352
@DylanRussell
DylanRussell requested a review from a team as a code owner November 19, 2026 19:26
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-19 21:36 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@DylanRussell DylanRussell changed the title opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools, prefer K_CONFIGURATION over FUNCTION_TARGET, and clean up #5352 opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools, prefer K_CONFIGURATION over FUNCTION_TARGET, and clean up #5352 Nov 19, 2026
@DylanRussell DylanRussell changed the title opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools, prefer K_CONFIGURATION over FUNCTION_TARGET, and clean up #5352 opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools, instances, and Vertex AI Agent Engine; prefer K_CONFIGURATION over FUNCTION_TARGET Nov 19, 2026
@DylanRussell
DylanRussell force-pushed the fix-gcp-resourcedetector-cloud-run branch from a0e1f1d to 7472d07 Compare November 19, 2026 21:30
@DylanRussell DylanRussell changed the title opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools, instances, and Vertex AI Agent Engine; prefer K_CONFIGURATION over FUNCTION_TARGET opentelemetry-resourcedetector-gcp: detect Cloud Run worker pools and instances, prefer K_CONFIGURATION over FUNCTION_TARGET, and clean up #5352 Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant