Description of change
Refactoring of the APIServer metrics to include the following:
- PingFailures by model UUID
- LogWriteCount by model UUID - including success/failures
- LogReadCount by model UUID - including success/disconnects/errors
The re-work also changes how we register the APIServer metrics with the prometheus registry, and offloads that work to the worker. This should remove the Unregister/Register dependency and fallback to the normal Register/Unregister strategy.
One word of caution is that we might end up with a very slow /metrics endpoint depending on how many model UUIDs we're dealing with.
Additionally I've also deprecated a few metrics because either they're not required, or they're using the wrong namespace/subsystem and they can be removed for 2.6 release.
QA steps
Follow the steps in this discourse post all the way to and including "Adding Juju-specific metrics".
Then to view the "production" controller prometheus metrics, you can use the following command: Note: fill in the $PASSWORD for the user you created from the discourse post.
juju show-controller production --format=json | jq '.production.details."api-endpoints"[0]' | xargs -I % echo "https://%/introspection/metrics" | xargs curl -k -s -u user-prometheus:$PASSWORD | grep juju_apiserver_log_
该提问来源于开源项目:juju/juju