Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10727

GraphiteSink metric names should not contain "."

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Sometimes the names of the metrics sent to Graphite contain "." in them (such as hostnames). Graphite interpret these dots as a separator for directories causing long directory hierarchies. It would be easier to replace them to "_" in order to have easier to read metric names.

      Attachments

        1. HADOOP-10727.patch
          2 kB
          Babak Behzad
        2. HADOOP-10727-v2.patch
          3 kB
          Babak Behzad

        Issue Links

          Activity

            cwimmer Charles Wimmer added a comment -

            Other systems that emit metrics to graphite use a similar process. For example, collectd. https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_write_graphite

            We should consider making the escape character configurable.

            cwimmer Charles Wimmer added a comment - Other systems that emit metrics to graphite use a similar process. For example, collectd. https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_write_graphite We should consider making the escape character configurable.
            babakbehzad Babak Behzad added a comment -

            Thanks cwimmer. I like your idea of making it configurable. We can put it as a new option in "hadoop-metrics2.properties" file along with other options such as server_host, server_port and metrics_prefix. Following the naming convention of Graphite we can have the following line to replace all the "." to ":":
            *.sink.graphite.escape_character=:
            Default is _ (Underscore).

            babakbehzad Babak Behzad added a comment - Thanks cwimmer . I like your idea of making it configurable. We can put it as a new option in "hadoop-metrics2.properties" file along with other options such as server_host, server_port and metrics_prefix. Following the naming convention of Graphite we can have the following line to replace all the "." to ":": *.sink.graphite.escape_character=: Default is _ (Underscore).
            babakbehzad Babak Behzad added a comment -

            I attached my first shot on this. It would be great if someone can review it and let me know what they think.

            babakbehzad Babak Behzad added a comment - I attached my first shot on this. It would be great if someone can review it and let me know what they think.
            raviprak Ravi Prakash added a comment -

            Hi Babak!
            Thanks for the patch.

                    if (escape_character == null)
                        escape_character = "_";

            please include a closing and ending brace. Or you could just use the ? : operator ;
            Also please write a comment on the regex, to help identify what it is filtering for. I'm a +1 on the patch after those changes.

            raviprak Ravi Prakash added a comment - Hi Babak! Thanks for the patch. if (escape_character == null ) escape_character = "_" ; please include a closing and ending brace. Or you could just use the ? : operator ; Also please write a comment on the regex, to help identify what it is filtering for. I'm a +1 on the patch after those changes.
            babakbehzad Babak Behzad added a comment -

            Thanks Ravi. Both of your comments are incorporated in the new patch I uploaded.

            babakbehzad Babak Behzad added a comment - Thanks Ravi. Both of your comments are incorporated in the new patch I uploaded.
            raviprak Ravi Prakash added a comment -

            Hi Babak!

            There's a tab in there. And could you please also add a test? Sorry I just remembered this.

            raviprak Ravi Prakash added a comment - Hi Babak! There's a tab in there. And could you please also add a test? Sorry I just remembered this.

            People

              Unassigned Unassigned
              babakbehzad Babak Behzad
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: