lesovsky/pgscv

Support of limiting size of query label from postgres_statements_query_info metric

bykvaadm opened this issue · 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!

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

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

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.