Skip to content

feat: Manage prometheus resources#2117

Draft
tolusha wants to merge 3 commits intomainfrom
servicemonitor
Draft

feat: Manage prometheus resources#2117
tolusha wants to merge 3 commits intomainfrom
servicemonitor

Conversation

@tolusha
Copy link
Copy Markdown
Contributor

@tolusha tolusha commented Apr 13, 2026

What does this PR do?

  1. New metrics package (pkg/deploy/metrics/) — a new reconciler that manages Prometheus resources:
    • ServiceMonitor objects for both Che Server (che-host) and DWO (devworkspace-controller)
    • RBAC (Role + RoleBinding) granting the prometheus-k8s service account access to scrape metrics endpoints
    • Adds the openshift.io/cluster-monitoring: "true" label to the operator namespace so OpenShift's built-in monitoring stack discovers the ServiceMonitors
  2. New CRD field — spec.devEnvironments.metrics (*bool, defaults to true) to enable/disable DWO metrics collection. Che Server metrics are controlled by the existing spec.components.metrics.enable field.
  3. Migration updates — refactored the one-time migration logic to also add the app.kubernetes.io/part-of=che.eclipse.org label to existing ServiceMonitor objects, and generally cleaned up the migration code (replaced
    logrus with structured logging, simplified label-setting logic).

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/CRW-8629
https://redhat.atlassian.net/browse/CRW-8589
https://redhat.atlassian.net/browse/CRW-8315

How to test this PR?

TODO

Common Test Scenarios

  • Deploy Eclipse Che
  • Start an empty workspace
  • Open terminal and build/run an image
  • Stop a workspace
  • Check operator logs for reconciliation errors or infinite reconciliation loops

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 13, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tolusha

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

tolusha added 2 commits April 14, 2026 17:00
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant