Details
-
Bug
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
None
-
None
-
-
metrics graphite
-
Patch
Description
org.apache.hadoop.metrics2.GraphiteSink's implementation has certain problems that would make it to generate metrics incorrectly.
The problem lies with line 77 ~ 84 of the GraphiteSink java:
for (MetricsTag tag : record.tags()) { if (tag.value() != null) { metricsPathPrefix.append("."); metricsPathPrefix.append(tag.name()); metricsPathPrefix.append("="); metricsPathPrefix.append(tag.value()); } }
It produces point tags having name=value pair in the metrics. However, notice how the tags are added with '.' as its delimiters. Rather than using the '.' character, it should follow the following convention mentioned in the latest graphite doc of using ';' character.
http://graphite.readthedocs.io/en/latest/tags.html
Also, the value is not properly being escaped, meaning that if the value has a '.' character in it, it will easily confuse Graphite to accept it as a delimiter, rather than the value. A really good prime example is when the value is a hostname or ip address,
metrics.example.Hostname=this.is.a.hostname.and.this.is.Metrics 10.0
In this example, the since the value of the hostname contains '.', it is extremely hard for the receiving end to determine which part is hostname and which part is the rest of the metrics name. A good strategy is to convert any '.' character in the value to be converted to other characters, such as '_'.
However, the best way would be to follow the latest metrics convention of using ';'
metrics.example.and.this.is.Metrics;Hostname=this.is.a.hostname 10.0
Attachments
Attachments
Issue Links
- causes
-
HADOOP-10727 GraphiteSink metric names should not contain "."
- Open
- is related to
-
HADOOP-12538 Fix issues of metric path emmitted by GraphiteSink
- Patch Available
-
HADOOP-14300 GraphiteSink reports metrics containing undesirable whitespaces
- Patch Available
-
HADOOP-11237 GraphiteSink metric names should not contain "="
- Open
- links to