Skip to content

📖 Metrics Docs Maintenance - #2024

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
dtfranz:metrics-doc-network-policy
Jun 12, 2025
Merged

📖 Metrics Docs Maintenance#2024
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
dtfranz:metrics-doc-network-policy

Conversation

@dtfranz

Copy link
Copy Markdown
Contributor

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 ownerJune 12, 2025 07:09
@netlify

netlifyBot commented Jun 12, 2025

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit1e7ca6f
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/684a8d65ed87cc0008ec5dc1
😎 Deploy Previewhttps://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.

@codecov

codecovBot commented Jun 12, 2025

Copy link
Copy Markdown

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 
FlagCoverage Δ
e2e42.94% <ø> (ø)
unit60.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.

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.

@camilamacedo86camilamacedo86Jun 12, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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

name: curl-metrics
namespace: olmv1-system
labels:
metrics: scraper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment threaddocs/draft/howto/consuming-metrics.md Outdated
name: curl-metrics-catalogd
namespace: olmv1-system
labels:
metrics: scraper

Copy link
Copy Markdown
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

Comment threaddocs/draft/howto/consuming-metrics.md Outdated
endpoints:
- path: /metrics
port: https
port: metrics

Copy link
Copy Markdown
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
dtfranzforce-pushed the metrics-doc-network-policy branch from 17b7494 to 1e7ca6fCompareJune 12, 2025 08:18

@camilamacedo86camilamacedo86 left a comment

Copy link
Copy Markdown
Contributor

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-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2025
@openshift-ci

Copy link
Copy Markdown

[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

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

@openshift-ciopenshift-ciBot 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-botBot merged commit 1a27741 into operator-framework:mainJun 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by an approver from all required OWNERS files.lgtmIndicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dtfranz@camilamacedo86