# Feature Testing: Monitoring and Alerting

**URL:** <https://forum.communityhealthtoolkit.org/t/feature-testing-monitoring-and-alerting/2621>\
**Category:** Product\
**Tags:** watchdog\
**Created:** [March 31, 2023, 10:08pm UTC](https://forum.communityhealthtoolkit.org/t/feature-testing-monitoring-and-alerting/2621 "2023-03-31T22:08:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [June 12, 2023, 2:23pm UTC](https://forum.communityhealthtoolkit.org/t/feature-testing-monitoring-and-alerting/2621/4 "2023-06-12T14:23:51Z")

</div>

@bamatic great questions! Watchdog is intended to be the spiritual successor of cht-app-monitoring-data-ingest! In Watchdog we want to take the wisdom and insights from app-monitoring, generalize and expand the scope of the monitoring/alerting, and provide everything in a format that is easily accessible to self-hosting partners!

> does grafana prometheus or the cht-watchdog code access directly postgresql to obtaine additional data ?

Yes! Watchdog [can be configured](https://docs.communityhealthtoolkit.org/apps/guides/hosting/monitoring/setup/#couch2pg-data) to connect to your couch2pg database and record metrics from Postgres data. Currently only a single metric ([`couch2pg_progress_sequence`](https://github.com/medic/cht-watchdog/blob/c917e4625ca0591b745a5c41774fbbaf6822f03d/exporters/postgres/config/cht-queries.yml#LL1C6-L1C6)) is being recorded, but many more will be added soon (and PRs are welcome!).

> can the cht-watchdog works without the postgresql database used by the couch2pg as the sink database ?

`cht-app-monitoring-data-ingest` queries the Postgres DB populated by couch2pg and then stores the recorded metric values _back in a Postgres database_ (where they can be queried by Superset). Watchdog, on the other hand, uses Prometheus to store the historical metrics data. So, metric values are recorded by calling the CHT `/monitoring` endpoint as well as by querying the couch2pg DB (as noted above) and then are stored in Promethes (where they can be queried by Grafana). Watchdog does not store metrics (or do any other create/update) in Postgres.

> wich kind of data needs the cht-watchdog to be obtained from postgresql that is not available throw the monitoring API ?

The [CHT `/monitoring` endpoint](https://docs.communityhealthtoolkit.org/apps/reference/api/#get-apiv2monitoring) provides a good amount of _general_ data about the CHT instance, but there is still quite a lot of useful information that can be mined from the data collected by couch2pg. Pretty much all of the metrics currently being collected from Postgres by `cht-app-monitoring-data-ingest` are not available via the `/monitoring` endpoint. (For example, if you wanted to know how many users have an unsupported Webview version, that data is not available from `/monitoring`, but can be calculated from the couch2pg data.)

---

_[View the full topic](https://forum.communityhealthtoolkit.org/t/feature-testing-monitoring-and-alerting/2621)._
