Open Lumiond opened 1 week ago
We cannot simply trim the field names without knowing anything. What if for examples there are two fields called
segments_remote_store_download_initial_session_download_size_bytes_succeeded
and segments_remote_store_download_initial_session_download_size_bytes_failed
? After auto-trimming both would be named segments_remote_store_download_initial_session_download_size_by
...
What you can do is to trim the fields yourself using the regex processor using
[[processors.regex]]
[[processors.regex.field_rename]]
pattern = '^_*(.{0,63}).*$'
replacement = "${1}"
## If the new field name already exists, you can either "overwrite" the
## existing one with the value of the renamed field OR you can "keep"
## both the existing and source field.
# result_key = "keep"
I see, but we have an official limit on identifier length. I think it's not acceptable to break official limits, so we need something to control identifiers, maybe some kind of mapping? And if you don't want to fix this bug, it's better to stop spamming the same information in logs.
First of all, I do agree that we should mention each field only once in the log. Regarding cutting the length: How about an option to cut the fields with the default to do nothing? It has to be an option as different versions of Postgres do have different limits and even the official docs suggest that you might change the limit in code. Would that work for you?
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.32.0, Debian 10, PgSQL 13.5, TimescaleDB 2.5.1
Docker
No response
Steps to reproduce
Expected behavior
All column's names with long length (greater than default pgsql column length name which equal 63 bytes, see https://www.postgresql.org/docs/current/limits.html) must be cut off. At least I have seen this behavior in old custom telegraf with pgsql_out (version 1.13)
Actual behavior
Long name does not change, so I lose metrics and get many errors in logs.
Additional info
I use elasticsearch input for opensearch cluster