Skip to content

Add Cloud Run OpenTelemetry worker sample - #792

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

seanbollin wants to merge 8 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 (io.temporal:temporal-gcp-cloud-run-opentelemetry), exporting SDK metrics and traces over OTLP to a Google-Built OpenTelemetry Collector sidecar.

Build locally: ./gradlew -PtemporalSdkPath=/path/to/sdk-java :gcp:cloud-run:opentelemetry:build. Deploy: gcloud run worker-pools replace gcp/cloud-run/opentelemetry/worker-pool.yaml --project="$PROJECT_ID".

The module is unreleased, so the sample builds against a local SDK checkout via composite build (default ../sdk-java); CI stays red until it ships.

seanbollin and others added 7 commits September 18, 2026 10:29
Adds cloud-run-worker/: a long-running Temporal worker for Google Cloud Run
worker pools that uses the temporal-gcp-cloud-run CloudRunOpenTelemetryPlugin to
export Core metrics and traces over OTLP/gRPC to a local OpenTelemetry Collector
sidecar (worker, greeting workflow/activities, collector-config.yaml,
worker-pool.yaml, Dockerfile, README).

Note: the SDK module temporal-gcp-cloud-run is not yet released, so the sample
resolves it via the existing -PtemporalSdkPath composite build against a local
sdk-java checkout. Bump javaSDKVersion to the release that ships the module
before this is marked ready.

Co-authored-by: Edward Amsden <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Move the sample from cloud-run-worker/ to gcp/cloud-run/opentelemetry/ so
the layout mirrors the merged SDK module (io.temporal:temporal-gcp-cloud-run,
package io.temporal.gcp.cloudrun) and matches the other SDKs' Cloud Run
samples, leaving room for additional Cloud Run samples (e.g. worker ID)
under gcp/cloud-run/.

- Gradle project path :cloud-run-worker -> :gcp:cloud-run:opentelemetry
  (settings.gradle), with applicationName pinned to cloud-run-worker so the
  installDist launcher name (and the Dockerfile) stay stable.
- Java package io.temporal.samples.cloudrun -> io.temporal.samples.gcp.cloudrun,
  mirroring the SDK's io.temporal.gcp.cloudrun.
- Update the Dockerfile gradle task/paths, build.gradle mainClass, and the
  sample and root README paths.

Verified with the composite build against a local sdk-java checkout:
`:gcp:cloud-run:opentelemetry:test` and `:installDist` both pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Move the sample's Java sources into the io.temporal.samples.gcp.cloudrun.opentelemetry package (mirroring the gcp/cloud-run/opentelemetry module path and the sibling workerid sample), and point the dependency and imports at the renamed temporal-gcp-cloud-run-opentelemetry SDK plugin.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@seanbollin seanbollin changed the title Add Cloud Run worker OpenTelemetry sample Add 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.

2 participants