Skip to content
Snippets Groups Projects
Commit cf57f71d authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

added humanverification error log

parent 138438ae
No related branches found
No related tags found
2 merge requests!1645Development,!1643Development
......@@ -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();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment