Skip to content

Comments

add client id to grpc calls via interceptors and surface in grpc metrics#436

Merged
k4leung4 merged 6 commits intochainguard-dev:mainfrom
k4leung4:grpc-clientid
Aug 12, 2025
Merged

add client id to grpc calls via interceptors and surface in grpc metrics#436
k4leung4 merged 6 commits intochainguard-dev:mainfrom
k4leung4:grpc-clientid

Conversation

@k4leung4
Copy link
Contributor

@k4leung4 k4leung4 commented Jul 22, 2025

this updates the framework to stop using github.com/grpc-ecosystem/go-grpc-prometheus which has been archived since apr 18, 2023

two parts to the clientid

for clients, append a client id and request id to outgoing context for grpc
client id is the name of the executable
and request id is a generated uuid

for servers,
servers will need to include the new server interceptor to extract the clientid from context and attach it to the grpc metric

the requestid is not used at the moment for fear of metric cardinality concerns

for https://github.com/chainguard-dev/mono/issues/17367

@k4leung4 k4leung4 marked this pull request as ready for review July 22, 2025 21:49
@markusthoemmes
Copy link
Contributor

Could we split this into 2 PRs please? It seems like the prometheus change has nothing to do with the clientID/requestID change.

k4leung4 added 4 commits July 29, 2025 16:57
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
@k4leung4
Copy link
Contributor Author

Could we split this into 2 PRs please? It seems like the prometheus change has nothing to do with the clientID/requestID change.

done, ptal

Signed-off-by: Kenny Leung <kleung@chainguard.dev>
@k4leung4
Copy link
Contributor Author

done, ptal

@k4leung4 k4leung4 merged commit 22f17e1 into chainguard-dev:main Aug 12, 2025
13 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