Skip to content

Add plugin hooks for activity and Nexus clients - #3082

Draft
patbeqo wants to merge 1 commit into
patbeqo/otel-v2-workflow-prerequisitesfrom
patbeqo/otel-v2-workflow-prerequisites-2
Draft

patbeqo wants to merge 1 commit into
patbeqo/otel-v2-workflow-prerequisitesfrom
patbeqo/otel-v2-workflow-prerequisites-2

Conversation

@patbeqo

@patbeqo patbeqo commented Sep 16, 2026

Copy link
Copy Markdown

What changed?

  • Added experimental ActivityClientPlugin and NexusClientPlugin, propagated from the service stubs to ActivityClient and NexusClient the same way ScheduleClientPlugin reaches the schedule client, with setPlugins/getPlugins on ActivityClientOptions and NexusClientOptions.
  • SimplePlugin implements both, and its builder gained addScheduleClientInterceptors, addActivityClientInterceptors, and addNexusClientInterceptors. configureScheduleClient now applies its interceptors instead of being a no-op, so plugins no longer need configure* overrides to install interceptors on any client.
  • Replaced the three hand-rolled plugin extraction loops with PluginUtils.extractPlugins, which the two new sites also use.
  • StartNexusOperationExecutionInput now copies headers into a mutable, case-insensitive map, matching ExecuteNexusOperationInput, so header-adding interceptors can populate it in place as its javadoc describes. Previously it kept the caller's Collections.emptyMap().
  • Added coverage for propagation of the new hooks from the service stubs, the builder helpers, and plugin copying on both options classes.

Why?

The OpenTelemetry v2 plugin (#3046) traces every client-side operation Go does, but standalone activities and client-started Nexus operations had no plugin hook to install an interceptor through, and the schedule hook had no builder helper. This is the second prerequisite slice, stacked on #3049.

Breaking changes?

None. The public APIs are additive and experimental.

Server PR

None.

Test plan

  • ./gradlew :temporal-sdk:test --tests 'io.temporal.common.*' --tests 'io.temporal.client.*'
  • ./gradlew :temporal-sdk:test -PtestServer=dev-server --tests 'io.temporal.client.nexus.*' --tests 'io.temporal.client.functional.StandaloneActivityTest' --tests 'io.temporal.client.schedules.*' --tests 'io.temporal.common.PluginPropagationTest'
  • ./gradlew :temporal-sdk:spotlessCheck
  • ./gradlew :temporal-sdk:javadoc

@patbeqo
patbeqo added this pull request to stack #3083 September 16, 2026 22:06
@patbeqo
patbeqo force-pushed the patbeqo/otel-v2-workflow-prerequisites-2 branch from 58542ea to 49a89cd Compare September 17, 2026 17:26
@patbeqo

patbeqo commented Sep 17, 2026

Copy link
Copy Markdown
Author

@codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-17T17:30:16.141835Z 49a89cd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 49a89cd802

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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