User Tools

Site Tools


watchdogs:creating_a_new_metric

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
watchdogs:creating_a_new_metric [2023/03/06 16:02] 10.91.110.100watchdogs:creating_a_new_metric [2023/03/06 16:16] (current) 10.91.110.100
Line 12: Line 12:
     - Highly recommend using a database querying workbench such as **DBeaver** or **MySQL Workbench** to quickly test your SQL queries, as this will also allow you to preview what data you can expect to receive.     - Highly recommend using a database querying workbench such as **DBeaver** or **MySQL Workbench** to quickly test your SQL queries, as this will also allow you to preview what data you can expect to receive.
   - When your desired query is made, run the **sql_exporter** file in a terminal and observe any errors that may occur. If it runs successfully, a port will be displayed on screen.   - When your desired query is made, run the **sql_exporter** file in a terminal and observe any errors that may occur. If it runs successfully, a port will be displayed on screen.
 +    - //Note that the **values** field is mandatory. Structure your SQL query around this.//
   - Use this port number and go to http://localhost:[PortNumber]. Here, you can review whether your metrics got picked up correctly, and if they didn't, an error will be printed to the terminal where you have **sql_exporter** running. Analyse and fix this error if needed.   - Use this port number and go to http://localhost:[PortNumber]. Here, you can review whether your metrics got picked up correctly, and if they didn't, an error will be printed to the terminal where you have **sql_exporter** running. Analyse and fix this error if needed.
   - Once your metric has been checked and it works correctly when using **sql_exporter**, you can move on to the next step.   - Once your metric has been checked and it works correctly when using **sql_exporter**, you can move on to the next step.
Line 17: Line 18:
 ==== Deploying into the codebase ==== ==== Deploying into the codebase ====
   - Clone the [[https://bitbucket.org/errigal/prometheus-monitoring-config/src/master/|prometheus-monitoring-config repo]] to your local machine and find the collection that you want to make changes to.   - Clone the [[https://bitbucket.org/errigal/prometheus-monitoring-config/src/master/|prometheus-monitoring-config repo]] to your local machine and find the collection that you want to make changes to.
 +    - This is found at: **prometheus-monitoring-config/files/collectors**
   - Once found, place your SQL queries into the correct collector at the correct position.   - Once found, place your SQL queries into the correct collector at the correct position.
     - //Some collections are grouped together by multiple customers, so placement can be important!//     - //Some collections are grouped together by multiple customers, so placement can be important!//
   - Save your changes locally, and move on to [[http://wiki.err/doku.php?id=watchdogs:creating_a_new_alert|creating a new alert]].   - Save your changes locally, and move on to [[http://wiki.err/doku.php?id=watchdogs:creating_a_new_alert|creating a new alert]].
watchdogs/creating_a_new_metric.1678118530.txt.gz · Last modified: 2023/03/06 16:02 by 10.91.110.100