Skip to content

Add GCP OpenTelemetry Cloud Run worker sample#789

Draft
eamsden wants to merge 1 commit into
mainfrom
eamsden/gcp-cloud-run-otel-sample
Draft

Add GCP OpenTelemetry Cloud Run worker sample#789
eamsden wants to merge 1 commit into
mainfrom
eamsden/gcp-cloud-run-otel-sample

Conversation

@eamsden

@eamsden eamsden commented Jul 17, 2026

Copy link
Copy Markdown

What changed

  • Add a Java sample that runs a continuously polling Temporal worker in a Cloud Run worker pool.
  • Configure GcpOpenTelemetryPlugin to export standard OTLP/gRPC to a Google-Built OpenTelemetry Collector sidecar on localhost:4317.
  • Export cumulative metrics directly to Google Managed Service for Prometheus without collector batching, while retaining a dedicated five-second trace batch and the supported Telemetry API path.
  • Add a worker-pool manifest with collector startup dependency and health probes, Secret Manager-backed collector configuration, bounded worker shutdown, and post-termination telemetry flushing.
  • Document required Google Cloud APIs, least-privilege runtime IAM, deployment, signal verification, the coordinated 60-second SDK default, custom interval constraints, and shutdown verification.

Validation

  • Clean Gradle build and installDist passed against immutable sdk-java commit 4bc57576, including the workflow test and a regression assertion for the 60-second plugin default.
  • otelcol-google:0.156.0 validate accepted collector-config.yaml.
  • Both YAML files parse successfully and git diff --check passes.
  • Docker BuildKit's static Dockerfile check completed with no warnings.
  • The related SDK Cloud Run worker-pool E2E verified the same 60-second cadence, unbatched cumulative-metrics pipeline, dedicated trace batch, workflow execution, telemetry export, and clean shutdown without duplicate-series or exporter errors. This sample was not separately deployed because the SDK artifact is not yet published.

Expected blocker

io.temporal:temporal-gcp is unreleased. The sample intentionally uses 1.37.0-SNAPSHOT as a placeholder and supports Gradle composite substitution for local verification. A normal Maven Central build and the production Docker build remain blocked until the first release containing the module; this PR should remain draft until that dependency can be replaced with the released version.

The draft PR's unit checks confirm this expected state: they reach :gcp-opentelemetry:compileJava and fail only because Maven Central does not contain the temporal-sdk, temporal-envconfig, or temporal-gcp 1.37.0-SNAPSHOT artifacts. Formatting, wrapper validation, dependency submission, SAST, and CLA checks pass.

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