WIP prometheus exporter in the queue runner
[?]
GwwtQk9iqB3LBBBpJcyucAv5oM5SrQL5f6P3ak9Uxfnx
Jan 20, 2022, 2:10 AM
7V4ILUL2QMPWYRWLE7AFGFMFYUNBOYS5P3FCVBLFGUMBNOP652BACDependencies
- [2]
N3G7LLGEGet data needed by getBuildOutput() from the incoming NAR in a streaming fashion - [3]
WV4SSAIYBuild against nix-master - [4]
EBJP3MNABuild against nix-master - [5]
YSZQ3ORRFix build - [6]
ZMICO7M6Remove TokenServer in preparation of making NAR copying O(1) memory - [7]
24BMQDZAStart of single-process hydra-queue-runner - [8]
MHVIT4JYSplit hydra-queue-runner.cc more - [9]
3YSJ3LYKRemove finally.hh - [10]
WCXHTOWHDisable deprecation warnings - [*]
GS4BE6TBAsynchronously compress build logs - [*]
PLOZBRTRAdd command ‘hydra-queue-runner --status’ to show current status
Change contents
- edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 8
#include <prometheus/counter.h>#include <prometheus/exposer.h>#include <prometheus/registry.h> - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 850
using namespace prometheus;// create an http server running on port 8080Exposer exposer{"127.0.0.1:8080"};// create a metrics registry// @note it's the users responsibility to keep the object aliveauto registry = std::make_shared<Registry>();// add a new counter family to the registry (families combine values with the// same name, but distinct label dimensions)//// @note please follow the metric-naming best-practices:// https://prometheus.io/docs/practices/naming/exposer.RegisterCollectable(registry);auto& packet_counter = BuildCounter().Name("observed_packets_total").Help("Number of observed packets").Register(*registry);auto& tcp_rx_counter =packet_counter.Add({{"protocol", "tcp"}, {"direction", "rx"}});tcp_rx_counter.Increment(); - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 908[3.19444][13.4005]
state.prometheus = registry; - replacement in src/hydra-queue-runner/Makefile.am at line 7
hydra_queue_runner_LDADD = $(NIX_LIBS) -lpqxxhydra_queue_runner_LDADD = $(NIX_LIBS) -lpqxx -lprometheus-cpp-pull -lprometheus-cpp-core -lz