Skip to content

Commit

Permalink
added telegraf schema to hypertables
Browse files Browse the repository at this point in the history
  • Loading branch information
AV committed Jul 2, 2023
1 parent fede5f3 commit 30818f2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions telegraf/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@
# '''CREATE TABLE {{ .table }} ({{ .columns }})''',
# ]

create_templates = [
'''CREATE TABLE {{ .table }} ({{ .columns }})''',
'''ALTER TABLE {{ .table }} ALTER COLUMN time TYPE timestamp with time zone''',
'''SELECT create_hypertable({{ .table|quoteLiteral }}, 'time')''',
# '''ALTER TABLE {{ .table }} SET (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')''',
'''SELECT add_retention_policy({{ .table|quoteLiteral }}, INTERVAL '7 days')'''
]

# # Templated statements to execute when adding columns to a table.
# # Set to an empty list to disable. Points containing tags for which there is no column will be skipped. Points
# # containing fields for which there is no column will have the field omitted.
Expand Down

0 comments on commit 30818f2

Please sign in to comment.