Skip to content

feat: Extract cadence-caller-type from headers at services inbound boundaries#7653

Merged
fimanishi merged 4 commits intocadence-workflow:masterfrom
fimanishi:extract-caller-info-at-service-boundary
Jan 29, 2026
Merged

feat: Extract cadence-caller-type from headers at services inbound boundaries#7653
fimanishi merged 4 commits intocadence-workflow:masterfrom
fimanishi:extract-caller-info-at-service-boundary

Conversation

@fimanishi
Copy link
Member

@fimanishi fimanishi commented Jan 28, 2026

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:

  1. Header extraction (GetCallerInfoFromHeaders):
    - yarpc.CallFromContext(ctx) - fast map lookup
    - call.Header(CallerTypeHeaderName) - fast string map lookup
    - ParseCallerType(string) - simple string comparison
    - Cost: ~100-200ns
  2. Context wrapping (ContextWithCallerInfo):
    - context.WithValue() - creates new context wrapper
    - Cost: ~50-100ns
  3. Total per request: ~150-300 nanoseconds (0.15-0.3 microseconds)

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

…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>
Signed-off-by: fimanishi <fimanishi@gmail.com>
@gitar-bot
Copy link

gitar-bot bot commented Jan 29, 2026

Code Review ✅ Approved

Well-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.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@fimanishi fimanishi merged commit 5bce84a into cadence-workflow:master Jan 29, 2026
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants