Skip to content

OpenTelemetry common-core refactor - #844

Merged
eamsden merged 7 commits into
mainfrom
ea/pr831-otel-refactor
Aug 18, 2026
Merged

OpenTelemetry common-core refactor#844
eamsden merged 7 commits into
mainfrom
ea/pr831-otel-refactor

Conversation

@eamsden

@eamsden eamsden commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What was changed

  • Added the experimental Temporalio.Extensions.Gcp.CloudRun.OpenTelemetry package for Temporal workers running on Google Cloud Run (by @seanbollin).
  • Moved lightweight provider-neutral configuration into Temporalio.Extensions.OpenTelemetry, including resolved options, Temporal runtime metrics, interceptor insertion, and bounded force-flush/task orchestration.
  • Kept the full OpenTelemetry SDK and OTLP exporter dependencies provider-local. AWS Lambda owns the shared tracer-provider factory source, and Cloud Run links that source into its own assembly.
  • Kept AWS X-Ray trace IDs and Lambda shutdown-hook behavior in AWS, and Cloud Run environment fallbacks, defaults, and its returned shutdown handle in GCP.
  • Consolidated duplicated test support and serialized environment-variable tests across the AWS and GCP test classes.

Why?

The AWS Lambda and GCP Cloud Run extensions had near-identical OpenTelemetry setup and shutdown implementations. Sharing the provider-neutral behavior reduces maintenance and drift without making the full OpenTelemetry SDK/exporter dependency graph transitive for users of the lightweight Temporalio.Extensions.OpenTelemetry package.

Checklist

  1. How was this tested:
    • 19 focused AWS Lambda, Cloud Run, and shared OpenTelemetry configuration tests passed.
    • The shared package built for netstandard2.0 and net462; both provider packages and the test assembly built with 0 warnings and 0 errors.
    • Formatting verification passed for all four affected projects.
    • Debug packing passed for the shared, AWS, and GCP OpenTelemetry packages. The generated shared-package manifest contains only Temporalio, OpenTelemetry.Api, and System.Diagnostics.DiagnosticSource; the full SDK and OTLP exporter are dependencies only of the provider packages.
  2. Any docs updates needed?
    • The Cloud Run package README includes shutdown guidance, the public GCP assembly is included in generated API documentation, and the changelog entry mentions the shared configuration layer.

@eamsden
eamsden force-pushed the ea/pr831-otel-refactor branch from d6c9223 to 901e5a6 Compare August 17, 2026 22:40
@eamsden
eamsden marked this pull request as ready for review August 17, 2026 23:38
@eamsden
eamsden requested a review from a team as a code owner August 17, 2026 23:38
Comment thread src/Temporalio.Extensions.OpenTelemetry/OpenTelemetryConfiguration.cs Outdated
Comment thread src/Temporalio.Extensions.OpenTelemetry/OpenTelemetryConfiguration.cs Outdated
@jmaeagle99 jmaeagle99 self-assigned this Aug 17, 2026
Comment thread src/Temporalio.Extensions.Gcp.CloudRun.OpenTelemetry/README.md Outdated
@eamsden
eamsden merged commit dcf7ca3 into main Aug 18, 2026
16 checks passed
@eamsden
eamsden deleted the ea/pr831-otel-refactor branch August 18, 2026 22:38
seanbollin added a commit to temporalio/sdk-java that referenced this pull request Aug 27, 2026
Adds a Cloud Run serverless-worker OpenTelemetry integration, mirroring the
approved .NET SDK common-core refactor (temporalio/sdk-dotnet#844) and building
on #2955.

- New module temporal-gcp-cloud-run (io.temporal.gcp.cloudrun): a
  CloudRunOpenTelemetryPlugin that exports Core metrics and tracing spans over
  OTLP/gRPC to a local OpenTelemetry Collector sidecar. Cloud Run specifics only
  (service name from CLOUD_RUN_WORKER_POOL/K_SERVICE, 60s report interval,
  deferred shutdown flush); depends only on temporal-opentelemetry, no Google
  client libraries.
- Extract a shared OpenTelemetryWorker.resolveServiceName(env, default,
  fallbackEnvVars...) into the provider-neutral core and add
  OpenTelemetryPlugin.Builder.getMetricsReportInterval() (both additive).
- Refactor the AWS Lambda OtelLambdaWorkerConfigurationHelper onto the shared
  resolver with no public API or behavior change (existing tests unmodified).

Co-authored-by: Edward Amsden <edward.amsden@temporal.io>
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.

3 participants