3#include "util/config/ConfigDefinition.hpp"
4#include "util/log/Logger.hpp"
5#include "util/prometheus/Bool.hpp"
6#include "util/prometheus/Label.hpp"
7#include "util/prometheus/Prometheus.hpp"
9#include <boost/signals2/signal.hpp>
10#include <boost/signals2/variadic_signal.hpp>
27 static std::shared_ptr<SystemState>
30 auto state = std::make_shared<SystemState>();
31 state->isStrictReadonly = config.
get<
bool>(
"read_only");
44 "Whether the process is in strict read-only mode"
51 "Whether the process is writing to the database"
85 "etl_amendment_blocked",
87 "Whether clio detected an amendment block"
97 "etl_corruption_detected",
99 "Whether clio detected a corruption that needs manual attention"
115 "etl_writing_deciding_fallback",
117 "Whether the cluster is using the fallback writer decision mechanism"
static util::prometheus::Bool boolMetric(std::string name, util::prometheus::Labels labels, std::optional< std::string > description=std::nullopt)
Get a bool based metric. It will be created if it doesn't exist.
Definition Prometheus.cpp:201
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:31
T get(std::string_view fullKey) const
Returns the specified value of given string if value exists.
Definition ConfigDefinition.hpp:85
Class representing a collection of Prometheus labels.
Definition Label.hpp:41
Represents the state of the ETL subsystem.
Definition SystemState.hpp:20
static std::shared_ptr< SystemState > makeSystemState(util::config::ClioConfigDefinition const &config)
Factory method to create a SystemState instance.
Definition SystemState.hpp:28
util::prometheus::Bool isAmendmentBlocked
Whether clio detected an amendment block.
Definition SystemState.hpp:84
WriteCommand
Commands for controlling the ETL writer state.
Definition SystemState.hpp:63
@ StopWriting
Definition SystemState.hpp:65
@ StartWriting
Definition SystemState.hpp:64
std::atomic_bool etlStarted
Shows whether ETL started monitor and ready to become a writer if needed.
Definition SystemState.hpp:55
util::prometheus::Bool isCorruptionDetected
Whether clio detected a corruption that needs manual attention.
Definition SystemState.hpp:96
boost::signals2::signal< void(WriteCommand)> writeCommandSignal
Signal for coordinating ETL writer state transitions.
Definition SystemState.hpp:75
util::prometheus::Bool isStrictReadonly
Whether the process is in strict read-only mode.
Definition SystemState.hpp:41
util::prometheus::Bool isWriting
Whether the process is writing to the database.
Definition SystemState.hpp:48
util::prometheus::Bool isWriterDecidingFallback
Whether the cluster is using the fallback writer decision mechanism.
Definition SystemState.hpp:114