Skip to content

[Prometheus] Add LabelsWithContext support to ClientMetrics to match ServerMetrics #783

@temporal-nick

Description

@temporal-nick

I noticed there wasn't a follow-on issue created from #445 / #758, so here it is. I use the Prometheus middleware to generate gRPC client and server metrics, and I jumped on WithLabelsFromContext as soon as it was available. I was surprised to find that it wasn't supported in the ClientMetrics, even though the UnaryClientInterceptor and StreamClientInterceptor accept WithLabelsFromContext as an option. Searching around a bit brought me to the linked issue and PR.

My app uses multiple gRPC clients that call the same gRPC service API in different ways, so I need labels to separate their metrics. I would also like the ability to derive labels from the calling Context, just like with the ServerMetrics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions