Skip to content
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

Support alerts with missing mandatory attributes #32

Closed
1 task done
lindhor opened this issue Nov 8, 2017 · 0 comments
Closed
1 task done

Support alerts with missing mandatory attributes #32

lindhor opened this issue Nov 8, 2017 · 0 comments

Comments

@lindhor
Copy link
Contributor

lindhor commented Nov 8, 2017

Prerequisites

Description

prom2teams should be able to handle incoming messages no matter what attributes are received. For missing attributes that are required in the output, default values should be assigned.

alertname='unknown'
status='firing'
instance='unknown'
summary='no alert summary specified'

The current list of mandatory attributes is too strict, since it for example includes instance which is not always sent.

Steps to Reproduce

Create an absent rule like IF absent(container_cpu_load_average_10s{name='mycriticalcontainer}) (cAdvisor) and the alert sent will not include the attribute instance

Expected behavior:

The alert should be sent with the available attributes filled out.

Actual behavior:

The alert from prom2teams to MS Teams will say Incorrect JSON received. At least one mandatory field (instance) is absent.

Reproduces how often:

All the time.

Versions

1.1.3

Additional Information

maglo added a commit to maglo/prom2teams that referenced this issue Nov 8, 2017
Sometimes, an alert is generated without an instance.
For example if an alert is triggered when none of the monitored
instances has a particular property, such as the case when a vital
container is *not* running on any instance.

In this case, it makes sense to set the value of the `instance`
property to `none`, since it did not originate from a particular
intance.

This PR changes `intance` to an optional field, and sets a default value
to `none`.

Closes idealista#32
@jnogol jnogol closed this as completed in 65fd794 Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants