-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
nsqadmin: not respecting "use-statsd-prefixes" flag #661
Comments
This is a bug... it doesn't look like we're passing the value of that flag to the client, so @kesutton any interest in submitting a patch? |
I am attempting to fix this, but for some reason when I build the updated version to test locally, it doesn't pull in the updated index.html file. Here are the steps I am executing to build nsqadmin:
Then I run the built binary via: build/apps/nsqadmin --lookupd-http-address=127.0.0.1:4161 --use-statsd-prefixes=true --graphite-url="http://stats.crucible.iron.net:8000" When I browse to localhost:4171, the old index.html file appears. Is there an extra step I need to run to get the build process to read in the static/ folders down nsqadmin? |
|
I was able to update the code to make this work, and in doing so, found another "bug". For counters, Statsd appends ".count" and ".rate" to the client's stat key. Nsqadmin doesn't necessarily care about the ".rate" metric, but without the ".count" suffix on each counter-type key, nsqadmin can not find the relevant statistic in graphite. I am assuming that there are some statsd implementations that do not append .count and .rate, and thus I think nsqadmin should only assume the ".count" suffix exists when "stats.counters" is the prefix. So I have added code that checks if the statistic is a "counter", AND if "use-statsd-prefixes" is true (I understand that the conf field name doesn't truly reflect all the functionality associated with it, now that it truly means "use statsd prefixes AND suffixes, where necessary"). If true, then ".count" is appended to the overall key. What do you think about this choice of implementation, and the fact that the config field name doesn't fully represent the functionality associated with it. Changing it wouldn't break backward binary compatibility, but conf files would need to be updated, along with all documentation files. |
@kesutton maybe a more future proof solution might be to allow an What do you think? |
(and we can deprecate the |
I believe the following set of parameters would make the most sense: --nsq-statsd-prefix="nsq.%s" --statsd-counter-format="stats.counters.%s.count" --statsd-gauge-format="stats.gauges.%s" Deprecated: I believe the default for nsq-statsd-prefix should remain "nsq.%s". However, I'm not sure what you think the default should be for the other two. Right now, it looks like use-statsd-prefixes defaults to true, indicating that the two new ones should have a set, non-blank default as well. However, that leads to the situation where a user who does not want those formats enforced having to specify the flags, but leave the values empty, which is odd. What do you think? |
Also, with regard to deprecating flags - Does the old functionality have to be valid still? This change requires a few function rewrites, which would break the functionality the deprecated flags imply. It would be odd, but doable, to write code so it still works, it just wouldn't be as pretty. |
I don't think it makes sense to change the name of |
What about respecting the "use-statsd-prefixes" flag? Shall I just ignore/remove any functionality related to that flag specfically? Keep in mind the functionality that currently exists is broken with regard to the missing ".count" suffix. |
It should all be implemented in a backwards compatible way, unfortunately (for the code). We can clean it up when we remove the deprecated options (ping #367) |
I would suggest changing the default of use-statsd-prefixes to "false" then, rather than true. |
Hm... now that I think about it, I'm confused to how to mold these two overlapping fields together. I think leaving the default as "true" is best. In the interim time period, if the user sets "use-statsd-prefixe" to false, then the default counter/gauge formats will NOT be applied. Otherwise, the counter/gauge formats will be applied. |
see #662 |
I have just upgraded to NSQ 0.3.6, looking for the code fixed in #655.
However, it now seems as if the "use-statsd-prefixes" field is not being honored by nsqadmin.
Here is the output from NSQ Admin, running with both a true and false value for "use-statsd-prefixes":
In both cases, NSQ doesn't seem to be appending the "stats.gauge" prefix that occurs in this file:
nsq/nsqadmin/static/js/lib/handlebars_helpers.js
Line 17 in 2a8dab2
However, when "use-statsd-prefixes" is set to true, it should be appending "stats.gauges" or "stats.counters" wherever necessary.
Is it possible my PR for issue #655 broke something? Or is the combination of configuration parameters not correct?
The text was updated successfully, but these errors were encountered: