Skip to content

Report runtime environment information in worker heartbeats - #3052

Merged
Sushisource merged 4 commits into
mainfrom
environment-info-go-java
Sep 8, 2026
Merged

Sushisource merged 4 commits into
mainfrom
environment-info-go-java

Conversation

@Sushisource

Copy link
Copy Markdown
Member

What was changed

Worker heartbeats now include an EnvironmentInfo message describing the JVM version, detected hosting environments (Docker, Kubernetes, AWS Lambda/ECS, Google Cloud Run/App Engine, Azure App Service/Functions/Container Apps), and the OS platform (Linux/macOS/Windows version, architecture, and Windows CRT).

The information is attached to each worker's heartbeats until the server accepts one, then omitted. HeartbeatManager tracks pending workers and clears them only after a successful recordWorkerHeartbeat.

A new experimental WorkflowClientOptions.Builder#setDisableWorkerEnvironmentInfo turns the reporting off.

Why?

Port of Core's temporalio/sdk-rust#1457 so all SDKs report the same analytical information about the environments they run in.

Checklist

  1. Closes N/A

  2. How was this tested:

New unit tests in WorkerEnvironmentInfoTest cover live detection, hosting-environment env vars, cgroup parsing, and Java version parsing. HeartbeatManagerTest gained cases for retry-until-accepted delivery and for omitting the environment when disabled.

  1. Any docs updates needed?

No.

@Sushisource
Sushisource marked this pull request as ready for review September 1, 2026 21:49
@Sushisource
Sushisource requested a review from a team as a code owner September 1, 2026 21:49

@maciejdudko maciejdudko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A couple nits but overall looks good. LGTM!

assertEquals(expectedArchitecture, info.getPlatform().getWindows().getArchitecture());
break;
default:
fail("unexpected platform variant " + info.getPlatform().getVariantCase());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: if this ever gets triggered, it's most likely a user porting Temporal SDK to something wild. A test skip might be better than a test fail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Eh, I'm fine with that. They can then either fix it or skip the test as needed.

@Sushisource
Sushisource enabled auto-merge (squash) September 8, 2026 18:21
@Sushisource
Sushisource merged commit c73480f into main Sep 8, 2026
28 of 29 checks passed
@Sushisource
Sushisource deleted the environment-info-go-java branch September 8, 2026 21:40
patbeqo added a commit to temporalio/skill-temporal-observability that referenced this pull request Nov 15, 2026
#15)

Adds a trimmed heartbeat content and opt-out section (environment info
opt-out, start after polling, MetricBuffer counts, poller target, plugin
version).

Operators reading worker fleet health see new heartbeat fields and a
privacy opt-out.

Upstream:
- temporalio/sdk-dotnet#826
- temporalio/sdk-rust#1457
- temporalio/sdk-rust#1488
- temporalio/sdk-rust#1593
- temporalio/sdk-rust#1688
- temporalio/sdk-go#2511
- temporalio/sdk-go#2647
- temporalio/sdk-java#3052
- temporalio/sdk-rust#1393
- temporalio/sdk-python#1747
- https://github.com/temporalio/sdk-python/releases/tag/1.32.0
- temporalio/sdk-python#1952
- temporalio/sdk-python#2064
- https://github.com/temporalio/sdk-python/releases/tag/1.36.0
- https://github.com/temporalio/sdk-ruby/releases/tag/v1.6.0
- temporalio/sdk-ruby#537
- https://github.com/temporalio/sdk-ruby/releases/tag/v1.10.0
- https://github.com/temporalio/sdk-ruby/releases/tag/v1.11.0
- https://github.com/temporalio/sdk-rust/releases/tag/core-v0.11.0
- https://github.com/temporalio/sdk-rust/releases/tag/v1.2.0
- https://github.com/temporalio/sdk-typescript/releases/tag/v1.21.0

Eval: Knowledge task, GPT 6.1 Terra (Codex)
Baseline: 5/5 items, 818k tokens, 68s
Improved: 5/5 items, 634k tokens, 54s
Delta: +0 items, -22% tokens, -19% time

Eval task: temporalio/skill-evals#428

---------

Co-authored-by: temporal-plugin-updater[bot] <3389934+temporal-plugin-updater[bot]@users.noreply.github.com>
Co-authored-by: Patrik Beqo <[email protected]>
Co-authored-by: temporal-plugin-updater[bot] <276371939+temporal-plugin-updater[bot]@users.noreply.github.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.

2 participants