Skip to content

Conversation

dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Jun 12, 2025

Updates the docs around metrics gathering to include necessary NetworkPolicy, and fixes some errors in the ServiceMonitor yaml for securityContext and catalogd labels.

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@dtfranz dtfranz requested a review from a team as a code owner June 12, 2025 07:09
Copy link

netlify bot commented Jun 12, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 1e7ca6f
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/684a8d65ed87cc0008ec5dc1
😎 Deploy Preview https://deploy-preview-2024--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci openshift-ci bot requested review from perdasilva and trgeiger June 12, 2025 07:09
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.28%. Comparing base (0c9f0b5) to head (1e7ca6f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2024   +/-   ##
=======================================
  Coverage   69.28%   69.28%           
=======================================
  Files          79       79           
  Lines        7051     7051           
=======================================
  Hits         4885     4885           
  Misses       1884     1884           
  Partials      282      282           
Flag Coverage Δ
e2e 42.94% <ø> (ø)
unit 60.19% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -6,7 +6,7 @@ The following procedure is provided as an example for testing purposes. Do not d

In OLM v1, you can use the provided metrics with tools such as the [Prometheus Operator][prometheus-operator]. By default, Operator Controller and catalogd export metrics to the `/metrics` endpoint of each service.

You must grant the necessary permissions to access the metrics by using [role-based access control (RBAC) polices][rbac-k8s-docs].
You must grant the necessary permissions to access the metrics by using [role-based access control (RBAC) polices][rbac-k8s-docs]. You will also need to create a `NetworkPolicy` to allow egress traffic from your scraper pod, as the OLM namespace by default allows only `catalogd` and `operator-controller` to send and receive traffic.
Copy link
Contributor

@camilamacedo86 camilamacedo86 Jun 12, 2025

Choose a reason for hiding this comment

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

I do not think that is required.
See that the NPs that we have should allow already we scrap the metrics
Also, note that we are calling the metrics endpoint at: https://github.com/operator-framework/operator-controller/blob/main/test/e2e/metrics_test.go and we do not create any new NP

If we break it, then in the downstream we would no longer be able to get the metrics, and that is why we have a test to ensure it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just tried the guide again without the NetworkPolicy and it does not work. After I apply the NetworkPolicy, it works again.

The reason that the e2e test works is that it puts the curl pod into a random namespace, outside of olmv1-system. If you were to create the pod inside olmv1-system, the tests would fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, and to your point on downstream metrics, the reason that also works fine is because the metrics scraper pod does not live in the same namespace as catalogd or operator-controller.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. 👍
Thank you for the clarification

@@ -41,6 +60,8 @@ kind: Pod
metadata:
name: curl-metrics
namespace: olmv1-system
labels:
metrics: scraper
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -131,6 +155,8 @@ kind: Pod
metadata:
name: curl-metrics-catalogd
namespace: olmv1-system
labels:
metrics: scraper
Copy link
Contributor

Choose a reason for hiding this comment

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

we do not need either

@@ -253,7 +282,7 @@ metadata:
spec:
endpoints:
- path: /metrics
port: https
port: metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

Updates the docs around metrics gathering to include necessary NetworkPolicy, fixes some errors in the ServiceMonitor yaml for securityContext and catalogd labels, and makes the example curl commands easier to execute.

Signed-off-by: Daniel Franz <dfranz@redhat.com>
@dtfranz dtfranz force-pushed the metrics-doc-network-policy branch from 17b7494 to 1e7ca6f Compare June 12, 2025 08:18
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm

Great work 🥇

@dtfranz, thank you for checking that we need to update the docs after introducing the NP and working on it proactively.

/approved
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2025
Copy link

openshift-ci bot commented Jun 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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

The pull request process is described here

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 1a27741 into operator-framework:main Jun 12, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants