'How can I config prometheus alert with line-notify

I've trying to find a way for send alert notification on my prometheus server to line-notify.I checked alert rules configure status on prometheus is OK and alert rules can detect event normally, this my config.yml for alertmanager

global:
  resolve_timeout: 5m

route:
  receiver: "line-noti"
  # group_by: ['test-node-linux', 'test-node-windows', 'test-container-exporter', 'test-jmx-exporter']
  group_interval: 10s
  repeat_interval: 1m

receivers:
- name: 'line-noti'
  webhook_configs:
  - url: 'https://notify-api.line.me/api/notify'
    send_resolved: true
    http_config:
      bearer_token: [my_token]

but it doesn't send any messages to line-notify

How can I do for solved this case?



Solution 1:[1]

The problem in the receiver's name, you have double quotation marks ". However, the name of receiver should be either with single apostrophes ' or completely without.

Also the url can be without apostrophes.

Try this:

global:
  resolve_timeout: 5m

route:
  receiver: line-noti
  # group_by: ['test-node-linux', 'test-node-windows', 'test-container-exporter', 'test-jmx-exporter']
  group_interval: 10s
  repeat_interval: 1m

receivers:
- name: line-noti
  webhook_configs:
  - url: https://notify-api.line.me/api/notify
    send_resolved: true
    http_config:
      bearer_token: [my_token]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mibrl12