Skip to content

Commit

Permalink
Merge pull request #298 from Alan01252/feature/alertmanager
Browse files Browse the repository at this point in the history
Add timestamp as label for alertmanager
  • Loading branch information
stefanprodan authored Jan 11, 2022
2 parents 0a49606 + 5a21f69 commit 1035a1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/spec/v1beta1/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ The provider will send the following labels for the event.
| ----------- | -------------------------------------------------------------------------------------------------- |
| alertname | The string Flux followed by the Kind and the reason for the event e.g FluxKustomizationProgressing |
| severity | The severity of the event (error|info) |
| timestamp | The timestamp of the event |
| reason | The machine readable reason for the objects transition into the current status |
| kind | The kind of the involved object associated with the event |
| name | The name of the involved object associated with the event |
Expand Down
1 change: 1 addition & 0 deletions internal/notifier/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (s *Alertmanager) Post(event events.Event) error {
labels["alertname"] = "Flux" + event.InvolvedObject.Kind + strings.Title(event.Reason)
labels["severity"] = event.Severity
labels["reason"] = event.Reason
labels["timestamp"] = event.Timestamp.String()

labels["kind"] = event.InvolvedObject.Kind
labels["name"] = event.InvolvedObject.Name
Expand Down

0 comments on commit 1035a1f

Please sign in to comment.