Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ OPTIONS:
--github-app-installation-id value GitHub App installation ID (default: 0) [$ATG_GITHUB_APP_INSTALLATION_ID]
--github-app-private-key value GitHub App private key (command line argument is not recommended) [$ATG_GITHUB_APP_PRIVATE_KEY]
--github-token value GitHub API token (command line argument is not recommended) [$ATG_GITHUB_TOKEN]
--auto-close-resolved-issues Should issues be automatically closed when resolved. If alerts have 'atg-skip-auto-close=true' annotation, issues will not be auto-closed. (default: true) [$ATG_AUTO_CLOSE_RESOLVED_ISSUES]
--auto-close-resolved-issues Should issues be automatically closed when resolved. If alerts have 'atg_skip_auto_close=true' annotation, issues will not be auto-closed. (default: true) [$ATG_AUTO_CLOSE_RESOLVED_ISSUES]
--reopen-window value Alerts will create a new issue instead of reopening closed issues if the specified duration has passed [$ATG_REOPEN_WINDOW]
--help, -h show help
```
Expand All @@ -110,15 +110,15 @@ Issue title and body are rendered from [Go template](https://golang.org/pkg/text

You can use the `--auto-close-resolved-issues` flag to automatically close issues when alerts are resolved.

If you want to skip auto-close for some alerts, add the `atg-skip-auto-close=true` annotation to them.
If you want to skip auto-close for some alerts, add the `atg_skip_auto_close=true` annotation to them.

```yaml
- alert: HighRequestLatency
expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5
labels:
severity: critical
annotations:
atg-skip-auto-close: "true"
atg_skip_auto_close: "true"
```

## Customize organization and repository
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func App() *cli.App {
Name: flagAutoCloseResolvedIssues,
Required: false,
Value: true,
Usage: "Should issues be automatically closed when resolved. If alerts have 'atg-skip-auto-close=true' annotation, issues will not be auto-closed.",
Usage: "Should issues be automatically closed when resolved. If alerts have 'atg_skip_auto_close=true' annotation, issues will not be auto-closed.",
EnvVars: []string{"ATG_AUTO_CLOSE_RESOLVED_ISSUES"},
},
&noDefaultDurationFlag{
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/templates/body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Previous Issue: {{ $previousIssue.HTMLURL }}

{{- if $payload.HasSkipAutoCloseAnnotation }}

*This issue will not be auto-closed because the alerts have `atg-skip-auto-close=true` annotation.*
*This issue will not be auto-closed because the alerts have `atg_skip_auto_close=true` annotation.*
{{- end }}

<!-- alert data: {{json $payload}} -->
2 changes: 1 addition & 1 deletion pkg/types/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
AlertStatusResolved AlertStatus = "resolved"
AlertStatusFiring AlertStatus = "firing"

skipAutoCloseAnnotationKey = "atg-skip-auto-close"
skipAutoCloseAnnotationKey = "atg_skip_auto_close"
skipAutoCloseAnnotationValue = "true"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/types/payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestWebhookPayloadHasSkipAutoCloseAnnotation(t *testing.T) {
payload: &WebhookPayload{
Alerts: []WebhookAlert{{
Annotations: map[string]string{
"atg-skip-auto-close": "true",
"atg_skip_auto_close": "true",
},
}},
},
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestWebhookPayloadHasSkipAutoCloseAnnotation(t *testing.T) {
Alerts: []WebhookAlert{
{
Annotations: map[string]string{
"atg-skip-auto-close": "true",
"atg_skip_auto_close": "true",
},
},
{
Expand Down