feat: Add CallerType for request context propagation#7564
feat: Add CallerType for request context propagation#7564fimanishi merged 2 commits intocadence-workflow:masterfrom
Conversation
569084a to
00b7bbb
Compare
Signed-off-by: fimanishi <fimanishi@gmail.com>
00b7bbb to
864ef9a
Compare
| case CallerTypeUI: | ||
| return "ui" | ||
| case CallerTypeSDK: | ||
| return "sdk" |
There was a problem hiding this comment.
Question: This category is like 'getHistory' calls via the worker client library, for example? This refers to indirect API calls triggered by customer workers and direct API calls to say, 'StartWorkflow' via the client libraries?
There was a problem hiding this comment.
This is the intention, yes. But how it'll depend on how the caller type is added to the context
common/types/caller.go
Outdated
| case CallerTypeSDK: | ||
| return "sdk" | ||
| case CallerTypeService: | ||
| return "service" |
There was a problem hiding this comment.
Nit: This is, I assume, direct YARPC API calls?
There was a problem hiding this comment.
this would be any calls that are initiated by the services and not by cli/sdk/UI. We will propagate the caller type in the context so requests downstream will maintain the initial caller type
There was a problem hiding this comment.
as discussed in slack, this is presumably mostly intra-service calls. Imho we might need a slightly more descriptive name for this, indicating it's internal to the Cadence cluster (or clusters, in the case of replication).
There was a problem hiding this comment.
renamed from "service" to "internal"
davidporter-id-au
left a comment
There was a problem hiding this comment.
lgtm other than that renaming thing
Signed-off-by: fimanishi <fimanishi@gmail.com>
f0b7b0c to
eb8c34a
Compare
What changed?
Added CallerType infrastructure for client identification:
Why?
Enable client-aware operations:
Cadence currently has no visibility into which client type (CLI, SDK, UI, Internal) is making requests. This enables future capabilities like per-client-type rate limiting, client-specific features, and improved observability.
How did you test it?
Unit tests.
Potential risks
None - this change only adds type definitions and helpers without any usage. No behavior changes.
Release notes
N/A - internal infrastructure only
Documentation Changes
N/A