Since I upgraded Telegraf via apt to 1.5.0 I get an error with postgresql input:
Dec 27 10:39:17 vs-psql-03 telegraf[12274]: 2017-12-27T09:39:17Z I! Starting Telegraf v1.5.0
Dec 27 10:39:17 vs-psql-03 telegraf[12274]: 2017-12-27T09:39:17Z I! Loaded outputs: influxdb
Dec 27 10:39:17 vs-psql-03 telegraf[12274]: 2017-12-27T09:39:17Z I! Loaded inputs: inputs.system inputs.net inputs.nginx inputs.processes inputs.swap inputs.postgresql inputs.cpu inputs.disk inputs.diskio inputs.kernel inputs.mem inputs.redis
Dec 27 10:39:17 vs-psql-03 telegraf[12274]: 2017-12-27T09:39:17Z I! Tags enabled: environment=production host=vs-psql-03 rails_env=production role=cloud
Dec 27 10:39:17 vs-psql-03 telegraf[12274]: 2017-12-27T09:39:17Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"vs-psql-03", Flush Interval:10s
Dec 27 10:39:30 vs-psql-03 telegraf[12274]: 2017-12-27T09:39:30Z E! Field type conflict, dropping conflicted points: Response Error: Status Code [400], expected [204], [field type conflict: input field "datid" on measurement "postgresql" is type integer, already exists as type string]
My current telegraf.conf postgresql input config:
[[inputs.postgresql]]
address = "host=127.0.0.1 user=postgres sslmode=disable dbname=cloud"
databases = ["cloud"]
Possible workaround if you can live without this field is just to fielddrop it:
[[inputs.postgresql]]
fielddrop = ["datid"]
It looks like it is not going to be possible to fix this bug. The above workaround can be removed after the current shard's end_time is reached and new data begins being added to the next shard. However, there will still be some complications with queries whose results span the type change. More information is available in the InfluxDB documentation under "work the shard section".
Sorry about the inconvenience this has caused.
Most helpful comment
Possible workaround if you can live without this field is just to fielddrop it: