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

metrics middleware broken #61

Closed
dsvensson opened this issue Dec 16, 2018 · 2 comments
Closed

metrics middleware broken #61

dsvensson opened this issue Dec 16, 2018 · 2 comments

Comments

@dsvensson
Copy link

dsvensson commented Dec 16, 2018

I suspect it's bad to use gramework.BytesToString here:

https://github.com/gramework/gramework/blob/dev/metrics/metrics.go#L95

It causes errors like this in the /metrics endpoint:

* collected metric "gramework_http_requests_total" { label:<name:"code" value:"200" > label:
<name:"method" value:"POST" > label:<name:"node" value:"bb6f5bf92c76" > label:<name:"path" 
value:"/foo/Bars" > label:<name:"service" value:"/app" > label:<name:"type" value:"http" > counter:
<value:23 > } was collected before with the same name and label values

Looks like the underlying byte array mutates under gramework's feets. Swapping to string() fixes the issue.

Another symptom is that paths where some are longer than others, the shorter ones may get garbage at the end.

@kirillDanshin
Copy link
Member

should be fixed in f090fd4

@kirillDanshin
Copy link
Member

@dsvensson, please ping me if you have any further questions. for now, I'm closing this issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants