feat: add optional message telemetry hooks for OpenTelemetry integration #442
Test Results
132 files + 9 132 suites +9 3m 24s ⏱️ + 1m 35s
766 tests +76 766 ✅ +76 0 💤 ±0 0 ❌ ±0
778 runs +76 778 ✅ +76 0 💤 ±0 0 ❌ ±0
Results for commit d5799f27. ± Comparison against base commit 9359d9a8.
[test-results]:data:application/gzip;base64,H4sIACuGqWoC/13MSw7CIBSF4a00jB3ArXCLmzHllRDbYniMjHsXSa3o8P9Och7E+cUmchnYCKeBpOJzl6bEOfuwVQB6rlDH/J5RiE9dU9H6n27+Xoke4Ga//ICNMcRdYtnaJ057HJedfB9bd4et+z8d1tXnGsRwlNIBKscNcqqc1QKZZEDHSY4KwVAK1gB5vgBAT1UvCQEAAA==
@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:
wheres the plugin?
Why can't the plugin add its own endpoints instead of modifying core OIE?
what data elements are exposed?
are there docker-compose files, integration tests, etc that would be useful for testing or demonstrating what this does?
@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:
> wheres the plugin?
> Why can't the plugin add its own endpoints instead of modifying core OIE?
> what data elements are exposed?
> are there docker-compose files, integration tests, etc that would be useful for testing or demonstrating what this does?
Hey @jonbartels - I'm not ready to share my plugin repo public but I can share a compiled plugin for you. The PR should be able to stand on its own however.
There is a doc contained in the PR that should describe the items you have questioned.
Nothing uses this yet. The doc in the PR says the plugin can't start on this engine yet and performance hasn't been measured. I'd want the plugin, or at least a small sample provider, running against this branch before core takes the API. Otherwise we can't tell which parts are needed, for example the owner-keyed slot on ConnectorMessage vs. a source map entry, which already travels with every destination.
The failure warning never shows up. Stock log4j2.properties has rootLogger = ERROR and nothing for MessageTelemetry, so the WARN is filtered. I ran a provider whose callbacks all throw: messages processed normally and mirth.log had nothing. Allowing WARN for that logger showed the line once per install. Log at ERROR, or add the logger to log4j2.properties.
Unrelated fix inside. The fallback statusUpdateLock unlock in DestinationConnector fixes an existing leak when dao.close() throws. Separate issue and PR please.
Style. One-line try { ...; } catch (...) { ...; throw x; }, several statements per line, and braceless if/else don't match the rest of the codebase.
The doc reads like a dev log ("reduced engine development slice", "old plugin", "adapter"). Rewrite it for someone reading the repo, or move it to the PR description.
How to verify steps are missing.
pacmano1
gibson9583
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.