Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #207 from gessnerfl/feature/145_custom_fields_aler…
Browse files Browse the repository at this point in the history
…ting_channel

Closes #145: feature implemented, Q-metrics ok, manual and automated tests ok.
  • Loading branch information
gessnerfl authored Oct 31, 2023
2 parents 6afd878 + 7371071 commit a0e1599
Show file tree
Hide file tree
Showing 28 changed files with 1,109 additions and 669 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.18.0'
go-version: '1.20.0'

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-submisssion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: ">=1.18.0"
go-version: ">=1.20.0"

- name: Run snapshot action
uses: actions/go-dependency-submission@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.18.0
go-version: 1.20.0

- name: Import GPG key
id: import_gpg
Expand Down
11 changes: 11 additions & 0 deletions docs/resources/alerting_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ resource "instana_alerting_config" "example" {
integration_ids = [ "alerting-channel-id1", "alerting-channel-id2" ]
event_filter_query = "query"
event_filter_event_types = [ "incident", "critical" ]
custom_payload_field {
key = "test"
value = "test123"
}
}
```

Expand All @@ -49,6 +54,12 @@ resource "instana_alerting_config" "example" {
* `event_filter_rule_ids` - Optional - list of rule IDs which are included by the alerting config.
* `event_filter_event_types` - Optional - list of event types which are included by the alerting config.
Allowed values: `incident`, `critical`, `warning`, `change`, `online`, `offline`, `agent_monitoring_issue`, `none`
* `custom_payload_filed` - Optional - An optional list of custom payload fields (static key/value pairs added to the event). [Details](#custom-payload-field-argument-reference)

### Custom Payload Field Argument Reference

* `key` - Required - The key of the custom payload field
* `value` - Required - The value of the custom payload field

## Import

Expand Down
15 changes: 14 additions & 1 deletion docs/resources/application_alert_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ resource "instana_application_alert_config" "example" {
key = "test"
value = "test123"
}
custom_payload_filed {
key = "stage"
dynamic_value {
key = "stage"
tag_name = "aws.tag"
}
}
}
```

Expand Down Expand Up @@ -167,7 +175,12 @@ Exactly one of the elements below must be configured
### Custom Payload Field Argument Reference

* `key` - Required - The key of the custom payload field
* `value` - Required - The value of the custom payload field
* `value` - Optional - The static string value of the custom payload field. Either `value` or `dynamic_value` must be defined.
* `dynamic_value` - Optional - The dynamic value of the custom payload field [Details](#dynamic-custom-payload-field-value). Either `value` or `dynamic_value` must be defined.

#### Dynamic Custom Payload Field Value
* `key` - Optional - The key of the tag which should be added to the payload
* `tag_name` - Required - The name of the tag which should be added to the payload

### Threshold Argument Reference

Expand Down
15 changes: 14 additions & 1 deletion docs/resources/global_application_alert_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ resource "instana_global_application_alert_config" "example" {
key = "test"
value = "test123"
}
custom_payload_filed {
key = "stage"
dynamic_value {
key = "stage"
tag_name = "aws.tag"
}
}
}
```

Expand Down Expand Up @@ -166,7 +174,12 @@ Exactly one of the elements below must be configured
### Custom Payload Field Argument Reference

* `key` - Required - The key of the custom payload field
* `value` - Required - The value of the custom payload field
* `value` - Optional - The static string value of the custom payload field. Either `value` or `dynamic_value` must be defined.
* `dynamic_value` - Optional - The dynamic value of the custom payload field [Details](#dynamic-custom-payload-field-value). Either `value` or `dynamic_value` must be defined.

#### Dynamic Custom Payload Field Value
* `key` - Optional - The key of the tag which should be added to the payload
* `tag_name` - Required - The name of the tag which should be added to the payload

### Threshold Argument Reference

Expand Down
18 changes: 16 additions & 2 deletions docs/resources/website_alert_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,19 @@ resource "instana_website_alert_config" "example" {
time_window = 600000
}
}
custom_payload_field {
key = "test"
value = "test123"
}
custom_payload_filed {
key = "stage"
dynamic_value {
key = "stage"
tag_name = "aws.tag"
}
}
}
```

Expand All @@ -53,7 +62,7 @@ resource "instana_website_alert_config" "example" {
* `granularity` - Optional - default `600000` - The evaluation granularity used for detection of violations of the defined threshold. In other words, it defines the size of the tumbling window used. Allowed values: `300000`, `600000`, `900000`, `1200000`, `800000`
* `tag_filter` - Optional - The tag filter of the application alert config. [Details](#tag-filter-argument-reference)
* `rule` - Required - Indicates the type of rule this alert configuration is about. [Details](#rule-argument-reference)
* `custom_payload_filed` - Optional - An optional list of custom payload fields (static key/value pairs added to the event). [Details](#custom-payload-field-argument-reference)
* `custom_payload_filed` - Optional - An optional list of custom payload fields. [Details](#custom-payload-field-argument-reference)
* `threshold` - Required - Indicates the type of threshold this alert rule is evaluated on. [Details](#threshold-argument-reference)
* `time_threshold` - Required - Indicates the type of violation of the defined threshold. [Details](#time-threshold-argument-reference)
* `website_id` - Required - Unique ID of the website
Expand Down Expand Up @@ -122,7 +131,12 @@ Exactly one of the elements below must be configured
### Custom Payload Field Argument Reference

* `key` - Required - The key of the custom payload field
* `value` - Required - The value of the custom payload field
* `value` - Optional - The static string value of the custom payload field. Either `value` or `dynamic_value` must be defined.
* `dynamic_value` - Optional - The dynamic value of the custom payload field [Details](#dynamic-custom-payload-field-value). Either `value` or `dynamic_value` must be defined.

#### Dynamic Custom Payload Field Value
* `key` - Optional - The key of the tag which should be added to the payload
* `tag_name` - Required - The name of the tag which should be added to the payload

### Threshold Argument Reference

Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/gessnerfl/terraform-provider-instana

go 1.18
go 1.20

require (
github.com/alecthomas/participle v0.7.1
github.com/google/go-cmp v0.5.9
github.com/google/go-cmp v0.6.0
github.com/gorilla/mux v1.8.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
github.com/rs/xid v1.5.0
Expand All @@ -27,21 +27,21 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.5.1 // indirect
github.com/hashicorp/go-plugin v1.5.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.6.0 // indirect
github.com/hashicorp/hcl/v2 v2.18.0 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.19.0 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-go v0.19.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.2 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
Expand All @@ -50,17 +50,17 @@ require (
github.com/oklog/run v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.14.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/grpc v1.58.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit a0e1599

Please sign in to comment.