feat: add optional message telemetry hooks for OpenTelemetry integration - #442
Open
gibson9583 wants to merge 5 commits into
Open
gibson9583 wants to merge 5 commits into
gibson9583 wants to merge 5 commits into
Conversation
Expose process, transform, send and response scopes with context transfer at destination and JavaScript worker handoffs. Preserve engine task execution, errors, cancellation and queue behavior. Validate real channel paths, failures and fixture cleanup with 687 engine tests and independent adversarial review. Signed-off-by: gibson9583 <cgibson@outlook.com>
Offer an optional resource-free source-map callback before the first connector map is persisted, preserving dispatch and recovery behavior. Signed-off-by: gibson9583 <cgibson@outlook.com>
Retain per-destination failure and retry context until engine cleanup finishes. Preserve existing execution, first fatal evidence and callback isolation across source chains and queued attempts. Signed-off-by: gibson9583 <cgibson@outlook.com>
Let a registered telemetry provider prepare an opaque, bounded proof before the source map is first persisted and receive it again when each later stage starts. The proof lives in a transient, owner-keyed slot on ConnectorMessage: it never retains a message, application map, Throwable, SDK or provider, does not enter Java or XML serialization, and cannot be read or forged through an unrelated key. Native dispatch copies only that slot to destination messages in Channel and DestinationChain. Providers that do not declare the capability keep their original callbacks unchanged. Cover ownership, replacement, reentrancy, failure retirement and serialization exclusion with fourteen isolated dispatch tests. Signed-off-by: gibson9583 <cgibson@outlook.com>
Replace the monitor on the ConnectorMessage telemetry slot with a VarHandle over the existing transient volatile field. Reserve is a plain volatile replacement; completion installs its value only when the slot still holds that reservation. The pre-allocation clear is dropped: an allocation failure on a message thread errors that message and the object is never dispatched again, so a stale slot cannot be read. No per-message allocation is added and the serial form is unchanged. Signed-off-by: gibson9583 <cgibson@outlook.com>
gibson9583
requested review from
a team,
NicoPiel,
jonbartels,
kayyagari,
kpalang,
mgaffigan,
ssrowe and
tonygermano
September 15, 2026 17:43
Contributor
|
@gibson9583 - I have not reviewed yet, but one of the first things that jumps out at me is that the PR needs links or docs for:
|
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 optional message telemetry bridge to the engine so an extension can observe message processing and maintain trace context across destination-chain and JavaScript worker handoffs.
This provides the engine integration points needed by the OpenTelemetry plugin. SDK setup, exporters, sampling, configuration and durable trace-continuity policy remain extension responsibilities.
Closes #432
Changes
MessageTelemetry.Providercontract with observations for source processing, destination attempts, filtering/transformation, sending and response transformation.ConnectorMessage, with compare-and-set publication to prevent older or reentrant callbacks from overwriting a newer reservation.Compatibility and failure handling
ThreadDeathretain fatal handling.Validation
Regression coverage includes synchronous and queued processing, parallel destinations, retries, persisted PENDING messages, filtering and transformation failures, callback failures, cleanup ordering, executor rejection/cancellation, and JavaScript context restoration.