Skip to content

feat(monitoring): implement Dashboard 2 (pipeline ops) and Dashboard 3 (data quality & drift) - #6175

Merged
jess-lowe merged 15 commits into
google:masterfrom
jess-lowe:feat/monitoring-dashboards-2-and-3
Oct 21, 2026
Merged

jess-lowe merged 15 commits into
google:masterfrom
jess-lowe:feat/monitoring-dashboards-2-and-3

Conversation

@jess-lowe

@jess-lowe jess-lowe commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds Prometheus/GMP metrics and Grafana Dashboards 2 & 3 to monitor the ingestion pipeline, worker pools, Gitter, and vulnerability data quality.

How Metrics Are Collected

  1. Long-running services (worker, gitter, recoverer):

    • Each service now exposes a /metrics endpoint on port 9090 (go/internal/metrics), scraped by GMP PodMonitoring every 15s.
    • Tracks real-time counters and latency for worker tasks/failures (default, reimport, and cves pools), Gitter requests/cache disk usage, and recovery tasks.
  2. Batch & dataset state metrics (custommetrics):

    • Since CronJobs exit too quickly for GMP to scrape directly, importer-reconciler and importer-deleter now save run summaries to Datastore (JobData).
    • Converted custommetrics (go/cmd/custommetrics) into a lightweight 1-replica Deployment that polls Datastore (JobData, SourceRepository, ImportFindings) and GCS (all.zip, modified_id.csv) every 5 minutes and exposes Prometheus gauges on :9090/metrics (drift counts, linter findings, feed freshness, and dataset size).
  3. Grafana & GKE Config (deployment/clouddeploy/gke-workers/):

    • Added PodMonitoring scraping for workers, gitter, recoverer, and custommetrics.
    • Enabled the Cloud Logging datasource plugin and provisioned Dashboard 2 (pipeline-ingestion-ops.json) and Dashboard 3 (data-quality-drift.json).

    It is somewhat difficult to know if this works without deploying it unfortunately.

jess-lowe and others added 10 commits October 15, 2026 04:58
…3 (data quality & drift)

- Add Dashboard 2: Ingestion & Worker Pipeline Operations (Pub/Sub backlog, drain speed, worker latencies, failed tasks, reconciler & deleter metrics).
- Add Dashboard 3: Vulnerability Data Quality & Ecosystem Health (drift detection, linter findings, feed staleness, archive sizes, and Gitter ops).
- Register dashboards in environments/oss-vdb-test/monitoring/kustomization.yaml configMapGenerator.
…g configs

mktemp creates directories with 0700 permissions by default, preventing the
non-root grafana user in the Docker container from reading the mounted
dashboards.yaml and datasources.yaml provisioning files.
Comment thread go/cmd/custommetrics/collector.go Outdated
c.collectDatasetAndExportMetrics(ctx)
}

func (c *Collector) collectSourceFreshnessAndPrefixes(ctx context.Context) map[string]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.

I don't really like this function doing two distinct things (recording the last updates metrics, and returning a prefix -> source map)

Could this maybe just return the prefixes and the last-updated times as maps, then have the caller iterate through and publish the metrics?

Comment thread go/cmd/custommetrics/collector.go Outdated
metrics.RecordCheckerDrift.WithLabelValues("gcs_missing_or_stale").Set(float64(len(invalidIDs)))
countsBySource := make(map[string]int)
for _, id := range invalidIDs {
prefix := strings.Split(id, "-")[0] + "-"

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.

nit: I like strings.Cut better for this

But also, a few of our android prefixes don't have the trailing - on their IDs. Not sure if we should just standardise the android ones, or swap this to a slices.ContainsFunc calling strings.HasPrefix(prefix, id)

Comment thread go/cmd/custommetrics/main.go Outdated
Comment on lines 98 to 173
// hard-coded cluster not ideal, but this is the only cluster in the instance.
"project_id": project,
"location": "us-central1-f",

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.

so... we moved the cluster to us-west2-b on test / us-west2-c on prod............
I guess we could query the gce metadata server, or just put it as an environment variable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah good point

Multi-hyphen prefixes: Android IDs (e.g., ASB-A-153358911 or PUB-A-12345) have multiple hyphens. Any cut or split on - (such as strings.Cut(id, "-")) cuts at the first hyphen, yielding "ASB" (or "ASB-"), which would never match "ASB-A" so even if source.yaml were updated to standardize Android prefixes with trailing hyphens (ASB-A-, PUB-A-), strings.Cut(id, "-") would still fail for the reason above.
@jess-lowe
jess-lowe merged commit e7dd0c3 into google:master Oct 21, 2026
23 of 24 checks passed
@jess-lowe
jess-lowe deleted the feat/monitoring-dashboards-2-and-3 branch October 21, 2026 04:30
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.

2 participants