nytimes / gizmo

A Microservice Toolkit from The New York Times

Home Page:https://open.nytimes.com/introducing-gizmo-aa7ea463b208

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GRPC server fails when Prometheus metrics are enabled

oliver-nyt opened this issue · comments

panic: descriptor Desc{fqName: "rpc.Data.DURATION", help: "rpc.Data.DURATION", constLabels: {}, variableLabels: []} is invalid: "rpc.Data.DURATION" is not a valid metric name

goroutine 1 [running]:
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0xc420078980, 0xc4201e35a0, 0x1, 0x1)
	/Users/207269/go/src/github.com/prometheus/client_golang/prometheus/registry.go:353 +0x92
github.com/prometheus/client_golang/prometheus.MustRegister(0xc4201e35a0, 0x1, 0x1)
	/Users/207269/go/src/github.com/prometheus/client_golang/prometheus/registry.go:152 +0x53
github.com/go-kit/kit/metrics/prometheus.NewSummaryFrom(0x0, 0x0, 0x0, 0x0, 0xc4201e6fc0, 0x11, 0xc4201e6fc0, 0x11, 0x0, 0x0, ...)
	/Users/207269/go/src/github.com/go-kit/kit/metrics/prometheus/prometheus.go:99 +0xe8
github.com/go-kit/kit/metrics/provider.(*prometheusProvider).NewHistogram(0xc4201e6580, 0xc4201e6fc0, 0x11, 0x32, 0x9, 0xc4201e6fc0)
	/Users/207269/go/src/github.com/go-kit/kit/metrics/provider/prometheus.go:59 +0x107
github.com/NYTimes/gizmo/server.registerRPCMetrics(0xc4201e3548, 0x8, 0x17eb2c0, 0xc4201e6580)
	/Users/207269/go/src/github.com/NYTimes/gizmo/server/rpc_server.go:298 +0x102
github.com/NYTimes/gizmo/server.(*RPCServer).Register(0xc42006e9b0, 0x17e7340, 0xc4201e3550, 0xc4201e3088, 0xc4201e3090)
	/Users/207269/go/src/github.com/NYTimes/gizmo/server/rpc_server.go:78 +0x123
github.com/NYTimes/gizmo/server.Register(0x17e7340, 0xc4201e3550, 0xc420061380, 0xc420082098)
	/Users/207269/go/src/github.com/NYTimes/gizmo/server/server.go:130 +0x49
main.main()

Needs similar fixing like we did here: #69

I'm actively considering deprecating the server.RPCServer and pointing users towards the new server/kit package that cuts out much of the complexities of the former. With that in mind, let's put this one on the back burner for now.

This RPC server no longer exists