opsnull / hadoop_jmx_exporter

HDFS & YARN jmx metrics prometheus exporter
77 stars 65 forks source link

Fixed some errors with HDP usage #4

Closed chapsuk closed 3 years ago

chapsuk commented 3 years ago

Hi @opsnull , very thanks for the tool!

Testing on HDP3.1.4 and catch errors:

  1. https://github.com/opsnull/hadoop_jmx_exporter/commit/bab8ef029ed6c0ab59665b765dd9d477483546e7

    ...
    File "/exporter/hdfs_journalnode.py", line 40, in collect
    self.hadoop_datanode_metrics.update(self.common_metric_collector.get_metrics(beans, self.target))
    AttributeError: 'JournalNodeMetricCollector' object has no attribute 'hadoop_datanode_metrics' 
  2. https://github.com/opsnull/hadoop_jmx_exporter/commit/8bf3bbb7822ae38a75ecc11ac15b08c08264f8ca

    File "/exporter/hdfs_journalnode.py", line 129, in get_metrics
    self.hadoop_journalnode_metrics['JournalNode'][key].add_metric(label, beans[i][metric])
    KeyError: u'NumEditLogsSynced'
  3. https://github.com/opsnull/hadoop_jmx_exporter/commit/0e1cedea3e4c9f9b38db5f2032e975cc1e0d64b5

    File "/usr/local/lib/python2.7/site-packages/prometheus_client/utils.py", line 9, in floatToGoString 
    d = float(d) ValueError: ('could not convert string to float: DISK', Metric(hadoop_hdfs_datanode_volume_state, Volume infomation in each path and in each mode, gauge, 
    ...
    Sample(
        name='hadoop_hdfs_datanode_volume_state', 
        labels={
            'cluster': 'cluster_name', 
            'state': 'storageType', 
            'version': u'3.1.1.3.1.4.0-315, r58d0fd3d8ce58b10149da3c717c45e5e57a60d14', 
            '_target': u'my.host.com', 
            'path': '/data'
        }, 
        value='DISK',  <---
        timestamp=None, 
        exemplar=None), 
    ...
opsnull commented 3 years ago

@chapsuk Thank you very much!

fix #3