startDelaySeconds: 0
ssl: false
lowercaseOutputName: true
lowercaseOutputLabelNames: true
rules:
  # MetricsSystem
  - pattern: 'Hadoop<service=(.*), name=MetricsSystem, sub=(.*)><>(.*): (\d+)'
    attrNameSnakeCase: true
    name: hadoop_$1_$3
    value: $4
    labels:
      service: HDFS
      role: $1
      kind: 'MetricsSystem'
      sub: $2
    type: GAUGE
  # FSDatasetState (also extracts the FSDataset ID)
  - pattern: 'Hadoop<service=(.*), name=FSDatasetState-(.*)><>(.*): (\d+)'
    attrNameSnakeCase: true
    name: hadoop_$1_$3
    value: $4
    labels:
      service: HDFS
      role: $1
      fsdatasetid: $2
      kind: 'FSDatasetState'
    type: GAUGE
  # DataNodeActivity (also extracts hostname and port)
  - pattern: 'Hadoop<service=(.*), name=DataNodeActivity-(.*)-(\d+)><>(.*): (\d+)'
    attrNameSnakeCase: true
    name: hadoop_$1_$4
    value: $5
    labels:
      service: HDFS
      role: $1
      host: $2
      port: $3
      kind: 'DataNodeActivity'
    type: GAUGE
  # All other services
  - pattern: 'Hadoop<service=(.*), name=(.*)><>(.*): (\d+)'
    attrNameSnakeCase: true
    name: hadoop_$1_$3
    value: $4
    labels:
      service: HDFS
      role: $1
      kind: $2
    type: GAUGE