User Tools
watchdogs:creating_a_new_metric
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| watchdogs:creating_a_new_metric [2023/03/03 16:46] – created 10.91.129.5 | watchdogs:creating_a_new_metric [2023/03/06 16:16] (current) – 10.91.110.100 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Creating a New Metric on Prometheus ===== | ===== Creating a New Metric on Prometheus ===== | ||
| - | Author: Máté Domonics | + | Author: Máté Domonics |
| + | |||
| + | ==== SQL Exporter ==== | ||
| + | SQL Exporter is used to test your SQL queries before deploying them. Use this [[https:// | ||
| + | |||
| + | === Usage of SQL Exporter === | ||
| + | - Open up the folder in your preferred IDE for ease of access and change the **sql_exporter.yml** file to accommodate for the collector that you will be using. Also make sure to have the correct data source. | ||
| + | - Inside the **[collector_name].collector.yml** file, create your desired metrics. | ||
| + | - //Make sure to double check the correct syntax for the yaml file, as it is indentation sensitive.// | ||
| + | - 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, | ||
| + | - //Note that the **values** field is mandatory. Structure your SQL query around this.// | ||
| + | - Use this port number and go to http:// | ||
| + | - Once your metric has been checked and it works correctly when using **sql_exporter**, | ||
| + | |||
| + | ==== Deploying into the codebase ==== | ||
| + | - Clone the [[https:// | ||
| + | - This is found at: **prometheus-monitoring-config/ | ||
| + | - 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!// | ||
| + | - Save your changes locally, and move on to [[http:// | ||
watchdogs/creating_a_new_metric.1677861985.txt.gz · Last modified: 2023/03/03 16:46 by 10.91.129.5