prometheus simpleapi included on mac & linux

This commit is contained in:
Grant Limberg 2023-04-14 11:31:39 -04:00
parent e108303cd6
commit 8bc105b527
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735
3 changed files with 15 additions and 2 deletions

View file

@ -9,7 +9,7 @@ ifeq ($(origin CXX),default)
CXX:=$(shell if [ -e /opt/rh/devtoolset-8/root/usr/bin/g++ ]; then echo /opt/rh/devtoolset-8/root/usr/bin/g++; else echo $(CXX); fi)
endif
INCLUDES?=-Izeroidc/target -isystem ext
INCLUDES?=-Izeroidc/target -isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include
DEFS?=
LDLIBS?=
DESTDIR?=

View file

@ -2,7 +2,7 @@ CC=clang
CXX=clang++
TOPDIR=$(shell PWD)
INCLUDES=-I$(shell PWD)/zeroidc/target -isystem $(TOPDIR)/ext
INCLUDES=-I$(shell PWD)/zeroidc/target -isystem $(TOPDIR)/ext -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/core/include -I$(TOPDIR)/ext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/simpleapi/include
DEFS=
LIBS=
ARCH_FLAGS=-arch x86_64 -arch arm64

View file

@ -87,6 +87,19 @@
#include "../ext/http-parser/http_parser.h"
#endif
#include <prometheus/simpleapi.h>
namespace prometheus {
namespace simpleapi {
std::shared_ptr<Registry> registry_ptr = std::make_shared<Registry>();
Registry& registry = *registry_ptr;
SaveToFile saver(registry_ptr, std::chrono::seconds(5), std::string("./metrics.prom"));
}
}
#if ZT_VAULT_SUPPORT
extern "C" {
#include <curl/curl.h>