The result is an inconsistent configuration, as the root notification policy use the default email received contact point.
How can I change it in order to use my custom contact point?
try adding orgID to the config file for deleting contact points and under contactPoints
# config file version
apiVersion: 1
# List of receivers that should be deleted
deleteContactPoints:
# <int> organization ID, default = 1
- orgId: 1
# <string, required> unique identifier for the receiver
uid: first_uid
Also are there any logs when you provision the file?
When I try to delete the default contact point this is the error I see in the logs:
grafana_1 | logger=provisioning.alerting t=2023-03-29T06:41:17.840738248Z level=info msg="starting to provision alerting"
grafana_1 | Error: ✗ contact points: change would result in an invalid configuration state: unexpected receiver (grafana-default-email) is undefined
Grafana is unable to start because I’m trying to delete a contact point that is being referenced by the root notification policy.
How would I change the policy to use another contact point via file provisioning?
PS: I have tried adding the orgId but the result is the same.
I have found a similar issue (a bug) related to being unable to update a notification policy via API provisioning
I’d suggest to add a comment in the issue in order to find out whether the bug is affecting you, and if there is any workaround to change the contact point
Have you tried provisioning the notification policy to update the default contact point of the notification policy as shown here?
Here is an example of a configuration file for creating notification policiies.
# config file version
apiVersion: 1
# List of notification policies
policies:
# <int> organization ID, default = 1
- orgId: 1
# <string> name of the contact point that should be used for this route
receiver: grafana-default-email
.
.
.
Thank you @melori.arellano , that worked.
I didn’t try what you suggested before because the documentation you mentioned introduces the code snippet with this code:
Here is an example of a configuration file for creating notification policiies.
Here it talks about creating new ones, not modifying existing ones.
Anyways, thanks a lot for your help!!