Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-16397

flink metric graphite will format double metrics to "%2.2f"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.9.2, 1.10.0
    • Fix Version/s: None
    • Component/s: Runtime / Metrics
    • Labels:
      None

      Description

      I'm using flink GraphiteReporter to monitor metrics. But I found that the GraphiteReporter will convert double / float type metrics to the format : "%2.2f", only keep two fractions.  For instance, Status.JVM.CPU.Load metric is loss of  precision, like  0.00, 0.01 .

      it is bad

      For more detail, see the double format function in dropwizard metrics project::

      https://github.com/dropwizard/metrics/blob/4.1-development/metrics-graphite/src/main/java/com/codahale/metrics/graphite/GraphiteReporter.java#L401

          protected String format(double v) {
              // the Carbon plaintext format is pretty underspecified, but it seems like it just wants
              // US-formatted digits
              return String.format(Locale.US, "%2.2f", v);
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              blablabla123 BlaBlabla
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: