Skip to content

Add Google Cloud Run OpenTelemetry worker sample - #353

Draft
seanbollin wants to merge 5 commits into
mainfrom
gcp-cloud-run-otel
Draft

seanbollin wants to merge 5 commits into
mainfrom
gcp-cloud-run-otel

Conversation

@seanbollin

@seanbollin seanbollin commented Aug 19, 2026

Copy link
Copy Markdown

Runs a Temporal Worker on a Google Cloud Run worker pool using the Cloud Run OpenTelemetry plugin (temporalio.contrib.gcp.cloud_run.opentelemetry), exporting Temporal Core metrics and traces over OTLP to a Google-Built OpenTelemetry Collector sidecar.

Deploy with the gcloud flow in gcp/cloud_run/opentelemetry/README.md (build the image, then gcloud run worker-pools replace /tmp/worker-pool.yaml), then start a Workflow from the repo root:

uv run --group gcp-cloud-run-opentelemetry python -m gcp.cloud_run.opentelemetry.starter

Uses the released temporalio[cloud-run-worker-otel]>=1.33.0 from PyPI.

seanbollin and others added 4 commits September 18, 2026 10:27
Adds gcp_cloud_run/: a long-running Temporal worker for Google Cloud Run worker
pools that uses the temporalio.contrib.gcp.cloud_run OpenTelemetryPlugin to
export Core metrics and traces over OTLP/gRPC to a local OpenTelemetry Collector
sidecar (worker, workflow, starter, collector-config.yaml, worker-pool.yaml,
Dockerfile, README).

Note: the cloud-run-worker-otel SDK extra is not yet released, so pyproject.toml
temporarily uses an editable local path source to resolve temporalio against a
sibling sdk-python checkout. Replace it with a released
temporalio[cloud-run-worker-otel] and regenerate uv.lock before this is marked
ready.

Co-authored-by: Edward Amsden <edward.amsden@temporal.io>
Make TEMPORAL_API_KEY optional and enable TLS only when an API key is present,
so the sample connects to a plaintext dev server or self-hosted cluster, not
just Temporal Cloud (matches the Go and Java samples). Verified by deploying to
Cloud Run against a dev server.
Move the sample from gcp_cloud_run/ to gcp/cloud_run/opentelemetry/ (and
its test to tests/gcp/cloud_run/opentelemetry/) so the layout mirrors the
now-merged SDK package temporalio.contrib.gcp.cloud_run.opentelemetry and
leaves room for additional Cloud Run samples (e.g. worker ID) under
gcp/cloud_run/.

- Fix the plugin import to temporalio.contrib.gcp.cloud_run.opentelemetry.
- Update internal imports to gcp.cloud_run.opentelemetry.*.
- Add package __init__.py at the new gcp/ and gcp/cloud_run/ levels.
- Fix the local uv source path depth, Dockerfile package path/CMD, README
  paths, and rename the dependency group to gcp-cloud-run-opentelemetry.
@seanbollin seanbollin changed the title Add Cloud Run worker OpenTelemetry sample Add Google Cloud Run OpenTelemetry worker sample Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant