-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using custom queries is deprecated in postgres_exporter #81
Comments
When addressing this, it would be a good idea to consider how we will support for getting metrics from a db populated by cht-sync vs couch2pg. Both should have first-class support and will probably use very similar exporters/configurations. (Also worth calling out that switching exporters may result in a breaking change that needs a major version bump of Watchdog (unless the format of the DB connection config files happens to match....)) |
@lorerod FYI about the cht-sync v& couch2pg support |
@jkuester - thanks again for the call earlier! Here's a status update that might be easier to digest. cc @eljhkrr Demo steps
Demo HTML (er "HTML")
Demo videopostgres-exporter-mini-demo.mp4 |
) * Replace deprecated SQL exporter with non-deprecated one per #81 * remove comments to clean up yaml file * default to local cht-couch2pg db values in example * set example yaml file to actually work with default couch2pg settings * set min_interval 60s which means calls happening <60s hit cache instead DB directly * remove config file that shouldn't have been committed * update git ignore, place holder for prom scrape * omg get entry command and file name correct * got prometheus scrape config working \o/ * adding scrape config * finalize dashboard, update example sql, remove comments from scrape, change gauge -> counter * add dev restart script, update detail dashboard json * start to get dev and test environs to work * normalize passwords for sql and couch2pg * feat(na): path to new compose file in CI, update readme how to add new sql * feat(na): fix path to ci test files * feat(na): update git ignore to include test fake file * fix(na): add set -e and fake cht to restart script per feedback
once medic/cht-docs#1367 is merged I'll close this ticket |
Tested this locally. I followed this steps with a couple of tweaks for Mac.
Thanks! |
Thanks @lorerod for all the testing! Much appreciated. Now that your testing went well and the docs PR is merged, closing out this ticket. |
intro
So, apparently the custom queries functionality in postgres_exporter which allows us to collect metrics based on the data in the postgres database (aka pretty much the only reason we are using the postgres_exporter) has been deprecated. It seems that the maintainers of postgres_exporter view the main purpose of the project as to provide metrics specific to the inner workings of the Postgres instance. They recommend using a different exporter for collecting metrics from the actual data in the Postgres database.
Test setup
pinning these to the top of the ticket, @mrjones-plip to keep up to date:
script/docker-helper-4.x
directory in CHT Core repo, start a docker helper instance of CHT core - note the URL and Port.192-168-68-17.local-ip.medicmobile.org:10464
- start your couch2pg instance bycd
into thecht-couch2pg
directory and running:localhost:5432
with usernamecht_couch2pg
, passwordcht_couch2pg_password
to databasecht
to ensure connection is workingcd
intowatchdog
repo directory and check out81-sql-exporter
repocht-instances.ylm
to have the URL from step 1. In this example it's192-168-68-17.local-ip.medicmobile.org:10464
exporters/postgres/sql_servers_example.yml
toexporters/postgres/sql_servers.yml
. Update the value in172-17-0-1.local-ip.medicmobile.org:10464
to match the CHT Core URL from step 2 above.cht-watchdog
directory, run the restart script:Test steps
*-sql_exporter-*
and go to that URL (http://172.30.0.4:9399/metrics
in this case).Services: cht-watchdog-grafana-1 http://172.30.0.3:3000 cht-watchdog-prometheus-1 http://172.30.0.5:9090/targets?search= cht-watchdog-json-exporter-1 http://172.30.0.2:7979/metrics cht-watchdog-sql_exporter-1 http://172.30.0.4:9399/metrics
medic
passwordpassword) and go to the main "admin overview" dashboard. ensure the "Couch2pg Backlog" panel is working. It should show a backlog of
0`:docker stop cht-couch2pg-cht-couch2pg-1
).docker start cht-couch2pg-cht-couch2pg-1
) and you should see the backlog go back to0
The text was updated successfully, but these errors were encountered: