[Hawkular-dev] hawkular metrics go client - need assistance for a couple issues

John Mazzitelli mazz at redhat.com
Sun Oct 30 22:34:55 EDT 2016


> > 1. The old behavior should work, as we promised so in the
> > HWKMETRICS-385. If it does not, then there's a bug in the
> > Hawkular-Metrics, not in the client. We can change this method signature
> > in new versions, but that old API must work (and the tests against
> > HWKMETRICS work also, so I couldn't replicate your bug yet)
> 
> OK. I noticed the tests in client worked for both. I couldn't understand why.
> Now I know :) Didn't know about that JIRA.
> 
> I'll try to replicate my problem and see what's going on - I was definitely
> getting an error code from H-Metrics until I ran with my PR code.

I replicated the problem. It is a bug in the hawkular Go client - see:

https://github.com/hawkular/hawkular-client-go/issues/10

Short story - if tags have spaces in their values, Go client builds a bad DELETE URL and the delete fails with a 400
I submitted a second PR - but I don't know if that would be backward compatible either. So there are two PRs that fix this problem, but I don't know if either one is good enough. But somehow we need to fix this, or else we cannot support tags with spaces in their values (this is different than the issue where spaces are in their NAMES).

> > 2. There's no proper fix for this Golang bug. There's only workarounds
> > and the one you suggested is the one that's used in almost every Golang
> > application that can have whitespace in the URLs. Golang's net/url
> > package is just .. crap and can't follow many standards.
> 
> That is --- unfortunate. I'd implement my stupid fix but, what happens if
> there is a literal "+" in the string? Bah... "just don't use spaces in tag
> names" seems extreme though.

Just to be clear, this is different than the above because here we are talking about spaces in the tag NAMES.

So, as of right now, the Go client cannot support tag names OR values with spaces in them. That's going to be a limitation we need to document, unless we fix these two issues.

I'll leave that up to Micke how best to solve these - because this involves backward compatibility issues with older Hawkular Metrics servers and he'd know best what to do there. I have two PRs for the first one, and a suggested fix documented in the github issue for the second - but I don't know if any are good enough to push to master.


More information about the hawkular-dev mailing list