mirror of
https://github.com/openappsec/openappsec.git
synced 2025-11-17 17:55:28 +03:00
pull main (#320)
* fix IPv6 masking * Prometheus support (#316) * Add prometheus support * Add prometheus support * Add prometheus support * Add prometheus support * Add prometheus support --------- Co-authored-by: avigailo <avigailo@checkpoint.com> * Fix Watchdog restarts (#319) * don't exit * fix restarting agent * fix watchdog restarts * Waf tag (#317) * add waf-tag to openappsec * fix waf tag to openappsec --------- Co-authored-by: wiaamm <wiaamm@checkpoint.com> --------- Co-authored-by: Wills Ward <wward@warddevelopment.com> Co-authored-by: orianelou <126462046+orianelou@users.noreply.github.com> Co-authored-by: avigailo <avigailo@checkpoint.com> Co-authored-by: wiaam96 <142393189+wiaam96@users.noreply.github.com> Co-authored-by: wiaamm <wiaamm@checkpoint.com>
This commit is contained in:
@@ -332,7 +332,17 @@ vector<PrometheusData>
|
||||
GenericMetric::getPromMetricsData()
|
||||
{
|
||||
vector<PrometheusData> all_metrics;
|
||||
if (!getProfileAgentSettingWithDefault(false, "prometheus")) return all_metrics;
|
||||
bool enable_prometheus = false;
|
||||
auto prometheus_settings = getProfileAgentSetting<bool>("prometheus");
|
||||
if (prometheus_settings.ok()) {
|
||||
enable_prometheus = prometheus_settings.unpack();
|
||||
} else {
|
||||
const char *prometheus_env = getenv("PROMETHEUS");
|
||||
if (prometheus_env != nullptr) {
|
||||
enable_prometheus = string(prometheus_env) == "true";
|
||||
}
|
||||
}
|
||||
if (!enable_prometheus) return all_metrics;
|
||||
dbgTrace(D_METRICS) << "Get prometheus metrics";
|
||||
|
||||
for (auto &calc : prometheus_calcs) {
|
||||
|
||||
Reference in New Issue
Block a user