-
Notifications
You must be signed in to change notification settings - Fork 203
feat(client): add WorkflowClient interceptors for list and fetchHistory #2215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
trippyogi
wants to merge
4
commits into
temporalio:main
Choose a base branch
from
trippyogi:feat/client-list-fetchhistory-interceptors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ce371f4
feat(client): add WorkflowClient interceptors for list and fetchHistory
trippyogi 497d411
feat(client): instrument list and fetchHistory in OpenTelemetry inter…
trippyogi 2586ca0
Merge branch 'main' into feat/client-list-fetchhistory-interceptors
mjameswh d5077fa
Merge branch 'main' into feat/client-list-fetchhistory-interceptors
mjameswh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
list()hook will need more coverage than this. The fact that it is a generator adds some complications. Plus, we'll need to test interception in the case oflist().withHistories().Let's try this. Start a few workflow executions (~10), then do
for await (const _ of client.list({ /* query is not important */, pageSize: 2 })) {. That would require >5 requests to the server to see all search result. But then, in the loop, break once you've seen 3 pages, without reaching the end of the generator.I would expect the
listinterceptor to have been called only once in that sequence. And given the current test implementation (interceptor function is sync), I'm pretty sure thelistinterceptor function will return immediately.Does that "return immediately" behavior really what we need for
listinterceptors? For example, will OTel correctly figure out the encapsulation and timeline of thelistcall? I'm really not sure about that. My intuition is that thelistinterceptor would have to be a generator itself, proxying each request to the downstreamAsyncIteratorobtained by callingnext().Also, do the same thing with
for await (const _ of client.list({ /* query is not important */, pageSize: 2 }).intoHistories()) {. In addition to thelist()call, confirm that you're seeing >6 calls tofetchHistory.