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

gorilla mux path compatibility #196

Open
caevv opened this issue Oct 30, 2023 · 0 comments · May be fixed by #226
Open

gorilla mux path compatibility #196

caevv opened this issue Oct 30, 2023 · 0 comments · May be fixed by #226

Comments

@caevv
Copy link

caevv commented Oct 30, 2023

Paths are not supported with std.HandlerProvider

http_request_duration_seconds_count{code="500",handler="/hello/123",method="GET",service=""} 1
http_request_duration_seconds_count{code="500",handler="/hello/321",method="GET",service=""} 1

Should be:

http_request_duration_seconds_count{code="500",handler="/hello/{key}",method="GET",service=""} 2

Code example:

r := mux.NewRouter()

r.Use(std.HandlerProvider("", metrics_middleware.New(metrics_middleware.Config{
	Recorder: metrics.NewRecorder(metrics.Config{}),
})))

r.HandleFunc("/hello/{key}", hello).Methods("GET")
@SlIdE42 SlIdE42 linked a pull request Jun 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant