mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-30 17:37:25 +02:00
Fix missing/incorrect grpc labels (#804)
This commit is contained in:
parent
6761cc7a14
commit
06e3f5def5
3 changed files with 6 additions and 6 deletions
|
@ -50,7 +50,7 @@ func Run(ctx context.Context, configFile string) error {
|
|||
}
|
||||
|
||||
// setup the control plane
|
||||
controlPlane, err := controlplane.NewServer()
|
||||
controlPlane, err := controlplane.NewServer(opt.Services)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating control plane: %w", err)
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ type Server struct {
|
|||
}
|
||||
|
||||
// NewServer creates a new Server. Listener ports are chosen by the OS.
|
||||
func NewServer() (*Server, error) {
|
||||
func NewServer(name string) (*Server, error) {
|
||||
srv := &Server{
|
||||
configUpdated: make(chan struct{}, 1),
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func NewServer() (*Server, error) {
|
|||
return nil, err
|
||||
}
|
||||
srv.GRPCServer = grpc.NewServer(
|
||||
grpc.StatsHandler(telemetry.NewGRPCServerStatsHandler("control_plane")),
|
||||
grpc.StatsHandler(telemetry.NewGRPCServerStatsHandler(name)),
|
||||
grpc.UnaryInterceptor(requestid.UnaryServerInterceptor()),
|
||||
grpc.StreamInterceptor(requestid.StreamServerInterceptor()),
|
||||
)
|
||||
|
|
|
@ -23,10 +23,10 @@ type GRPCServerStatsHandler struct {
|
|||
// TagRPC implements grpc.stats.Handler and adds metrics and tracing metadata to the context of a given RPC
|
||||
func (h *GRPCServerStatsHandler) TagRPC(ctx context.Context, tagInfo *grpcstats.RPCTagInfo) context.Context {
|
||||
|
||||
metricCtx := h.metricsHandler.TagRPC(ctx, tagInfo)
|
||||
handledCtx := h.Handler.TagRPC(metricCtx, tagInfo)
|
||||
handledCtx := h.Handler.TagRPC(ctx, tagInfo)
|
||||
metricCtx := h.metricsHandler.TagRPC(handledCtx, tagInfo)
|
||||
|
||||
return handledCtx
|
||||
return metricCtx
|
||||
}
|
||||
|
||||
// NewGRPCServerStatsHandler creates a new GRPCServerStatsHandler for a pomerium service
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue