Skip to content

Commit

Permalink
CRIMAP-713 Rename trivy prometheus label (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
timpeat authored Oct 30, 2023
1 parent 2db9d2a commit 2d35155
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions config/kubernetes/staging/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,22 @@ spec:

- alert: CrimeApplyReview-TrivyVulns
expr: >-
sum(trivy_image_vulnerabilities{namespace=~"^laa-review-criminal-legal-aid.*", severity=~"Critical|High|Medium"} > 0)
by (namespace, image_tag, severity)
sum by (namespace, image_tag, trivy_severity) (
label_replace(
trivy_image_vulnerabilities{namespace=~"^laa-review-criminal-legal-aid.*",severity=~"Critical|High|Medium"}
>
0,
"trivy_severity",
"$1",
"severity",
"(.*)"
)
)
for: 1h
labels:
severity: laa-crime-apply-alerts
annotations:
message: Image `{{ $labels.image_tag }}` in namespace `{{ $labels.namespace }}` has {{ $value }} {{ $labels.severity }} vulnerabilities.
message: Image `{{ $labels.image_tag }}` in namespace `{{ $labels.namespace }}` has {{ $value }} {{ $labels.trivy_severity }} vulnerabilities.
dashboard_url: https://grafana.live.cloud-platform.service.justice.gov.uk/d/trivy_starboard_operator123/trivy-operator-image-vulnerability?orgId=1&from=now-24h&to=now&var-namespace={{ $labels.namespace }}

- alert: CrimeApplyReview-PrometheusExporterFailure
Expand Down

0 comments on commit 2d35155

Please sign in to comment.