Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-517

Ensure that we escape the metric names if they include user strings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 0.8.0
    • None
    • metrics

    Description

      JMX has limits on valid strings. We need to check validity before blindly creating a metric that includes a given topic name. If we fail to do this we will get an exception like this:

      javax.management.MalformedObjectNameException: Unterminated key property part
      at javax.management.ObjectName.construct(ObjectName.java:540)
      at javax.management.ObjectName.<init>(ObjectName.java:1403)
      at com.yammer.metrics.reporting.JmxReporter.onMetricAdded(JmxReporter.java:395)
      at com.yammer.metrics.core.MetricsRegistry.notifyMetricAdded(MetricsRegistry.java:516)
      at com.yammer.metrics.core.MetricsRegistry.getOrAdd(MetricsRegistry.java:491)
      at com.yammer.metrics.core.MetricsRegistry.newMeter(MetricsRegistry.java:240)
      at com.yammer.metrics.Metrics.newMeter(Metrics.java:245)
      at kafka.metrics.KafkaMetricsGroup$class.newMeter(KafkaMetricsGroup.scala:46)
      at kafka.server.FetcherStat.newMeter(AbstractFetcherThread.scala:180)
      at kafka.server.FetcherStat.<init>(AbstractFetcherThread.scala:182)
      at kafka.server.FetcherStat$$anonfun$2.apply(AbstractFetcherThread.scala:186)
      at kafka.server.FetcherStat$$anonfun$2.apply(AbstractFetcherThread.scala:186)
      at kafka.utils.Pool.getAndMaybePut(Pool.scala:60)
      at kafka.server.FetcherStat$.getFetcherStat(AbstractFetcherThread.scala:190)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jkreps Jay Kreps
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: