feat: Extract cadence-caller-type from headers at services inbound boundaries#7653
Merged
fimanishi merged 4 commits intocadence-workflow:masterfrom Jan 29, 2026
Conversation
…undaries Signed-off-by: fimanishi <fimanishi@gmail.com>
Signed-off-by: fimanishi <fimanishi@gmail.com>
…fault values if not present in headers Signed-off-by: fimanishi <fimanishi@gmail.com>
Code Review ✅ ApprovedWell-designed middleware implementation with clean refactoring from pointer to value semantics. The removal of yarpc dependency from types package improves testability. Comprehensive test coverage follows project conventions. OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
davidporter-id-au
approved these changes
Jan 29, 2026
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 changed?
Extract CallerInfo from yarpc headers at all service inbound boundaries using middleware and add it to the context.
#7654
Why?
We want to use caller type that may be present in the caller info, and other caller info fields to be added, on services like frontend and history. They will probably not be needed in matching and they will probably not be added to the headers at that point, making this a noop.
The performance impact is around 300ns as per this estimation:
- yarpc.CallFromContext(ctx) - fast map lookup
- call.Header(CallerTypeHeaderName) - fast string map lookup
- ParseCallerType(string) - simple string comparison
- Cost: ~100-200ns
- context.WithValue() - creates new context wrapper
- Cost: ~50-100ns
How did you test it?
Unit test and local test running cadence locally.
Potential risks
As mentioned above, some performance issue that may represent around 0.002-0.03% of total request time
Release notes
Documentation Changes