-
Notifications
You must be signed in to change notification settings - Fork 100
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 initial metrics support #422
Conversation
This adds the necessary code infrastructure to allow serving metrics within the operator daemonset (spod). The metrics are for now served unencrypted on port :8081. An additional service `metrics` can be used for scraping from prometheus (by using the auto-discover plugin `kubernetes_sd_configs` or a `ServiceMonitor` together with the prometheus-operator). This patch features a sample metric counter `security_profiles_operator_seccomp_profile`, which can be distinguished by the labels `update` and `delete`. For example, if we create 4 new profiles and delete them afterwards, then the output should look like: ``` \# HELP security_profiles_operator_seccomp_profile Counter about seccomp profile operations. \# TYPE security_profiles_operator_seccomp_profile counter security_profiles_operator_seccomp_profile{operation="delete"} 4 security_profiles_operator_seccomp_profile{operation="update"} 4 ``` Things to be done after this patch: - decide which metrics we would like to implement - provide documentation around the feature - add metric related e2e tests Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Codecov Report
@@ Coverage Diff @@
## master #422 +/- ##
==========================================
+ Coverage 38.00% 39.69% +1.69%
==========================================
Files 20 22 +2
Lines 950 985 +35
==========================================
+ Hits 361 391 +30
- Misses 574 579 +5
Partials 15 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! This looks like a great start!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JAORMX, saschagrunert 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This adds the necessary code infrastructure to allow serving metrics
within the operator daemonset (spod). The metrics are for now served
unencrypted on port :8081. An additional service
metrics
can be usedfor scraping from prometheus (by using the auto-discover plugin
kubernetes_sd_configs
or aServiceMonitor
together with theprometheus-operator).
This patch features a sample metric counter
security_profiles_operator_seccomp_profile
, which can be distinguishedby the labels
update
anddelete
. For example, if we create 4 newprofiles and delete them afterwards, then the output should look like:
Things to be done after this patch:
Which issue(s) this PR fixes:
Refers to #276
Does this PR have test?
Yes
Special notes for your reviewer:
Does this PR introduce a user-facing change?