Skip to content

feat(monitoring): implement Dashboard 4 (CVE & Feed Conversions) for Plutono - #6304

Open
jess-lowe wants to merge 1 commit into
google:masterfrom
jess-lowe:feat/grafana-dash-4
Open

jess-lowe wants to merge 1 commit into
google:masterfrom
jess-lowe:feat/grafana-dash-4

Conversation

@jess-lowe

@jess-lowe jess-lowe commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Implements Dashboard 4 (4. CVE & Feed Conversions) for Plutono v7.5.52 (schemaVersion: 27), completing the 4-dashboard MVP observability suite described in the monitoring design:

  • Emits structured conversion-summary.json and cna-scorecards.json reports from vulnfeeds/ (cve5 and nvd).
  • Collects and exports osv_cve_* Prometheus gauges in go/cmd/custommetrics.
  • Adds deployment/clouddeploy/gke-workers/base/monitoring/dashboards/cve-feed-conversions.json and wires it into home.json and base/monitoring/kustomization.yaml.

Note: This pull request was developed with AI assistance.

Details

  • vulnfeeds/ Telemetry:
    • Updated ConductAnalysisAndUpload (vulnfeeds/conversion/common.go), nvd converter (vulnfeeds/conversion/nvd/converter.go, vulnfeeds/cmd/converters/cve/nvd-cve-osv/main.go), and vulnfeeds/models/metrics.go (CNAScorecard, ConversionSummaryReport) to track conversion outcomes, range extraction sources, OSV reference types, resolved/unresolved range counts, and top Assigner CNA scorecards.
  • custommetrics & GMP Metrics (go/):
    • Defined osv_cve_conversion_outcomes, osv_cve_range_sources, osv_cve_reference_types, osv_cve_resolved_ranges, and osv_cve_cna_outcomes in go/internal/metrics/metrics.go.
    • Updated go/cmd/custommetrics to poll conversion-summary.json (with CSV fallback and stale label cleanup) from OSV_CVE_CONVERSION_BUCKET (osv-test-cve-osv-conversion in oss-vdb-test, cve-osv-conversion in oss-vdb).
  • Plutono v7.5.52 Dashboard (base/monitoring/):
    • Ported cve-feed-conversions.json to schemaVersion: 27 (stat, gauge, bargauge, graph, and merge+organize table), deduplicated singleton gauges (max without (instance, pod)) and KSM job metrics (max by (cronjob, job_name)), added $gmp_datasource (Environment) + $converter variables, and enabled the Dashboard 4 card & directory link in home.json.

Testing

  • Added unit tests in go/cmd/custommetrics/collector_test.go and vulnfeeds/conversion/common_test.go (go test -count=1 ./cmd/custommetrics/... ./internal/metrics/..., go test -count=1 -run TestConductAnalysisAndUpload ./conversion/..., and golangci-lint across both modules: 0 issues).
  • Verified kubectl kustomize across oss-vdb-test, oss-vdb/monitoring, and private.

@jess-lowe
jess-lowe force-pushed the feat/grafana-dash-4 branch from 74a8251 to df43ab8 Compare December 2, 2026 03:26
@jess-lowe jess-lowe changed the title feat: prepare grafana dashboard 4 about converter feeds feat(monitoring): implement Dashboard 4 (CVE & Feed Conversions) for Plutono Dec 2, 2026
@codecov-commenter

codecov-commenter commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.89744% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.16%. Comparing base (20d257f) to head (df43ab8).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
go/cmd/custommetrics/collector.go 77.10% 19 Missing ⚠️
vulnfeeds/conversion/common.go 80.80% 19 Missing ⚠️
vulnfeeds/cmd/converters/cve/nvd-cve-osv/main.go 0.00% 8 Missing ⚠️
go/cmd/custommetrics/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6304      +/-   ##
==========================================
+ Coverage   56.99%   57.16%   +0.16%     
==========================================
  Files         225      225              
  Lines       23494    23668     +174     
==========================================
+ Hits        13391    13530     +139     
- Misses      10100    10135      +35     
  Partials        3        3              
Flag Coverage Δ
go 61.14% <76.19%> (+0.07%) ⬆️
vulnfeeds 47.19% <75.67%> (+0.47%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 59 to +60
GCS clients.CloudStorage
GCSProvider clients.CloudStorageProvider

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I feel like having both of these is a little odd.
Either have, like VulnBucket and CVEConversionBucket as both clients.CloudStorage, or just have the one GCSProvider

}

func (c *Collector) sourcePrefixesAndLastUpdated(ctx context.Context) ([]sourcePrefixes, map[string]time.Time) {
func (c *Collector) sourcePrefixesAndLastUpdated(ctx context.Context) ([]sourcePrefixes, map[string]time.Time, string) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe combine these return values into a struct so we don't have this mysterious string being returned
(or at least add a comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, tbh since it's only used as a fallback when OSV_CVE_CONVERSION_BUCKET isn't set (and there's a default value if that also fails), I'm not sure how much value grabbing the bucket name like this is

Comment on lines +368 to +370
if bucketName == "" {
bucketName = "osv-test-cve-osv-conversion"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO, we should fall back to not collecting data (e.g. the private instance wouldn't have a CVE conversion pipeline)

for _, conv := range converters {
summaryPath := conv.outcomesPrefix + "/conversion-summary.json"
data, err := bkt.ReadObject(ctx, summaryPath)
if err == nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would refactor this so the expected path isn't within the if block:

if errors.Is(err, clients.ErrNotFound) {
  // Fallback to latest outcomes CSV if conversion-summary.json has not been generated yet.
  c.collectCVEOutcomesFromLatestCSV(ctx, bkt, conv.name, conv.outcomesPrefix)
  
  continue
}
if err != nil {
  // ...
  continue
}

var summary conversionSummaryPayload
// ...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants