pgscv icon indicating copy to clipboard operation
pgscv copied to clipboard

Support of limiting size of query label from postgres_statements_query_info metric

Open bykvaadm opened this issue 3 years ago • 3 comments

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 avatar Oct 27 '21 00:10 bykvaadm

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

glushakov avatar Oct 28 '21 08:10 glushakov

@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.

ginn13 avatar Dec 24 '21 11:12 ginn13

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.

ziXet avatar Aug 23 '22 21:08 ziXet