Skip to content
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

[Feature Request] gitlab runner per user and per user group metrics #23

Open
dennispost opened this issue Feb 11, 2022 · 7 comments
Open
Assignees

Comments

@dennispost
Copy link

Hey,

we need to get the run duration of each instance per user/usergroup. So that we can report the sum of total duration in minutes per user / month.

Can you report such a metric? E.g. anka_instance_state_per_user or anka_instance_state_per_usergroup

Thanks

@dennispost dennispost changed the title [Feature Request] [Feature Request] per_user / per_usergroup metric Feb 11, 2022
@NorseGaud
Copy link
Member

Hi @dennispost , what do you mean by user/usergroup? Can you give me an example?

@dennispost
Copy link
Author

Hey @NorseGaud , my idea was to calculate the sum of every minute where a user has an anka_instance in running_state.
So that we can report the sum of all running minutes per month.

I know that this does work in Enterprise Plus license tier only.

@NorseGaud
Copy link
Member

Do you mean the users of a certificate using certificate authentication? What sort of authentication method are you using?

@dennispost
Copy link
Author

dennispost commented Feb 14, 2022

As user I mean the user who has started the instance (e.g. with his acces token via a gitlab-runner). We've not configured authentication in our setup yet.

@NorseGaud
Copy link
Member

Got it -- thanks for the clarification.

In order to achieve this, the gitlab runner executor we created needs to post metadata with all of the available/relevant information that you want available in the exporter. This is because the exporter is a consumer of the API JSON from the Controller. If you start an instance with specific metadata (see API docs), it will be available on the instance object.

While we could modify both the runner executor to do this and then set up the exporter to consume it, this creates a situation where a feature of the exporter will only work if you're using the gitlab runner. I'm not sure if our dev team wants to accomplish it this way. I'll have a conversation with them about it and see what they recommend.

@NorseGaud NorseGaud self-assigned this Feb 14, 2022
@NorseGaud NorseGaud changed the title [Feature Request] per_user / per_usergroup metric [Feature Request] gitlab runner per user and per user group metrics Feb 14, 2022
@dennispost
Copy link
Author

dennispost commented Feb 14, 2022

Thanks for reaching out to your dev team.

The runner authenticates with credentials of a specific user or group. So these information are not stored currently?
If these would be stored, they could be available to the exporter. This is also not specific for gitlab, but maybe a general feature which should be added.

@NorseGaud
Copy link
Member

The runner and Controller are only able to communicate over the Controller's API (when it goes to request or terminate a VM). It only receives and sees what we pass into the API by the runner anka executor code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants