nixos/grafana: re-add legacy notifiers test, mention notifiers in release notes

This commit is contained in:
Maximilian Bosch 2022-11-04 11:40:07 +01:00
parent 25b5824696
commit afd6199cff
No known key found for this signature in database
GPG key ID: 9A6EEA275CA5BE0A
3 changed files with 53 additions and 0 deletions

View file

@ -1309,6 +1309,16 @@ services.github-runner.serviceOverrides.SupplementaryGroups = [
deploy to NixOS.
</para>
</listitem>
<listitem>
<para>
<xref linkend="opt-services.grafana.provision.notifiers" />
is not affected by this change because this feature
will is deprecated by Grafana and will probably
removed in Grafana 10. Its recommended to use
<literal>services.grafana.provision.alerting.contactPoints</literal>
instead.
</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>

View file

@ -426,6 +426,10 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
provisioning files from non-NixOS Grafana instances that you also want to
deploy to NixOS.
- [](#opt-services.grafana.provision.notifiers) is not affected by this change because
this feature will is deprecated by Grafana and will probably removed in Grafana 10.
It's recommended to use `services.grafana.provision.alerting.contactPoints` instead.
- The `services.grafana.provision.alerting` option was added. It includes suboptions for every alerting-related objects (with the exception of `notifiers`), which means it's now possible to configure modern Grafana alerting declaratively.
- Matrix Synapse now requires entries in the `state_group_edges` table to be unique, in order to prevent accidentally introducing duplicate information (for example, because a database backup was restored multiple times). If your Synapse database already has duplicate rows in this table, this could fail with an error and require manual remediation.

View file

@ -28,6 +28,35 @@ let
};
extraNodeConfs = {
provisionLegacyNotifiers = {
services.grafana.provision = {
datasources.settings = {
apiVersion = 1;
datasources = [{
name = "Test Datasource";
type = "testdata";
access = "proxy";
uid = "test_datasource";
}];
};
dashboards.settings = {
apiVersion = 1;
providers = [{
name = "default";
options.path = "/var/lib/grafana/dashboards";
}];
};
notifiers = [{
uid = "test_notifiers";
name = "Test Notifiers";
type = "email";
settings = {
singleEmail = true;
addresses = "test@test.com";
};
}];
};
};
provisionNix = {
services.grafana.provision = {
datasources.settings = {
@ -191,5 +220,15 @@ in {
machine.succeed(
"curl -sSfN -u testadmin:snakeoilpwd http://127.0.0.1:3000/api/v1/provisioning/mute-timings | grep Test\ Mute\ Timing"
)
with subtest("Successful notifiers provision"):
provisionLegacyNotifiers.wait_for_unit("grafana.service")
provisionLegacyNotifiers.wait_for_open_port(3000)
print(provisionLegacyNotifiers.succeed(
"curl -sSfN -u testadmin:snakeoilpwd http://127.0.0.1:3000/api/alert-notifications/uid/test_notifiers"
))
provisionLegacyNotifiers.succeed(
"curl -sSfN -u testadmin:snakeoilpwd http://127.0.0.1:3000/api/alert-notifications/uid/test_notifiers | grep Test\ Notifiers"
)
'';
})