feat(telemetry): include org_id in heartbeat payload (v9.1 #2277)#181
Merged
Conversation
Brings Java SDK telemetry up to parity with the platform's startup_telemetry.go emitter. Every heartbeat body now identifies which deployment-organization emitted it via an org_id field on the wire. Two sources, precedence order: 1. ORG_ID env var when set (operator's explicit configuration on self-hosted; the cs_<uuid> tenant identifier on Community SaaS). 2. local-dev-org sentinel when unset. Always emitted via TelemetryReporter.telemetryOrgId(). Receiver at ee/platform/checkpoint-service/pkg/telemetry/telemetry.go:454 carries omitempty for backward compat against pre-v9.1 SDKs. Tests added (TelemetryReporterTest.java, 9 new @test methods): - telemetryOrgId helper — 4 cases (env wins, sentinel, empty falls through, cs_<uuid> passes through). Uses junit-pioneer @SetEnvironmentVariable / @ClearEnvironmentVariable for in-process env mutation (deps already in pom.xml). - buildPayload includes org_id on wire — 3 cases with JsonNode decode AND wire-literal substring assertion. Defends against tag-removal mutations. - WireMock-driven functional E2E — 2 cases prove org_id arrives at the receiver over real HTTP through the SDK's outbound stack. 27 of 27 tests in TelemetryReporterTest pass (18 prior + 9 new). Runtime proof at runtime-e2e/v91_org_id_telemetry/V91OrgIdTelemetryTest.java — in-process com.sun.net.httpserver.HttpServer consumes the SDK's real telemetry POST, parses the JSON body, asserts org_id. Three modes exercised at PR time: - ORG_ID=acme-corp → org_id:"acme-corp" PASS - unset ORG_ID → org_id:"local-dev-org" PASS - ORG_ID=cs_<uuid> → org_id:"cs_<uuid>" PASS Companion wording sweep alongside the new field: - TelemetryReporter log line "anonymous telemetry enabled" → "telemetry enabled" — the operator-supplied ORG_ID on self-hosted is not anonymized. - HeartbeatState JavaDoc softened similarly. - TelemetryReporter.sendPingNow JavaDoc softened. CHANGELOG.md [Unreleased] expanded with org_id Added bullet + the log-wording change under Changed. Sister PRs across the other 4 SDKs and 4 plugins land in the same session. Privacy.html update landed first on axonflow-landing main: see axonflow-landing#129 (merged 2026-05-21). Refs: getaxonflow/axonflow-enterprise#2230 (Epic v9 identity) Refs: getaxonflow/axonflow-enterprise#2277 (v9.1 SDK + plugin org_id) Signed-off-by: Saurabh Jain <saurabh.jain@getaxonflow.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
org_idfield to the Java SDK telemetry heartbeat payload, in parity with the platform'sstartup_telemetry.goemitter (Epic #2230, Issue #2277). Sister PR to axonflow-sdk-go (merged), axonflow-sdk-python#198, axonflow-sdk-typescript#231, and follow-on PRs on Rust + 4 plugins.Two sources, precedence order:
ORG_IDenv var when set — operator's configured value on self-hosted, orcs_<uuid>tenant identifier on Community SaaS.local-dev-orgsentinel when unset.DoD
TelemetryReporter.buildPayloadpopulatesorg_idvia newtelemetryOrgId()helperTelemetryReporter.ORG_ID_LOCAL_DEV_SENTINELconstant exposedtelemetryOrgIdhelper × 4 cases (env wins, sentinel, empty, cs_)buildPayload includes org_id on wire× 3 cases (decode + wire-literal)runtime-e2e/v91_org_id_telemetry/V91OrgIdTelemetryTest.java+ README[Unreleased](no version bump per scope)TelemetryReporter.sendPingNow+HeartbeatStatemvn test -Dtest=TelemetryReporterTest: 27 passed, 0 failedR2 captured wire bodies
(Captured via in-process com.sun.net.httpserver.HttpServer.)
Test plan
Refs: getaxonflow/axonflow-enterprise#2230
Refs: getaxonflow/axonflow-enterprise#2277