-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: emit metrics about entity imports #847
Conversation
c3d0fb1
to
32c2862
Compare
5da31a6
to
3745738
Compare
dc934a3
to
d4181a6
Compare
|
||
public function __construct(CollectorRegistry $registry) | ||
{ | ||
$this->successfulCounter = $registry->getOrRegisterCounter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a tricky decision here: if we define these counters only once, it means they will be missing from the metrics if they have never been increased yet (the controller that answers the scraper will not know about it yet as it's never been persisted).
Alternatively we could:
- duplicate this definition in the
Metrics/WikiEntityImport
class - move all metrics definitions to the service provider and have stub
metrics
methods on the metrics classes themselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand right this isn't really a big problem? It just means that instead of 0
we will have null
until the first import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly
config/database.php
Outdated
'host' => env('REDIS_HOST', '127.0.0.1'), | ||
'password' => env('REDIS_PASSWORD', null), | ||
'port' => env('REDIS_PORT', 6379), | ||
'database' => env('REDIS_METRICS_DB', 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not supported by the Prometheus library that just uses a hardcoded PROMETHEUS_
prefix on keys. I shall remove the setting again.
Ticket https://phabricator.wikimedia.org/T370799