diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ffc8ec..508e39d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.28) +cmake_minimum_required(VERSION 3.27) project(aliencat_exporter) set(CMAKE_CXX_STANDARD 20) diff --git a/main.cpp b/main.cpp index bc8f460..63fb10e 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,27 @@ #include +#include +#include + +#include +#include +#include int main() { - std::cout << "Hello, World!" << std::endl; + prometheus::Exposer exposer{"127.0.0.1:9000"}; + prometheus::Registry registry; + + auto& gouge = prometheus::BuildGauge() + .Name("aliencat_dnsmasq_leases") + .Register(registry); + + auto& counter = prometheus::BuildCounter() + .Name("aliencat_dnsmasq_leases") + .Register(registry); + + for (;;) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + gouge.Add({"mac", ""}).Set(0); + } + return 0; }