Skip to content

Commit

Permalink
Add FindingSubject.__str__ (#523)
Browse files Browse the repository at this point in the history
This is important for the PagerDuty sink where we convert the FindingSubject to string. We should have a standard representation for it.
  • Loading branch information
aantn authored Sep 10, 2022
1 parent 30dd1bb commit 67330da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ builtinPlaybooks:
- triggers:
- on_prometheus_alert:
alert_name: CPUThrottlingHigh
status: "all" # sometimes this enricher silences the alert, so we need to silence it regardless of status
actions:
- cpu_throttling_analysis_enricher: {}
- alert_graph_enricher:
Expand Down
5 changes: 5 additions & 0 deletions src/robusta/core/reporting/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def __init__(
self.namespace = namespace
self.node = node

def __str__(self):
if self.namespace is not None:
return f"{self.namespace}/{self.subject_type.value}/{self.name}"
return f"{self.subject_type.value}/{self.name}"


class Finding(Filterable):
"""
Expand Down

0 comments on commit 67330da

Please sign in to comment.