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

Adding monitoring orchestration in the operator to collect metrics for Telemetry. #932

Merged
merged 7 commits into from
Jul 1, 2024

Conversation

bkhizgiy
Copy link
Member

@bkhizgiy bkhizgiy commented Jun 17, 2024

Following the addition of metrics to forklift-controller, this PR adds monitoring orchestration to add the ability to collect data and expose it for OpenShift-Monitor. These changes include the addition of different resources such as Service, the ServiceMonitor, and various labels needed for the metrics collection.

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.83%. Comparing base (50a2566) to head (1bd761f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #932   +/-   ##
=======================================
  Coverage   15.83%   15.83%           
=======================================
  Files         108      108           
  Lines       19911    19911           
=======================================
  Hits         3153     3153           
  Misses      16479    16479           
  Partials      279      279           
Flag Coverage Δ
unittests 15.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cmd/forklift-controller/main.go Outdated Show resolved Hide resolved
cmd/forklift-controller/main.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
@@ -84,7 +85,7 @@ func Add(mgr manager.Manager) error {
}

// Gather migration metrics
recordMetrics(mgr.GetClient())
Copy link
Member

Choose a reason for hiding this comment

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

since you removed this. did you check if now you need the permissions and monitor.yaml within the operator(operator/config/prometheus/monitor.yaml and within operator/config/rbac/leader_election_role.yaml)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't removed it, I just moved it to the monitor directory to have all the monitoring related things organized in the same place, but any way the yaml you referring is not related to the controller metrics (i'm not sure for what it used), but it configured on a different namespace and port. i'm creating the relevant file for the metric recording in the controller addition.

pkg/monitoring/metrics/forklift-controller/metrics.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/rules.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/rules.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/rules.go Outdated Show resolved Hide resolved
pkg/monitoring/rules/rules.go Outdated Show resolved Hide resolved
operator/config/rbac/forklift-controller_role.yaml Outdated Show resolved Hide resolved
@bkhizgiy bkhizgiy force-pushed the telemetry_rils branch 3 times, most recently from 62d6b20 to 5670d8f Compare June 18, 2024 15:13
@bkhizgiy
Copy link
Member Author

CI issue was fixed, CR changes in progress.

@ahadas ahadas added this to the 2.6.3 milestone Jun 19, 2024
@bkhizgiy
Copy link
Member Author

Remove all the rules setup since it is redundant, and move all the monitoring orchestration under metrics. This should simplify the PR. It was tested on OpenShift to ensure all the metrics are exposed.

@bkhizgiy bkhizgiy changed the title Adding recording rules for telemetry Adding monitoring orchestration in the controller to collect metrics for Telemetry. Jun 19, 2024
@bkhizgiy bkhizgiy force-pushed the telemetry_rils branch 2 times, most recently from 6a1682e to 2b01dc2 Compare June 25, 2024 09:46
@bkhizgiy
Copy link
Member Author

PR was rebased after merging #916.

@ahadas
Copy link
Member

ahadas commented Jun 30, 2024

Following the addition of metrics to forklift-controller, this PR adds monitoring orchestration to add the ability to collected data and expose it for OpenShift-Monitor. These changes include the addition of different resources such as Service, the ServiceMonitor, and various labels needed for the metrics collection.

to collect data*

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

why do we let forklift-controller add the metrics-related resources rather than the operator?

cmd/forklift-controller/main.go Outdated Show resolved Hide resolved
cmd/forklift-controller/main.go Outdated Show resolved Hide resolved
cmd/forklift-controller/main.go Outdated Show resolved Hide resolved
cmd/forklift-controller/main.go Outdated Show resolved Hide resolved
@bkhizgiy
Copy link
Member Author

bkhizgiy commented Jul 1, 2024

Moved all the relevant resource creation for monitoring to be managed by the operator rather than the controller.

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

minor comment about phrasing inside, other than that lgtm

operator/roles/forkliftcontroller/tasks/main.yml Outdated Show resolved Hide resolved
@bkhizgiy bkhizgiy changed the title Adding monitoring orchestration in the controller to collect metrics for Telemetry. Adding monitoring orchestration in the operator to collect metrics for Telemetry. Jul 1, 2024
@ahadas ahadas merged commit 6b3e581 into kubev2v:main Jul 1, 2024
12 checks passed
@ahadas ahadas removed this from the 2.6.3 milestone Jul 1, 2024
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.

3 participants