-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow user to request consistent ordering / sorting of grouped alerts #1178
Comments
I propose that at a minimum the |
Are you referring to the |
This is about notification templates. |
I don't mind writing some code if it will help move this forward. For me it would be enough to have a function or alert manager option to simply sort alerts lexicographically by label or annotation. |
I think we should start with a consistent ordering on the Alerts we provide to notification templates. That way users get something okay without having to do extra work. |
For a default ordering, how about lexicographical by |
You can't presume that any particular annotation exists, nor that creation times are stable. I'd suggest working entirely off alert labels. This should not be configurable at this level. |
OK, what alert labels would make for a sensible default sort key? |
You'll need to use all of them, otherwise it won't be consistent. Moving job and instance to the front is probably wise. |
Looking at Does that make sense or am I misunderstanding your intention or the code? |
Yes, the slice would be the one to sort somewhere along that codepath. |
The proposed change is in #1234 but if Alertmanager will allow arbitrary sorting from the user in the future, then the |
@brian-brazil the request was for the user to be able to request a specific sort order for alerts and I thought #1234 was just the first step. Does closing this request mean it won't be done or that it will be implemented elsewhere? |
Ah, I'd missed that. I'm personally hoping we can avoid having to implement that. |
…us#1178) Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
…us#1178) Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
…us#1178) Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
…us#1178) Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
* Sort dispatched alerts by job+instance in the correct order (#1178) Signed-off-by: Ted Zlatanov <tzz@lifelogs.com> * dispatch: add unit test for alerts sorting Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Convert to Go modules * Update promu config. * Convert to Go modules. * Update vendoring. * Update Makefile.common. * Update circleci config. * Use Prometheus release tar for promtool. * Fixup unpack * Use temp dir for unpacking tools. * Use BSD compatible tar command. * OpenBSD mkdir doesn't support `-v`. Signed-off-by: Ben Kochie <superq@gmail.com>
* collector/diskstats: don't fail if there are extra stats, just ignore… (prometheus#1125) * collector/diskstats: don't fail if there are extra stats, just ignore them Signed-off-by: Paul Gier <pgier@redhat.com> Signed-off-by: Ben Kochie <superq@gmail.com> * collector/hwmon_linux: handle temperature sensor file which doesn't have item suffix (prometheus#1123) In some cases the file might be called "temp" instead of the usual format "temp<index>_<item>" as described in the kernel docs: https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface In this case, treat this as an _input file containing the current temperature reading. Fixes prometheus#1122 Signed-off-by: Paul Gier <pgier@redhat.com> Signed-off-by: Ben Kochie <superq@gmail.com> * Handle 'Unknown' as measurement value. (prometheus#1113) We use the output-compatible perccli and storcli.py does not handle 'Unknown' as a result: ``` sg="Error parsing \"/var/lib/node_exporter/perccli.prom\": text format parsing error in line 222: expected float as value, got \"Unknown\"" source="textfile.go:212" ``` I know, the perccli should not return 'Unknown' but this error breaks all other useful measurements because the prom file is not parsable. My if condition fixes this. Signed-off-by: Andreas Wirooks <4233401+nudgegoonies@users.noreply.github.com> Signed-off-by: Ben Kochie <superq@gmail.com> * circleci: switch to 2.1 config Signed-off-by: Ben Kochie <superq@gmail.com> * Convert to Go modules (prometheus#1178) * Convert to Go modules * Update promu config. * Convert to Go modules. * Update vendoring. * Update Makefile.common. * Update circleci config. * Use Prometheus release tar for promtool. * Fixup unpack * Use temp dir for unpacking tools. * Use BSD compatible tar command. * OpenBSD mkdir doesn't support `-v`. Signed-off-by: Ben Kochie <superq@gmail.com> * Add fallback for missing /proc/1/mounts (prometheus#1172) * Add fallback for missing /proc/1/mounts On some systems, `/proc/1/mounts` is hidden from non-root users due to the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if `/proc/1/mounts` is not found. Signed-off-by: Ben Kochie <superq@gmail.com> * Add tests. Signed-off-by: Ben Kochie <superq@gmail.com> * Add CHANGELOG entry. Signed-off-by: Ben Kochie <superq@gmail.com> * Release v0.17.0 (prometheus#1168) * Update CHANGELOG * Update VERSION Signed-off-by: Ben Kochie <superq@gmail.com>
* Convert to Go modules * Update promu config. * Convert to Go modules. * Update vendoring. * Update Makefile.common. * Update circleci config. * Use Prometheus release tar for promtool. * Fixup unpack * Use temp dir for unpacking tools. * Use BSD compatible tar command. * OpenBSD mkdir doesn't support `-v`. Signed-off-by: Ben Kochie <superq@gmail.com>
I'm curious about the way the API returns the result. is there any sorting logic? |
I have a suggestion: e.g. group_by: ['alertname','severity'] |
alertmanager currently groups alerts without a consistent ordering, which is tough to follow for large groups.
The user should be able to specify a sort order on some label or annotation, which would give consistency and locally meaningful sorting. This could be done with a Go sort function in the template or with a alertmanager configuration entry perhaps.
The text was updated successfully, but these errors were encountered: