Skip to content

feat(gateway): forward DROVER_GATEWAY_DIM_USER as x-bf-dim-user - #38

Closed
petehanssens wants to merge 1 commit into
mainfrom
feat/gateway-dim-user
Closed

petehanssens wants to merge 1 commit into
mainfrom
feat/gateway-dim-user

Conversation

@petehanssens

Copy link
Copy Markdown
Contributor

Summary

Cloud already injects DROVER_GATEWAY_DIM_USER from the submitting member's Zitadel subject into the hosted worker environment (drover-cloud#128). drover-code forwarded only job and customer dims to Gateway.

This maps DROVER_GATEWAY_DIM_USER to x-bf-dim-user so Gateway logs can attribute spend per user on hosted coding jobs. The header is not a hosted-worker marker, so it is sent whenever the env is set, independently of the job-id, customer-id, and credential headers.

After merge, Peter runs Deploy Sydney for ukc-agent so new workers pick this up. Existing worker images will not send the header until republished.

Test plan

  • go test ./internal/api/ -count=1 passes, including user-dim-without-hosted-markers and blank-user cases
  • CI green

Hosted jobs already receive the submitting member's Zitadel subject in
DROVER_GATEWAY_DIM_USER from Cloud. Map it onto x-bf-dim-user so Gateway
logs can attribute spend per user. This header is not a hosted-worker
marker, so it is sent whenever the env is set, independently of the
job-id, customer-id, and credential headers.
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.

1 participant