Skip to content

Report Kotlin and Graal runtimes in worker heartbeats - #3123

Open
Quinn-With-Two-Ns wants to merge 2 commits into
mainfrom
add-worker-runtime-telemetry
Open

Quinn-With-Two-Ns wants to merge 2 commits into
mainfrom
add-worker-runtime-telemetry

Conversation

@Quinn-With-Two-Ns

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

Report Kotlin and Graal runtimes in worker heartbeats — preserve JVM version reporting, add Graal native-image detection, and report Kotlin with its runtime version when a directly registered workflow or activity implementation has Kotlin metadata.

Why?

Report which language runtimes a worker uses alongside its existing JVM environment information. Detection is best effort any failure does not block registration or reporting. Kotlin detection is scoped per worker rather than based on classpath presence. Existing environment-info opt-out and retry-until-accepted behavior are preserved.

Server PR

API dependency: temporalio/api#880. No coordinated server PR is required by the SDK reporting changes; these use the existing worker-heartbeat environment runtime fields.

Validation

  • ./gradlew --offline spotlessApply completed.
  • All 11 WorkerEnvironmentInfoTest unit tests passed.
  • All 67 temporal-kotlin tests passed, including six new registration-to-heartbeat tests.
  • SDK WorkerHeartbeat* test invocation completed; 13 existing heartbeat tests were skipped by the default in-memory server configuration.
  • git diff --check passed.

Note

Low Risk
Telemetry-only additions to worker heartbeats with best-effort detection and existing opt-out; no changes to task execution or public API signatures.

Overview
Worker heartbeats can now include Graal native-image and Kotlin runtimes in the one-shot environment payload, in addition to the existing JVM version.

Graal is detected at client/worker environment probe time via Graal system properties (org.graalvm.nativeimage.imagecode / org.graalvm.version). Kotlin is added per worker when a directly registered workflow or activity implementation class carries kotlin.Metadata; the Kotlin version is resolved reflectively from that class’s loader. Detection is best effort—probe failures are isolated so hosting/platform reporting still works—and setDisableWorkerEnvironmentInfo still suppresses all of this. Kotlin reporting is per worker (not classpath-wide), and the retry-until-accepted / clear-after-accept heartbeat behavior is unchanged.

Docs and changelog are updated; unit and temporal-kotlin integration tests cover Graal properties, Kotlin augmentation, opt-out, and registration paths.

Reviewed by Cursor Bugbot for commit b4ca68f. Bugbot is set up for automated code reviews on this repo. Configure here.

Pin the API submodule to 1dd85fd479 from temporalio/api#880. Keep the API dependency update separate from the SDK runtime reporting changes.
Detect directly registered Kotlin workflow and activity implementations per worker and include the Kotlin version alongside the JVM runtime. Report Graal native-image execution when detected. Keep detection best effort and preserve telemetry opt-out and heartbeat acceptance behavior.
@Quinn-With-Two-Ns
Quinn-With-Two-Ns requested a review from a team as a code owner October 5, 2026 16:12

@Sushisource Sushisource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any tests that run under graal/kotin that could be integ tests for verifying the detection?

Not a huge deal either way

This branch has not been deployed

No deployments
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