How to collect server level metrics for PostgreSQL #828
-
|
I am developing a collector for PostgreSQL, and this is a part of the content. but there are some error info: I used postgres exporter before. In that tool, I could avoid collecting server-level metrics redundantly by specifying "master: true". Does SQL exporter have a similar method? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
@XiangyuZhang-G SQL Exporter is not compatible with Postgres Exporter one-to-one, so some changes might be needed. I'd say in your case, your query returns multiple rows with the same value. For
I'm happy to assist, so let me know 😃👍 |
Beta Was this translation helpful? Give feedback.
@XiangyuZhang-G SQL Exporter is not compatible with Postgres Exporter one-to-one, so some changes might be needed.
I'd say in your case, your query returns multiple rows with the same value. For
sql_exporterit's important to avoid collecting duplicate data points. So we have the following options here:SELECT DISTINCTto filter results on the database end (this should address redundant values);key_labelsparameter;LIMIT 1.sql_exporteris a database-agnostic exporter, so there is nomaster: truesetting. It doesn't do any data processing to…