feat(opentelemetry) add @temporalio/interceptors-opentelemetry-v2#1951
Open
chris-olszewski wants to merge 3 commits intoolszewski/break_up_buildfrom
Open
feat(opentelemetry) add @temporalio/interceptors-opentelemetry-v2#1951chris-olszewski wants to merge 3 commits intoolszewski/break_up_buildfrom
chris-olszewski wants to merge 3 commits intoolszewski/break_up_buildfrom
Conversation
3039377 to
99e880b
Compare
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.
What was changed
Add a package to provide interceptors that support OpenTelemetry v2.
First commit is a straight copy of the v1 with package bumps and the necessary changes the came along with those bumps.
Note: Histories created with the
@temporalio/interceptors-opentelemetrywill not be compatible with@temporalio/interceptors-opentelemetryand vice-versa. The crux of the issue is that OpenTelemetry changed their usage ofMath.random(). The random number generator was shared by OpenTelemetry for generating span ids as well as theuuidfunction which is used for generating child workflow ids. This can cause NDE. To prevent future breakages from changes toMath.randomusage, we now provide anIdGeneratorto OpenTelemetry that uses its own random number generator. This doesn't offer a huge amount of value as we are still vulnerable to changes to the amount of calls toMath.randomoutside of id creation, but it does offer protection if the number of ids created changes.Due to histories already being incompatible, I removed the yield point injections from the interceptors to have a cleaner starting point.
Why?
This was done in a separate package to allow us to support both v1 and v2 without forcing users to upgrade.
Checklist
Closes [Feature Request] Add support for opentelemetry v2 #1658
How was this tested:
Copied over relevant tests and added an additional test to verify that replaying workflow history that has uuid call doesn't trigger NDE in the future.
Any docs updates needed?