* WECHAT support by ybyang2/berlinsaint
* correct the whitespace
* add some TestFile and modify some naming errors by ybyang2/berlinsaint
* modify wechat retry test expect
* template error
* add newline
Signed-off-by: yb_home <berlinsaint@126.com>
* fmt some pr code
* use the @stuartnelson3 the test-ci-wechat bingdata.go
* notify go add wechat
* Adding check for webhook's URL formatting
Since alertmanager will fail silently when trying to send to a schemaless URL, provide a way to check that a URL is properly formatted in alertmanager
* updating error message as requested
* added email notification text content support (configuration text)
added default email notification text content default value empty
converted email notification from html to multipart/alternatives with support to both html (first) and text (last)
ignore intellij IDE .idea working folder
* removed specific editor .gitignore entries
* renamed TEXT to Text as it's not an acronym
added TODO note to refactor multipart code to use standard go library
* refactored to use standard go mime/multipart library for text and html parts and bounderies
* use multipart createPart returned writer
added error handling while creating parts
removed unnecessary quotes from boundry string
* removed unnecessary comments
* Support for custom SMTP hello string
Some MTAs insist that they be greeted with a fully qualified domain
name. The default provided by the net/smtp library, "HELLO localhost",
is not sufficient and will result in rejected messages.
This changeset adds a new configuration option that allows the
alertmanager to do its job in such an environment.
* Test SMTPHello parsing
Found that we are only defining MarshalJSON for the Regexp type for
references not for the direct object
Also took the time to simplify the json.Unmarshal usage in cli/config.go
* Implement alertmanager cli tool 'amtool'
The primary goal of an alertmanager tool is to provide a cli interface
for the prometheus alertmanager.
My vision for this tool has two parts:
- Silence management (query, add, delete)
- Alert management (query, maybe more in future?)
Resolves: #567
* Export parsed configuration as JSON in /api/v1/status.
* Avoid exporting the XXX fields.
* Drop js-yaml library and use already parsed configuration.
* Go fmt + go-bindata
This fixes#559 by removing concurrent map writes to the matcher cache.
The cache was guarded by the Silence's main lock, which only used a
read-lock on queries.
The cache's get methods lazily loads data into the cache and thus
causing concurrent writes.
We just change the main lock to always write-lock, as we don't expect
high lock contention at this point and would have it in a dedicated
cache lock anyway.
Add default VictorOpsAPIURL
Add VictorOps default config
Add VictorOpsConfig struct in notifiers
Add new template tags for victorops
Add notifications logic for victorops
Compiled template tags with make assets
Remove common labels from entity_id template
Set messageType default value to CRITICAL
Recovery messageType is not configurable anymore. Firing state only allows specific keys
Make assets
Using log.Debugf
EntityID should not be configureable
Remove entity_id from template
Use GroupKey(ctx) as entity_id
Improve debug logging
Fix type of entity_id
This is useful when you're using a label to determine the receiver but
want to override other options such as `group_by`. Currently you'd have
to duplicate the matchers for the receivers to be able to do this.
`checkReceiver()` now returns no error if a receiver is empty and we add
a check to ensure that the root route has a receiver defined. I've added
a test for this.
This brings the `receiver` option into line with the other options
(`group_by`, `group_wait`, etc) in the sense that routes can now inherit
the receiver from the parent node.
From https://prometheus.io/docs/alerting/configuration/:
> A route block defines a node in a routing tree and its children. Its
> optional configuration parameters are inherited from its parent node
> if not set.
The root route in the configuration must not exclude any alerts,
i.e. not have any matchers.
All receivers referenced in the routing tree are validated to exist.
Slack is a general chat system, it has no notion
of resolved messages. Default it to false to avoid
spamming people as we do with all other such systems.
- Cut back to bare minimum to make the rest simpler
- Consistency in config naming
- Have one data strucutre that's the same for all templates
- Pass in common labels to templates
- Support templates almost everywhere
- Support multiple SMTP recipients
- Support non-ASCII SMTP headers
- Handle colour logic via templates
- Make $subjects have consistent output, go maps aren't sorted.
- Make tests pass when v6 is disabled