Skip to content

Commit

Permalink
Update Prometheus metrics + Add Grafana sample (#339)
Browse files Browse the repository at this point in the history
* Add time metrics

* Fix prometheus server parsing errors + fix cmd arg

* cmd arg here :)

* increase alarm interval

* fix naming

* add sample grafana dashboard

* add grafana info

* fix format issues

* add instance
  • Loading branch information
egecetin authored Oct 27, 2024
1 parent 28e83f8 commit 6983424
Show file tree
Hide file tree
Showing 12 changed files with 2,003 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Feel free to ask, use and report any bugs you encountered!
- [Scripts](#scripts)
- [Dependencies](#dependencies)
- [Targets](#targets)
- [Grafana](#grafana)

## CMake

Expand Down Expand Up @@ -92,3 +93,9 @@ Full dependency graph can be seen [here](doc/XXX-tree.svg)
- dependency-graph : Prepares graphviz visualization of dependencies
- package : Prepares default packages which includes deb/rpm package and symbols with a systemd service. You should specify the desired package type with -DCPACK_GENERATOR="DEB" (or "RPM")
- test : Prepares gtest target

## Grafana

Since there is a Prometheus server integration, also there is a Grafana integration. You can find an example for dashboard [here](scripts/GrafanaDashboard-1730032129887.json). Also you can see screenshot of the dashboard below.

<img src=doc/GrafanaDashboard.png>
Binary file added doc/GrafanaDashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions include/metrics/ProcessMetrics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class ProcessMetrics {
std::unique_ptr<std::thread> _thread; ///< Thread handler
std::shared_ptr<std::atomic_flag> _checkFlag; ///< Runtime check flag

prometheus::Gauge *_pInitTime; ///< Pointer to initialization time gauge
prometheus::Gauge *_pCurrentTime; ///< Pointer to the current time gauge
prometheus::Gauge *_pMemory; ///< Pointer to the memory usage gauge
prometheus::Gauge *_pPageFaults; ///< Pointer to the page faults gauge
prometheus::Gauge *_pCpuUsage; ///< Pointer to the CPU usage gauge
Expand Down
Loading

0 comments on commit 6983424

Please sign in to comment.