Skip to content

feat(alerts): add notify_on_acknwoledge, deprecated opts at notification channel level#679

Merged
dbonf merged 3 commits intomasterfrom
move-nc-options-at-alert-level
Jan 13, 2026
Merged

feat(alerts): add notify_on_acknwoledge, deprecated opts at notification channel level#679
dbonf merged 3 commits intomasterfrom
move-nc-options-at-alert-level

Conversation

@dbonf
Copy link
Copy Markdown
Collaborator

@dbonf dbonf commented Nov 28, 2025

  • add new attribute notify_on_acknwoledge on all alert resources, it should be used if one want to send a notification for an alert that has been manually acknowledged by a user;
  • deprecate notify_when_ok and notify_when_resolved on notification channel resources: users should define these behaviors at alert level now.

technical note: to allow for boolean attributes with no default, we use the string type, enforcing "true" and "false" values, instead of boolean values, because with the current terraform sdk there is no way to distinguish "false" from no value defined.

@dbonf dbonf marked this pull request as draft November 28, 2025 16:43
@dbonf dbonf force-pushed the move-nc-options-at-alert-level branch 5 times, most recently from 6102d98 to a69f90c Compare December 1, 2025 08:28
@dbonf dbonf marked this pull request as ready for review December 1, 2025 09:03
@dbonf dbonf self-assigned this Dec 1, 2025
@dbonf dbonf force-pushed the move-nc-options-at-alert-level branch from a69f90c to fdd3d76 Compare December 9, 2025 08:24
@dbonf dbonf force-pushed the move-nc-options-at-alert-level branch from fdd3d76 to 7ae8476 Compare December 17, 2025 10:39
@dbonf dbonf force-pushed the move-nc-options-at-alert-level branch from 7ae8476 to 7843a60 Compare January 7, 2026 07:21
DagDigg
DagDigg previously approved these changes Jan 7, 2026
Comment thread sysdig/resource_sysdig_monitor_alert_v2_common.go
Comment thread sysdig/resource_sysdig_monitor_notification_channel_common.go Outdated
Comment thread sysdig/resource_sysdig_monitor_notification_channel_common.go Outdated
Comment thread sysdig/resource_sysdig_monitor_notification_channel_common.go Outdated
Comment thread sysdig/resource_sysdig_secure_notification_channel_common.go Outdated
Comment thread sysdig/resource_sysdig_secure_notification_channel_common.go Outdated
@tembleking
Copy link
Copy Markdown
Member

tembleking commented Jan 9, 2026

I understand the reasoning behind using TypeString to distinguish between false and "not defined", since this is a known limitation of the Terraform SDK v2.

However, I have two concerns:

  1. For the new notify_on_acknowledge field: Using TypeString makes sense here since it's a new field and you need the three-state behavior (true/false/unset). But what's the meaning of not setting it? Isn't it the same as define it as false?
  2. For the existing notify_when_ok and notify_when_resolved fields: Changing from TypeBool with Default: false to TypeString without a default is a breaking change. Even though HCL accepts unquoted true/false as strings, the state type changes and the default behavior changes (users relying on the implicit false default will now get nil). Since these fields are being deprecated anyway, I'd suggest keeping them as TypeBool with their current behavior because this avoids breaking existing configurations while still deprecating the fields.

@dbonf
Copy link
Copy Markdown
Collaborator Author

dbonf commented Jan 9, 2026

I understand the reasoning behind using TypeString to distinguish between false and "not defined", since this is a known limitation of the Terraform SDK v2.

However, I have two concerns:

  1. For the new notify_on_acknowledge field: Using TypeString makes sense here since it's a new field and you need the three-state behavior (true/false/unset). But what's the meaning of not setting it? Isn't it the same as define it as false?

as mentioned in the doc, the behaviour on missing definition of this field at alert level is to take the setting at notification channel level. In the future, when we make it optional at nc level and/or remove it from there, the behavior is to send a notification in this case.

  1. For the existing notify_when_ok and notify_when_resolved fields: Changing from TypeBool with Default: false to TypeString without a default is a breaking change. Even though HCL accepts unquoted true/false as strings, the state type changes and the default behavior changes (users relying on the implicit false default will now get nil). Since these fields are being deprecated anyway, I'd suggest keeping them as TypeBool with their current behavior because this avoids breaking existing configurations while still deprecating the fields.

i agree there can be scenarios where the behavior change. We will need a breaking change anyway in the near future because we need to remove this from the ui. Because of this, I agreed to leave the fields as is, default: false, and add the deprecation notice. Then in the near future we will have to apply back this breaking change on default change or remove the fields altogether with a new major version release.

@dbonf dbonf requested a review from tembleking January 12, 2026 10:54
Copy link
Copy Markdown
Member

@tembleking tembleking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tembleking
Copy link
Copy Markdown
Member

tembleking commented Jan 12, 2026

as mentioned in the doc, the behaviour on missing definition of this field at alert level is to take the setting at notification channel level. In the future, when we make it optional at nc level and/or remove it from there, the behavior is to send a notification in this case.

Understood, then it makes sense

i agree there can be scenarios where the behavior change. We will need a breaking change anyway in the near future because we need to remove this from the ui. Because of this, I agreed to leave the fields as is, default: false, and add the deprecation notice. Then in the near future we will have to apply back this breaking change on default change or remove the fields altogether with a new major version release.

Yeah, let's keep it as compatible as possible so people can migrate to the new field and we will remove those after some time.

Thank you for the submission @dbonf

@dbonf dbonf merged commit da3d48c into master Jan 13, 2026
22 checks passed
@dbonf dbonf deleted the move-nc-options-at-alert-level branch January 13, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants