We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running postgresql 15.6 with pgbouncer
My configuration for telegraf looks like this
[outputs.postgresql] schema = "telegraf" tags_as_foreign_keys = true create_templates = [ '''CREATE TABLE {{ .table }} ({{ .allColumns }})''', '''SELECT create_hypertable({{ .table|quoteLiteral }}, 'time', chunk_time_interval => INTERVAL '1d')''', '''ALTER TABLE {{ .table }} SET (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')''', '''SELECT add_compression_policy({{ .table|quoteLiteral }}, INTERVAL '2d')''', '''CREATE VIEW {{ .table.WithSuffix "_data" }} AS SELECT {{ .allColumns.Selectors | join "," }} FROM {{ .table }}''', '''CREATE VIEW {{ .table.WithSchema "public" }} AS SELECT time, {{ (.tagTable.Columns.Tags.Concat .allColumns.Fields).Identifiers | join "," }} FROM {{ .table.WithSuffix "_data" }} t, {{ .tagTable }} tt WHERE t.tag_id = tt.tag_id''', ] add_column_templates = [ '''ALTER TABLE {{ .table }} RENAME TO {{ (.table.WithSuffix "_" .table.Columns.Hash).WithSchema "" }}''', '''ALTER VIEW {{ .table.WithSuffix "_data" }} RENAME TO {{ (.table.WithSuffix "_" .table.Columns.Hash "_data").WithSchema "" }}''', '''DROP VIEW {{ .table.WithSchema "public" }}''', '''CREATE TABLE {{ .table }} ({{ .allColumns }})''', '''SELECT create_hypertable({{ .table|quoteLiteral }}, 'time', chunk_time_interval => INTERVAL '1d')''', '''ALTER TABLE {{ .table }} SET (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')''', '''SELECT add_compression_policy({{ .table|quoteLiteral }}, INTERVAL '2d')''', '''CREATE VIEW {{ .table.WithSuffix "_data" }} AS SELECT {{ .allColumns.Selectors | join "," }} FROM {{ .table }} UNION ALL SELECT {{ (.allColumns.Union .table.Columns).Selectors | join "," }} FROM {{ .table.WithSuffix "_" .table.Columns.Hash "_data" }}''', '''CREATE VIEW {{ .table.WithSchema "public" }} AS SELECT time, {{ (.tagTable.Columns.Tags.Concat .allColumns.Fields).Identifiers | join "," }} FROM {{ .table.WithSuffix "_data" }} t, {{ .tagTable }} tt WHERE t.tag_id = tt.tag_id''', ]
No errors
Linux, Telegraf 1.27.2, Postgresql 15.6 w timescaledb
No response
select * from cpu limit 1
I would expect to see the hostname in the view. However, I see tag_id. The tag_id matches the proper hostname when doing select host from cpu_tag;
select host from cpu_tag;
I see tag_id. I would expect to see the hostname
Using pgbouncer
The text was updated successfully, but these errors were encountered:
@keith6014 did you check the actual metrics e.g. by using the --test flag on a console or by using a outputs.file to check how the metrics look like?
--test
outputs.file
Otherwise, I guess the insert templates mess something up?
Sorry, something went wrong.
No branches or pull requests
Relevant telegraf.conf
Running postgresql 15.6 with pgbouncer
My configuration for telegraf looks like this
Logs from Telegraf
System info
Linux, Telegraf 1.27.2, Postgresql 15.6 w timescaledb
Docker
No response
Steps to reproduce
...
Expected behavior
select * from cpu limit 1
I would expect to see the hostname in the view. However, I see tag_id. The tag_id matches the proper hostname when doing
select host from cpu_tag;
Actual behavior
I see tag_id. I would expect to see the hostname
Additional info
Using pgbouncer
The text was updated successfully, but these errors were encountered: