mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-06 12:52:53 +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
|
// setup the control plane
|
||||||
controlPlane, err := controlplane.NewServer()
|
controlPlane, err := controlplane.NewServer(opt.Services)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error creating control plane: %w", err)
|
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.
|
// NewServer creates a new Server. Listener ports are chosen by the OS.
|
||||||
func NewServer() (*Server, error) {
|
func NewServer(name string) (*Server, error) {
|
||||||
srv := &Server{
|
srv := &Server{
|
||||||
configUpdated: make(chan struct{}, 1),
|
configUpdated: make(chan struct{}, 1),
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ func NewServer() (*Server, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
srv.GRPCServer = grpc.NewServer(
|
srv.GRPCServer = grpc.NewServer(
|
||||||
grpc.StatsHandler(telemetry.NewGRPCServerStatsHandler("control_plane")),
|
grpc.StatsHandler(telemetry.NewGRPCServerStatsHandler(name)),
|
||||||
grpc.UnaryInterceptor(requestid.UnaryServerInterceptor()),
|
grpc.UnaryInterceptor(requestid.UnaryServerInterceptor()),
|
||||||
grpc.StreamInterceptor(requestid.StreamServerInterceptor()),
|
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
|
// 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 {
|
func (h *GRPCServerStatsHandler) TagRPC(ctx context.Context, tagInfo *grpcstats.RPCTagInfo) context.Context {
|
||||||
|
|
||||||
metricCtx := h.metricsHandler.TagRPC(ctx, tagInfo)
|
handledCtx := h.Handler.TagRPC(ctx, tagInfo)
|
||||||
handledCtx := h.Handler.TagRPC(metricCtx, tagInfo)
|
metricCtx := h.metricsHandler.TagRPC(handledCtx, tagInfo)
|
||||||
|
|
||||||
return handledCtx
|
return metricCtx
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGRPCServerStatsHandler creates a new GRPCServerStatsHandler for a pomerium service
|
// NewGRPCServerStatsHandler creates a new GRPCServerStatsHandler for a pomerium service
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue