Hello.
> Notably we reworked also the templates for the receiver but there is *no*
> error
> in the log at all, meaning the new templates are correctly loaded.
>
I was obviously wrong there. While the templates did load correctly, they
did fail at runtime when a new alert spawned. There was a label accessed
with the wrong index. Fixing the templates, fixed the issue for me.
Thanks to anyone who took the time to look into this.
Bests,
F.
On Wednesday, 10 June 2020 10:55:02 UTC+2, Federico Buti wrote:
>
> Hi all.
>
>
> We were recently testing grouping via the special value '...' for a
> specific Slack receiver.
> Looking at the documentation this seems feasible and correct. However,
> after introducing the grouping, no alert belonging to the receiver was
> delivered to Slack any more.
>
> The routing configuration looks like the following:
>
> route:
> receiver: 'none'
> group_by: [severity, stack, environment]
> group_wait: 30s
> group_interval: 5m
> repeat_interval: 6h
> routes:
> - receiver: 'slack_firmware_rc'
> match_re:
> stack: xxx
> instance: yyy
> #
> # other "stack"-based receivers here
> #
> - receiver: 'slack_it'
> group_by: ['...'] # disables grouping
> match_re:
> stack: it
> #
> # other "stack"-based receivers here
> #
>
> I've omitted the other receivers: they weren't touched and seem to
> continue working fine. The only receiver that is not working is the
> "slack_it" one. Notably we reworked also the templates for the receiver but
> there is *no* error in the log at all, meaning the new templates are
> correctly loaded. Anyway, just for completion here are the changed parts:
>
> - name: slack_it
> slack_configs:
> - api_url: 'xxx'
> icon_url: 'yyy'
> username: 'zzz'
> channel: '#out_channel'
> send_resolved: true
> color: '{{ template "yakkity-color" . }}'
> title: '{{ template "yakkity-simple-title" . }}'
> text: '{{ template "yakkity-simple-text" . }}'
> thumb_url: '{{ template "yakkity-thumb" . }}'
>
>
> {{ define "yakkity-simple-title" -}}
> {{- with index .Alerts 0 -}}
> {{- .Annotations.summary -}}
> {{- end -}}
> {{- end }}
>
>
> {{ define "yakkity-simple-text" }}
> {{- with index .Alerts 0 -}}
> {{- .Annotations.description -}}
> {{- end }}
>
>
> :bar_chart: *<{{ .GeneratorURL }}|Graph>*
>
>
> {{- if .Annotations.runbook }} :notebook: *<{{ .Annotations.runbook }}|
> Runbook>* {{- end }}
> {{ $filteredLabels :=
> "stack|environment|service|job|monitor|severity|hostname" }}
> {{ range .Labels.SortedPairs }}{{if not (match $filteredLabels .Name)}}`{{
> .Name }}={{ .Value }}` {{ end }}{{ end }}
> {{ end }}
>
>
> Any idea what can be wrong with this new setup?
> Thanks in advance,
> F.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/e0c9b528-5c6e-4b32-9d9a-c349427eba29o%40googlegroups.com.