Hello, I am having some trouble with the Telegraf -> InfluxDB -> Chronograf pipeline.
I am trying to set up an integration with particle, so added the input webhooks.particle
When I POST a json request to the webhook, it successfully routes through telegraf, stores in influxdb, and I can see the data in a chronograf dashboard.
However, every time I post a value to telegraf, it crashes (causing my composer to reboot it).
Here is the POST request I am sending:
url = 'http://*******:1619/particle'
payload = {
"event": "sensor",
"measurement": "test_temperature",
"published_at": "2020-01-22",
"ttl": 60,
"data": {
"tags": {"id": "123"},
"values": {"temp": 27.28}
}
}
r = requests.post(url, data=json.dumps(payload))
Here is my telegraf.conf:
[agent]
collection_jitter = "0s"
debug = true
flush_interval = "10s"
flush_jitter = "0s"
hostname = "$HOSTNAME"
interval = "10s"
logfile = ""
metric_batch_size = 1000
metric_buffer_limit = 10000
omit_hostname = false
precision = ""
quiet = false
round_interval = true
[[processors.enum]]
[[processors.enum.mapping]]
dest = "status_code"
field = "status"
[processors.enum.mapping.value_mappings]
critical = 3
healthy = 1
problem = 2
[[outputs.health]]
service_address = "http://:8888"
[[outputs.health.compares]]
field = "buffer_size"
lt = 5000.0
[[outputs.health.contains]]
field = "buffer_size"
[[outputs.influxdb]]
database = "telegraf"
urls = [
"http://influxdb.monitoring:8086"
]
[[inputs.webhooks]]
service_address = ":1619"
[inputs.webhooks.particle]
path = "/particle"
Here are the logs (notice that it seems OK until it writes some data, then triggers a safe shutdown for some reason…):
E 2020-01-23T01:42:25.645234Z 2020-01-23T01:42:25Z I! Starting Telegraf 1.12.6
E 2020-01-23T01:42:25.645436076Z 2020-01-23T01:42:25Z I! Using config file: /etc/telegraf/telegraf.conf
E 2020-01-23T01:42:25.646189164Z 2020-01-23T01:42:25Z I! Loaded inputs: webhooks
E 2020-01-23T01:42:25.646269817Z 2020-01-23T01:42:25Z I! Loaded aggregators:
E 2020-01-23T01:42:25.646315783Z 2020-01-23T01:42:25Z I! Loaded processors: enum
E 2020-01-23T01:42:25.646395180Z 2020-01-23T01:42:25Z I! Loaded outputs: health influxdb
E 2020-01-23T01:42:25.646437133Z 2020-01-23T01:42:25Z I! Tags enabled: host=telegraf-polling-service
E 2020-01-23T01:42:25.646512432Z 2020-01-23T01:42:25Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"telegraf-polling-service", Flush Interval:10s
E 2020-01-23T01:42:25.646588761Z 2020-01-23T01:42:25Z D! [agent] Initializing plugins
E 2020-01-23T01:42:25.646635004Z 2020-01-23T01:42:25Z D! [agent] Connecting outputs
E 2020-01-23T01:42:25.646694073Z 2020-01-23T01:42:25Z D! [agent] Attempting connection to [outputs.health]
E 2020-01-23T01:42:25.646933890Z 2020-01-23T01:42:25Z I! [outputs.health] Listening on http://[::]:8888
E 2020-01-23T01:42:25.646996796Z 2020-01-23T01:42:25Z D! [agent] Successfully connected to outputs.health
E 2020-01-23T01:42:25.647106379Z 2020-01-23T01:42:25Z D! [agent] Attempting connection to [outputs.influxdb]
E 2020-01-23T01:42:25.651996642Z 2020-01-23T01:42:25Z D! [agent] Successfully connected to outputs.influxdb
E 2020-01-23T01:42:25.652092027Z 2020-01-23T01:42:25Z D! [agent] Starting service inputs
E 2020-01-23T01:42:25.652257564Z 2020-01-23T01:42:25Z I! Started the webhooks service on :1619
E 2020-01-23T01:42:40.000932879Z 2020-01-23T01:42:40Z D! [outputs.health] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:42:40.000966653Z 2020-01-23T01:42:40Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:42:50.000807641Z 2020-01-23T01:42:50Z D! [outputs.health] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:42:50.000856874Z 2020-01-23T01:42:50Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:00.001179324Z 2020-01-23T01:43:00Z D! [outputs.health] Wrote batch of 1 metrics in 2.679µs
E 2020-01-23T01:43:00.001215065Z 2020-01-23T01:43:00Z D! [outputs.health] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:00.005477536Z 2020-01-23T01:43:00Z D! [outputs.influxdb] Wrote batch of 1 metrics in 4.584854ms
E 2020-01-23T01:43:00.005517516Z 2020-01-23T01:43:00Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:10.000855316Z 2020-01-23T01:43:10Z D! [outputs.health] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:10.000892713Z 2020-01-23T01:43:10Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:20.000837346Z 2020-01-23T01:43:20Z D! [outputs.health] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:20.000911941Z 2020-01-23T01:43:20Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:25.290604800Z 2020-01-23T01:43:25Z D! [agent] Stopping service inputs
E 2020-01-23T01:43:25.290662495Z 2020-01-23T01:43:25Z I! Stopping the Webhooks service
E 2020-01-23T01:43:25.290667538Z 2020-01-23T01:43:25Z D! [agent] Input channel closed
E 2020-01-23T01:43:25.290671068Z 2020-01-23T01:43:25Z D! [agent] Processor channel closed
E 2020-01-23T01:43:25.290674608Z 2020-01-23T01:43:25Z I! [agent] Hang on, flushing any cached metrics before shutdown
E 2020-01-23T01:43:25.290678216Z 2020-01-23T01:43:25Z D! [outputs.health] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:25.290681597Z 2020-01-23T01:43:25Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
E 2020-01-23T01:43:25.290685030Z 2020-01-23T01:43:25Z D! [agent] Closing outputs
E 2020-01-23T01:43:25.290688531Z 2020-01-23T01:43:25Z D! [agent] Stopped Successfully