-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
/debug/vars endpoint returns base64 encoded strings #7177
Comments
Have you verified this occurs in 1.0 branch? I think sorted tags stuff is only in master. |
I have not. I will check and then bump change log to 1.1 if it's not a 1.0 On Friday, 19 August 2016, Jason Wilder notifications@github.com wrote:
Edd Robinson InfluxData.com http://influxdata.com/ Github http://www.github.com/e-dard / LinkedIn |
@jsternberg what is the reason behind the tags being a slice of maps of Key/Value pairs? Previously Telegraf could marshal influxdb points out of the /debug/vars endpoint that look more-or-less like JSON influxdb points: type point struct {
Name string `json:"name"`
Tags map[string]string `json:"tags"`
Values map[string]interface{} `json:"values"`
} Is it possible to revert |
it does appear to be related to that, although I'm not sure I fully understand how that has made it's way into the /debug/vars output. Are we now going to return the above type from the query language as well (tags as a list of key/val pairs)? And if not, maybe we should be marshaling the /debug/vars JSON into the more user-friendly format |
No. It was only supposed to change how the tags were stored internally. |
@e-dard I agree. That might be the simplest thing to do to fix this. I think the switch to slice of key/values in the output was unintended. |
@jwilder the real question here is "do tags need to be sorted in I think the answer to that is no, in which case we're not only doing extra work converting between strings and []bytes, we're also do more work by keeping tags sorted. |
In the output of |
Yeah I'm only referring to |
#6964 introduced a new statistics implementation that uses
[]byte
for tag keys and values.[]byte
is base64 encoded by Go's JSON encoder./debug/vars
now looks like:The short-term fix is to add a custom
json.Marshaler
implementation tomodels.Tags
, but I think we should also figure out if we really need to be going through all the extra work involved in using a sortedmodels.Tags
.From a cursory glance of the statistics stuff it seems we could just have a
map[string]string
to represent the tags associated with aStatistics
object.The text was updated successfully, but these errors were encountered: