Commit 6252c4d6 authored by Ramon Nou's avatar Ramon Nou
Browse files

Enable Prometheus-cpp export in CI

parent 33e7ce65
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ gkfs:
      -DGKFS_ENABLE_PARALLAX:BOOL=ON
      -DGKFS_ENABLE_ROCKSDB:BOOL=ON
      -DGKFS_CHUNK_STATS:BOOL=ON
      -DGKFS_ENABLE_PROMETHEUS:BOOL=ON
      ${CI_PROJECT_DIR}
    - make -j$(nproc) install
    # reduce artifacts size
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@


// PROMETHEUS includes
#ifdef GKFS_PROMETHEUS
#ifdef GKFS_ENABLE_PROMETHEUS
#include <prometheus/counter.h>
#include <prometheus/summary.h>
#include <prometheus/exposer.h>
@@ -176,7 +176,7 @@ private:


// Prometheus Push structs
#ifdef GKFS_PROMETHEUS
#ifdef GKFS_ENABLE_PROMETHEUS
    std::shared_ptr<Gateway> gateway;   ///< Prometheus Gateway
    std::shared_ptr<Registry> registry; ///< Prometheus Counters Registry
    Family<Counter>* family_counter;    ///< Prometheus IOPS counter
+11 −0
Original line number Diff line number Diff line
@@ -33,6 +33,17 @@ using namespace std;

namespace gkfs::utils {

#ifdef GKFS_ENABLE_PROMETHEUS
static std::string
GetHostName() {
    char hostname[1024];

    if(::gethostname(hostname, sizeof(hostname))) {
        return {};
    }
    return hostname;
}
#endif

void
Stats::setup_Prometheus(std::string gateway_ip, std::string gateway_port) {
+1 −1
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ parse_input(const cli_options& opts, const CLI::App& desc) {
    }

#ifdef GKFS_ENABLE_PROMETHEUS
    if(desc.count("--prometheus_gateway")) {
    if(desc.count("--prometheus-gateway")) {
        auto gateway = opts.prometheus_gateway;
        GKFS_DATA->prometheus_gateway(gateway);
        GKFS_DATA->spdlogger()->debug("{}() Prometheus Gateway: '{}'", __func__,
+1 −1

File changed.

Contains only whitespace changes.