Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Support of limiting size of query label from postgres_statements_query_info metric #18

Open
bykvaadm opened this issue Oct 27, 2021 · 3 comments

Comments

@bykvaadm
Copy link

bykvaadm commented Oct 27, 2021

postgres_statements_query_info may be really, really long. this can lead to a problem, that victoria/ptometheus wouldn't scrape any data from exporter because of timeout or metrics length. Anyway, nobody cares about full query, usually we take a little bit from beginning to make further discussion or grep by source code. It would be wonderfull if we could set a size of query label in postgres_statements_query_info metric, i.e. first 100 symbols or bytes. Thanks!

@bykvaadm bykvaadm changed the title Support of cutting statements from pg_stat_statements Support of limiting query label size from postgres_statements_query_info metric Oct 27, 2021
@bykvaadm bykvaadm changed the title Support of limiting query label size from postgres_statements_query_info metric Support of limiting size of query label from postgres_statements_query_info metric Oct 27, 2021
@glushakov
Copy link

+1 for this feature. In most case enough first X symbols and queryid.

@ginn13
Copy link

ginn13 commented Dec 24, 2021

@glushakov @bykvaadm you can use no_track_mode feature to disable whole query text in metrics. Environment variable named PGSCV_NO_TRACK_MODE is available for this purpose.

@ziXet
Copy link

ziXet commented Aug 23, 2022

I also think that we can limit it. the not_track_mode just remove the query and use the queryId. Is there anyway to lookup the queryId later and access the actual query? If not, I think limiting the actual query maybe to 255 char could be enough for debuggning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants