Skip to content

Add Cloud Run worker OpenTelemetry sample - #528

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

Add Cloud Run worker OpenTelemetry sample#528
seanbollin wants to merge 2 commits into
mainfrom
gcp-cloud-run-otel

Conversation

@seanbollin

Copy link
Copy Markdown

Summary

Adds cloud-run-worker/: a long-running Temporal worker for Google Cloud Run worker pools that uses the new contrib/gcp/cloudrun OpenTelemetry plugin to export Core metrics and traces over OTLP/gRPC to a local OpenTelemetry Collector sidecar. Includes the worker + starter, a greeting workflow/activity, an OTel collector config (metrics → googlemanagedprometheus with no batch processor; traces → googlecloud), a Cloud Run worker-pool manifest, a Dockerfile, and a README.

⚠️ Draft — blocked on SDK release

Depends on the unreleased go.temporal.io/sdk/contrib/gcp/cloudrun (and its otlpworker dependency) from temporalio/sdk-go#2588. To keep it buildable locally, go.mod temporarily uses two local replace directives pointing at a sibling sdk-go checkout. Before marking ready:

  • Release contrib/opentelemetry/otlpworker, then contrib/gcp/cloudrun
  • Remove the temporary replace directives from go.mod and pin the released versions
  • Confirm the container build (context = samples repo) resolves the published modules

Related

SDK PR: temporalio/sdk-go#2588. Cross-SDK Cloud Run OTel preview (Go/Java/Python/.NET).

🤖 Generated with Claude Code

seanbollin and others added 2 commits August 19, 2026 15:01
Adds cloud-run-worker/: a long-running Temporal worker for Google Cloud Run
worker pools that uses the contrib/gcp/cloudrun OpenTelemetry plugin to export
Core metrics and traces over OTLP/gRPC to a local OpenTelemetry Collector
sidecar (worker + collector container manifest, Dockerfile, cloudbuild, README).

Note: the SDK module contrib/gcp/cloudrun is not yet released, so go.mod
temporarily uses local replace directives to resolve it against a sibling
sdk-go checkout. Remove those before this is marked ready and pin the released
module versions.

Co-authored-by: Edward Amsden <edward.amsden@temporal.io>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Verified by deploying the sample to Cloud Run:
- Replace the invalid container dependsOn field with the
  run.googleapis.com/container-dependencies annotation (the WorkerPool API
  rejects dependsOn); matches the Java and Python samples.
- Bind the collector health_check on 0.0.0.0:13133 so the Cloud Run startup
  probe can reach it (localhost fails the probe and the instance never starts).
- Bump the module go directive to 1.26.0 to match contrib/gcp/cloudrun.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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