From Telegraf To NewRelic


wget -qO- | sudo apt-key add -
apt-get update
apt-get install telegraf
systemctl start telegraf
root@ye:/etc/telegraf# cat /var/log/legacy-mq-metrics.log 
{"timestamp": 1588100043050, "metricName": "messageQueue.operation", "product": "Legacy MQ", "productVersion": "", "connectionId": "64688F5E01E47020", "clientIpAddress": "", "clientName": "JMS Producer", "queueManager": "QM1", "queueTopic": "MY.QUEUE.1", "putMessage": 3605}
{"timestamp": 1588100044203, "metricName": "messageQueue.operation", "product": "Legacy MQ", "productVersion": "", "connectionId": "64688F5E01F0F77A", "clientIpAddress": "", "clientName": "JMS Consumer","queueManager": "QM1", "queueTopic": "MY.QUEUE.1", "getMessage": 2000}
{"timestamp": 1588100060150, "metricName": "messageQueue.operation", "product": "Legacy MQ", "productVersion": "", "connectionId": "64688F5E01E47020", "clientIpAddress": "", "clientName": "Fin Producer", "queueManager": "QM1", "queueTopic": "MY.QUEUE.2", "putMessage": 400}
{"timestamp": 1588100065285, "metricName": "messageQueue.operation", "product": "Legacy MQ", "productVersion": "", "connectionId": "64688F5E01F0F77A", "clientIpAddress": "", "clientName": "Fin Consumer", "queueManager": "QM1", "queueTopic": "MY.QUEUE.2", "getMessage": 400}
[email protected]:/etc/telegraf# cat /etc/telegraf/telegraf.conf
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false
  ## Log at debug level.
  debug = true
  ## Log only error level messages.
  # quiet = false
  logtarget = "file"
  logfile = "/var/log/telegraf.log"
  logfile_rotation_interval = "1d"
  logfile_rotation_max_size = "5MB"
# Send telegraf metrics to a file for debugging
  ## Files to write to, "stdout" is a specially handled file.
  files = ["/var/log/metrics.out"]
  use_batch_format = false
  data_format = "json"
  insights_key = "0154f7b739637exxxxxxxxxxxxxxxxxxxxxxxxxx"
  # we don’t need to send this as a field.  The plugin will send a proper timestamp via the Metrics API.
  fielddrop = ["timestamp"]
  percpu = true
  totalcpu = true
  collect_cpu_time = false
  report_active = false
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
# Config for legacy MQ metrics
  # The file we want to tail
  files = ["/var/log/legacy-mq-metrics.log"]
  # Donツ’t reach back to the beginning (it may be a ton of data)
  from_beginning = false
  # This plugin automatically adds this tag, we donツ’t want to emit it.
  tagexclude = ["path"]
  # Method used to watch for file changes.  Can watch by ツ“inotifyツ” or ツ“pollツ”
  watch_method = "poll"
  data_format = "json"
  # This will be our Measurement Name
  json_name_key = "metricName"
  # Use the timestamp field for our metric timestamp, if omitted Telegraf will insert one automatically.
  json_time_key = "timestamp"
  json_time_format = "unix_ms"
  tag_keys = ["product",

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.