Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in this file #1

Open
EliasSalom opened this issue Jul 18, 2022 · 0 comments
Open

problem in this file #1

EliasSalom opened this issue Jul 18, 2022 · 0 comments

Comments

@EliasSalom
Copy link

func NewMetricsMiddleware() *MetricsMiddleware {

Hi,
I have tried exactly like your instruction in the video, but I get a lot of issues from this file,
please if you can to reviewed and check if everything is working perfectly,
Not exactly from this function but it's from this file

this is my error

panic: a previously registered descriptor with the same fully-qualified name as Desc{fqName: "myapp_processed_ops_total", help: "The total number of processed events", constLabels: {}, variableLabels: [method path statuscode]} has different label names or a different help string

and then I receive this

goroutine 1 [running]:
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0x0?, {0x140000a73c0?, 0x1, 0x0?})
        /Users/eliassalom/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:403 +0x88
github.com/prometheus/client_golang/prometheus/promauto.Factory.NewCounterVec({{0x104a19248?, 0x1400018eaa0?}}, {{0x0, 0x0}, {0x0, 0x0}, {0x10480e916, 0x19}, {0x104817184, 0x24}, ...}, ...)
        /Users/eliassalom/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promauto/auto.go:276 +0xf8
github.com/prometheus/client_golang/prometheus/promauto.NewCounterVec(...)
        /Users/eliassalom/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promauto/auto.go:176
gobid/internal/middleware.NewMetricsMiddleware()
        /Users/eliassalom/Desktop/Project/go-bid-hub/internal/middleware/metrics.go:18 +0x11c
gobid/internal/bidhandler.(*HttpServer).Start(0x140000d5d38, {0x14000094ac0, 0xb}, {0x14000094da0, 0x8}, {0x14000094bc0, 0xd}, {0x14000094b08, 0x4})
        /Users/eliassalom/Desktop/Project/go-bid-hub/internal/bidhandler/httpServer.go:31 +0x78
main.main()
        /Users/eliassalom/Desktop/Project/go-bid-hub/cmd/bidhubapi/main.go:24 +0x2e4
exit status 2
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

No branches or pull requests

1 participant