Commit cf57f71d authored by Dominik Hebeler's avatar Dominik Hebeler

added humanverification error log

parent 138438ae
......@@ -128,10 +128,11 @@ class HumanVerification
if ($user["unusedResultPages"] === 50 || ($user["unusedResultPages"] > 50 && $user["unusedResultPages"] % 25 === 0)) {
$user["locked"] = true;
}
}
\App\PrometheusExporter::HumanVerificationSuccessfull();
} catch (\Exception $e) {
Log::error($e->getMessage());
\App\PrometheusExporter::HumanVerificationError();
} finally {
if ($update && $user != null) {
if ($user["whitelist"]) {
......@@ -141,7 +142,6 @@ class HumanVerification
}
try {
$this->setUser($prefix, $user);
\App\PrometheusExporter::HumanVerificationSuccessfull();
} catch (\Exception $e) {
Log::error($e->getMessage());
}
......
......@@ -29,7 +29,14 @@ class PrometheusExporter
public static function HumanVerificationSuccessfull()
{
$registry = \Prometheus\CollectorRegistry::getDefault();
$counter = $registry->getOrRegisterCounter('metager', 'humanverification', 'counts how often humanverification middleware was successfull', []);
$counter = $registry->getOrRegisterCounter('metager', 'humanverification_success', 'counts how often humanverification middleware was successfull', []);
$counter->inc();
}
public static function HumanVerificationError()
{
$registry = \Prometheus\CollectorRegistry::getDefault();
$counter = $registry->getOrRegisterCounter('metager', 'humanverification_error', 'counts how often humanverification middleware had an error', []);
$counter->inc();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment