-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
feat: add label 'state' to metric 'gitea_users' #34326
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
base: main
Are you sure you want to change the base?
feat: add label 'state' to metric 'gitea_users' #34326
Conversation
I'd personally prefer to have label
Also the metrics should probably end with |
Good suggestion. I'll change it. |
I'm not sure about making that change a part of this PR, since it would be a breaking change. |
Sorry, I didn't look that closely at the code and figured it's a new metric. In this case you're right, it's not worth breaking here, I've been meaning to clean this up anyway (whenever I finally set my infrastructure up to actually gather and see those...) so I'll look at doing this then. |
How about keep the old metric as total users and added a new |
I get that would be fully backwards compatible but it feels wrong to do IMO. Also labels better show links between metrics, than having two separate ones. |
Added the "breaking" label to make sure we mention this in release notes. FWIW I think this change is beneficial and should be included. If it's not done in a backwards compatible way, that's probably ok since we have a process for alerting users. |
I agree. It's much cleaner to keep the current metric and just add the label. |
Adding a label is not a breaking change. If a user does not specify a label, they get the current value (the total number of user accounts). |
I might be misremembering but don't they get both metrics separately and you need to sum them to get the total number? |
Actually, I think you and @techknowlogick are right. Adding the label is a breaking change since users would get two metrics, and would need to sum to get to the current value (as you describe). |
Do you think we need any changes made to this PR? |
This PR adds the label state to the metric gitea_users. With the change, gitea_users would be reported like this:
The metrics above would be from a Gitea instance with 30 user accounts. 20 of the accounts are active and 10 of the accounts are not active.
Resolve #34325