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

Add metrics of RunnerDeployment and HRA #408

Merged
merged 3 commits into from
Mar 19, 2021
Merged

Conversation

int128
Copy link
Contributor

@int128 int128 commented Mar 19, 2021

I'd like to monitor the metrics of RunnerDeployment and HorizontalRunnerAutoscaler.

This PR includes the following metrics:

  • horizontal_runner_autoscaler_min_replicas
  • horizontal_runner_autoscaler_max_replicas
  • horizontal_runner_autoscaler_desired_replicas
  • runner_deployment_replicas

Related to #312.

Comment on lines 9 to 10
rdName = "rd_name"
rdNamespace = "rd_namespace"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be a bit better to use names that are similar to those of kube-state-metrics? In kube-state-metrics, the namespace label is just namespace regardless of the kind and the name label is the lowercase kind name:

Suggested change
rdName = "rd_name"
rdNamespace = "rd_namespace"
rdName = "runnerdeployment"
rdNamespace = "namespace"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point 👍
I changed the labels to kube-state-metrics style. It would be better for consistency between various components such as kube-state-metrics.

@int128 int128 requested a review from mumoshu March 19, 2021 06:22
var (
horizontalRunnerAutoscalerMinReplicas = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "horizontal_runner_autoscaler_min_replicas",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the back-and-forth but according to how kube-state-metrics using horizontalpodautocaler instead of horizontal_pod_autoscaler, this could:

Suggested change
Name: "horizontal_runner_autoscaler_min_replicas",
Name: "horizontalrunnerautoscaler_min_replicas",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. I changed the name to horizontalrunnerautoscaler_spec_min_replicas like kube-state-metrics.

var (
runnerDeploymentReplicas = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "runner_deployment_replicas",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this could be:

Suggested change
Name: "runner_deployment_replicas",
Name: "runnerdeployment_replicas",

@int128 int128 requested a review from mumoshu March 19, 2021 07:09
Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks for your support @int128 ☺️

@mumoshu mumoshu merged commit 3a0332d into actions:master Mar 19, 2021
@int128 int128 deleted the add-metrics branch March 19, 2021 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants