Skip to content

ROX-28151: Custom Prometheus metrics minimal runner#15780

Closed
parametalol wants to merge 1 commit intomichael/ROX-28151-minimal-trackerfrom
michael/ROX-28151-minimal-runner
Closed

ROX-28151: Custom Prometheus metrics minimal runner#15780
parametalol wants to merge 1 commit intomichael/ROX-28151-minimal-trackerfrom
michael/ROX-28151-minimal-runner

Conversation

@parametalol
Copy link
Copy Markdown
Contributor

@parametalol parametalol commented Jun 18, 2025

Description

This PR couples the /v1/config service, main function and the trackers (with the image vulnerabilities as the first tracker). It exports a Singleton, that implements an HTTP handler that serves metrics registered on a dedicated registry.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Unit tests. See the following #15782 with the UI part for manual testing results.

sh$ curl -k https://localhost:8000/metrics -s -H "authorization: Bearer $ROX_API_TOKEN" | grep image_vuln | head -4
# HELP rox_central_image_vuln_deployment_severity The total number of aggregated CVEs aggregated by Cluster,Namespace,Deployment,Severity and gathered every 15m0s
# TYPE rox_central_image_vuln_deployment_severity gauge
rox_central_image_vuln_deployment_severity{Cluster="production",Deployment="admission-control",Namespace="stackrox",Severity="IMPORTANT_VULNERABILITY_SEVERITY"} 4
rox_central_image_vuln_deployment_severity{Cluster="production",Deployment="admission-control",Namespace="stackrox",Severity="LOW_VULNERABILITY_SEVERITY"} 72

Current dependencies on/for this PR:

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jun 18, 2025

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

@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at b3507f1.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-77-gb3507f1863.

1 similar comment
@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at b3507f1.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-77-gb3507f1863.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 18, 2025

Codecov Report

❌ Patch coverage is 52.25225% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.84%. Comparing base (82c9455) to head (b3507f1).

Files with missing lines Patch % Lines
central/metrics/aggregator/singleton.go 55.55% 17 Missing and 3 partials ⚠️
...metrics/aggregator/image_vulnerabilities/labels.go 20.00% 16 Missing ⚠️
central/metrics/aggregator/common/tracker_base.go 0.00% 6 Missing ⚠️
...etrics/aggregator/image_vulnerabilities/tracker.go 80.00% 4 Missing and 2 partials ⚠️
central/config/service/service.go 42.85% 4 Missing ⚠️
central/config/service/singleton.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           michael/ROX-28151-minimal-tracker   #15780    +/-   ##
===================================================================
  Coverage                              48.83%   48.84%            
===================================================================
  Files                                   2598     2601     +3     
  Lines                                 190942   191124   +182     
===================================================================
+ Hits                                   93256    93345    +89     
- Misses                                 90378    90453    +75     
- Partials                                7308     7326    +18     
Flag Coverage Δ
go-unit-tests 48.84% <52.25%> (+<0.01%) ⬆️

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@parametalol
Copy link
Copy Markdown
Contributor Author

Closed in favour of #15797.

@parametalol parametalol closed this Sep 8, 2025
@parametalol parametalol deleted the michael/ROX-28151-minimal-runner branch September 16, 2025 21:31
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.

3 participants