Status Update
Comments
lu...@gmail.com <lu...@gmail.com> #3
Moving this to Gerrit backend because a plugin won't have enough visibility to the underlying Lucene index to provide an efficient way to exposing the number of projects documents.
lu...@gmail.com <lu...@gmail.com> #4
After a discussion with Alvaro, it becomes clear that the projects metrics is really about just indexes metrics. We need to create Gerrit metrics that track exactly the index status API reports:
curl -n https://<gerrit URL>/a/config/server/indexes | tail -1 | jq '.'
[
{
"name": "accounts",
"versions": {
"14": {
"is_write": true,
"is_search": true,
"num_docs": 23054
}
}
},
{
"name": "groups",
"versions": {
"11": {
"is_write": true,
"is_search": true,
"num_docs": 1673
}
}
},
{
"name": "changes",
"versions": {
"86": {
"is_write": true,
"is_search": true,
"num_docs": 316914
}
}
},
{
"name": "projects",
"versions": {
"9": {
"is_write": true,
"is_search": true,
"num_docs": 57722
}
}
}
]
The above metrics would allow a multi-primary setup, like GerritHub.io, to define alerts and pagerduty calls when a skew is detected between Gerrit primary nodes.
ap...@google.com <ap...@google.com> #5
Project: gerrit
Branch: master
Author: Alvaro Vilaplana Garcia <
Link:
Provide new metrics for account, change, group and project indexes
Expand for full commit details
Provide new metrics for account, change, group and project indexes
Introduce four new Gauge metrics to track the number of documents
in the respective search indexes:
* indexes/accounts
* indexes/changes
* indexes/groups
* indexes/projects
These metrics are particularly useful in multi-site scenarios, as they
provide visibility into the number of documents across different
indexes, aiding in the diagnosis of potential indexing issues.
Release-Notes: Provide index metric for accounts/changes/groups/projects
Bug: Issue 381216361
Change-Id: I24a16ddbb7fa70020c25536bc88c94ccc89e45fa
Files:
- M
Documentation/metrics.txt
- M
java/com/google/gerrit/metrics/dropwizard/DropWizardMetricMaker.java
- A
java/com/google/gerrit/server/index/IndexMetrics.java
- M
javatests/com/google/gerrit/acceptance/server/index/BUILD
- A
javatests/com/google/gerrit/acceptance/server/index/IndexMetricIT.java
Hash: 46e22419cc4f411f10ac64e76e69888d5d3270fc
Date: Fri Dec 06 11:58:25 2024
ap...@google.com <ap...@google.com> #6
Project: gerrit
Branch: master
Author: Alvaro Vilaplana Garcia <
Link:
Provide new metrics for account, change, group and project indexes
Expand for full commit details
Provide new metrics for account, change, group and project indexes
Introduce four new Gauge metrics to track the number of documents
in the respective search indexes:
* indexes/accounts
* indexes/changes
* indexes/groups
* indexes/projects
These metrics are particularly useful in multi-site scenarios, as they
provide visibility into the number of documents across different
indexes, aiding in the diagnosis of potential indexing issues.
Release-Notes: Provide index metric for accounts/changes/groups/projects
Bug: Issue 381216361
Change-Id: If7ed9c5153f0915a25cbc2e91d28ba5041b942ab
Files:
- M
java/com/google/gerrit/index/IndexCollection.java
- M
java/com/google/gerrit/index/project/BUILD
- M
java/com/google/gerrit/index/project/ProjectIndexCollection.java
- M
java/com/google/gerrit/server/index/account/AccountIndexCollection.java
- M
java/com/google/gerrit/server/index/change/ChangeIndexCollection.java
- M
java/com/google/gerrit/server/index/group/GroupIndexCollection.java
- A
javatests/com/google/gerrit/acceptance/index/IndexMetricIT.java
- M
javatests/com/google/gerrit/server/index/change/ChangeIndexRewriterTest.java
Hash: faba6a21f7a1b973a6cb48d8de09b5c416b247f9
Date: Mon Dec 23 17:51:20 2024
ap...@google.com <ap...@google.com> #7
Project: gerrit
Branch: master
Author: Alvaro Vilaplana Garcia <
Link:
Add new metrics for account, change, group and project Lucene indexes
Expand for full commit details
Add new metrics for account, change, group and project Lucene indexes
Introduce four new Gauge metrics to track the number of documents
in the respective search indexes:
* index/lucene/accounts
* index/lucene/changes
* index/lucene/groups
* index/lucene/projects
These metrics are particularly useful in multi-site scenarios, as they
provide visibility into the number of documents across different
indexes, aiding in the diagnosis of potential indexing issues.
Release-Notes: Provide index metric for accounts/changes/groups/projects
Bug: Issue 381216361
Change-Id: I92d5d62614f1bbf367e519e2aa2192fc5383d2fe
Files:
- M
Documentation/metrics.txt
- M
java/com/google/gerrit/lucene/BUILD
- A
java/com/google/gerrit/lucene/LuceneIndexMetrics.java
- M
java/com/google/gerrit/lucene/LuceneIndexModule.java
- A
javatests/com/google/gerrit/acceptance/testsuite/index/LuceneIndexMetricsIT.java
Hash: 098ef12cccb4727d845766314583d3ec7290305b
Date: Wed Jan 22 17:02:25 2025
Description
*** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!! *** Do not submit bugs for chrome/android and issues with your company's *** Gerrit setup here. Those issues belong in different issue trackers.
What steps will reproduce the problem?
What is the expected output?
Gerrit loads and is ready to operate with no delays.
What do you see instead?
Gerrit can have a significant delay when starting up. This is because the git-repo-metrics plugins loads all the repositories at startup to expose the
plugins_git_repo_metrics_numberOfProjects
metric.Here an example of startup logs:
The plugin took more than 30 seconds to load. The more the projects the longer will take.
Please provide any additional information below.
This metric should probably be moved in a separate plugin. The plugin is supposed to expose metric about the shape of repositories and by design is meant to be a lightweight plugin which shouldn't interfere with Gerrit lifecycle.