feat(personhog): add caller tag support to Node.js client#60368
Merged
Conversation
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
nodejs/src/ingestion/personhog/index.ts:21-24
Both `clientName` and `callerTag` derive from the same expression `config.PLUGIN_SERVER_MODE ?? 'unknown'`. Extracting it into a local variable avoids repeating the fallback logic and makes it clear that the two headers intentionally carry the same value.
```suggestion
const serviceMode = config.PLUGIN_SERVER_MODE ?? 'unknown'
return PersonHogClient.fromConfig({
addr: config.PERSONHOG_ADDR,
clientName: serviceMode,
callerTag: serviceMode,
```
Reviews (1): Last reviewed commit: "feat(personhog): add caller tag support ..." | Re-trigger Greptile |
jose-sequeira
approved these changes
May 29, 2026
Add callerTag config option and x-caller-tag header interceptor to the Node.js PersonHogClient. The tag is set from PLUGIN_SERVER_MODE, giving per-server-mode attribution (e.g., "events", "cdp-api", "error-tracking") in the router's response_size_bytes and backend_duration_ms metrics.
…group repositories Add callerTag parameter to all person/group repository read interfaces and wire feature-level context tags from each call site: - cdp/hogflow-person-enrichment, cdp/hogflow-group-type-resolution, etc. - ingestion/person-resolution, ingestion/group-type-resolution, etc. - error-tracking/person-properties Tags flow to both gRPC x-caller-tag headers (for personhog router attribution) and PostgreSQL SQL comment annotations (for DB-level observability). The interceptor now only sets the default tag when no per-call tag is present.
The default callerTag duplicated clientName (both PLUGIN_SERVER_MODE). x-client-name already identifies the service; untagged call paths should show as "unknown" caller tag to make coverage gaps visible.
0fe18d4 to
d5d6dba
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.
Problem
We need per-caller attribution on personhog gRPC requests to identify which code paths are generating high-latency/data-intensive requests. The
x-caller-tagheader (consumed by the router in PR #60361) provides this, but each client service needs to send it.Changes
callerTagoptional config toPersonHogClientConfigx-caller-tagheader on every requestHow did you test this code?