defaults:
  match_type: glob
  glob_disable_ordering: false
  ttl: 1m30s
mappings:
- match: "nsq.*.topic.*.channel.*.message_count"
  name: "nsq_topic_channel_message_count"
  match_metric_type: counter
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"
    channel: "$3"

- match: "nsq.*.topic.*.channel.*.requeue_count"
  name: "nsq_topic_channel_requeue_count"
  match_metric_type: counter
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"
    channel: "$3"

- match: "nsq.*.topic.*.channel.*.timeout_count"
  name: "nsq_topic_channel_timeout_count"
  match_metric_type: counter
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"
    channel: "$3"

- match: "nsq.*.topic.*.channel.*.*"
  name: "nsq_topic_channel_${4}"
  match_metric_type: gauge
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"
    channel: "$3"

#nsq.<nsq_host>_<nsq_port>.topic.<topic_name>.backend_depth [gauge]
- match: "nsq.*.topic.*.message_count"
  name: "nsq_topic_message_count"
  help: Total number of messages for the topic
  match_metric_type: counter
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"

- match: "nsq.*.topic.*.message_bytes"
  name: "nsq_topic_message_bytes"
  help: Total number of bytes of all messages
  match_metric_type: counter
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"

- match: "nsq.*.topic.*.*" #depth or backend_depth
  name: "nsq_topic_${3}"
  match_metric_type: gauge
  labels:
    instance: "$1"
    job: "nsq"
    topic: "$2"
# mem
# nsq.<nsq_host>_<nsq_port>.mem.gc_runs
- match: "nsq.*.mem.gc_runs"
  name: "nsq_mem_gc_runs"
  match_metric_type: counter
  labels:
    instance: "$1"
    job: "nsq"

- match: "nsq.*.mem.*"
  name: "nsq_mem_${2}"
  match_metric_type: gauge
  labels:
    instance: "$1"
    job: "nsq"