prometheus / prometheus/alertmanager
Log sent alerts from alert manager to file
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.6k
- Forks
- 2.5k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 61
Description
Feature request
It should be possible to configure alertmanager to log alerts to a file including the complete alert content. I.e. something like a file receiver. I.e. to avoid having to create a webhook service that stores received alerts in a file. Each alert should be stored as a one-liner-json string.
The log file could then be retrieved by a log collection tool to be processed further.
The solution would need to be able to handle that another process rotates/deletes/clears the log file between write attempts. We also would not want to lock the log file when alerts are not actively being written.
Config of alert manager could be something like:
file_configs:
[ send_resolved: <boolean> | default = true ]
file: <path to log file>
Another option could be to rewrite the current webhook_configs: to allow the url: parameter to specify a file: url...
Even if we're not actively adding new receivers and are recommended to implement custom notification integrations via the webhook receiver, we believe this feature request makes sense.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Alertmanager's receiver configuration and the existing webhook receiver behavior described in the issue. Define how a file receiver would emit complete alerts as one-line JSON, support send_resolved, and safely handle rotation, deletion, or clearing between writes; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100