barcamp-monitoring/config/telegraf/telegraf.d/solar-shelly.conf

45 lines
1.3 KiB
Plaintext

[[inputs.http]]
#URL for NYC's Citi Bike station data in JSON format
urls = ["http://192.168.178.139/status"]
#Overwrite measurement name from default `http` to `citibikenyc`
name_override = "solar_shelly"
#Exclude url and host items from tags
tagexclude = ["url", "host"]
#Data from HTTP in JSON format
data_format = "json"
#Parse `stationBeanList` array only
json_query = "meters"
#Set station metadata as tags
#tag_keys = ["id", "stationName", "city", "postalCode"]
#Do not include station landmark data as fields
#fielddrop = ["landMark"]
#JSON values to set as string fields
#json_string_fields = ["statusValue", "stAddress1", "stAddress2", "location", "landMark"]
#Latest station information reported at `lastCommunicationTime`
#json_time_key = "timestamp"
#Time is reported in Golang "reference time" format
#json_time_format = "unix"
#json_timezone = "UTC"
[[outputs.postgresql]]
# https://github.com/influxdata/telegraf/blob/release-1.24/plugins/outputs/postgresql/README.md
connection = "postgres://postgres:ijeec9Uy@timescaledb"
tags_as_foreign_keys = true
create_templates = [
'''CREATE TABLE {{ .table }} ({{ .columns }})''',
'''SELECT create_hypertable({{ .table|quoteLiteral }}, 'time', chunk_time_interval => INTERVAL '1h')''',
'''ALTER TABLE {{ .table }} SET (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')''',
]