You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should enforce that metric prefixes end in a period, or insert it automatically.
Reasoning
Consider the following metric:
request.time
It is common to want to add a prefix to the metric to identify the application emitting it.
In many other StatsD libraries, specifying a non-empty prefix (e.g. my_app) results in the following:
my_app.request.time
A period (.) is automatically added to delimit the metric name from the prefix, unless it is empty.
However, this library produces the following:
-my_app.request.time+my_apprequest.time
To get this behaviour with hot-shots, one must specify the separator as part of the prefix: my_app.. This is error prone, especially as it does not appear to be documented.
I am not aware of scenarios in which one would want a prefix to be joined to the metric name without a separator, though perhaps they exist.
If there are no such use cases, I think it would be sensible to either
require the last character of a non-empty prefix to be a period, or
automatically add a period in between the prefix and metric name if one is not already present.
This may also apply to metric suffixes, although of course the first character would be considered instead of the last.
The text was updated successfully, but these errors were encountered:
I'm totally good with a PR for this if anybody wants to create one. This will require a major version update, just in case it would break someone, but that does seem like something that just trips everyone up and is never needed.
TL;DR
We should enforce that metric prefixes end in a period, or insert it automatically.
Reasoning
Consider the following metric:
It is common to want to add a prefix to the metric to identify the application emitting it.
In many other StatsD libraries, specifying a non-empty prefix (e.g.
my_app
) results in the following:A period (
.
) is automatically added to delimit the metric name from the prefix, unless it is empty.However, this library produces the following:
To get this behaviour with
hot-shots
, one must specify the separator as part of the prefix:my_app.
. This is error prone, especially as it does not appear to be documented.I am not aware of scenarios in which one would want a prefix to be joined to the metric name without a separator, though perhaps they exist.
If there are no such use cases, I think it would be sensible to either
This may also apply to metric suffixes, although of course the first character would be considered instead of the last.
The text was updated successfully, but these errors were encountered: