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

no provider available for room #75

Open
ybucci opened this issue Mar 26, 2024 · 2 comments
Open

no provider available for room #75

ybucci opened this issue Mar 26, 2024 · 2 comments

Comments

@ybucci
Copy link

ybucci commented Mar 26, 2024

Error LOG

(*Notifier).Dispatch","file":"/home/runner/work/calert/calert/internal/notifier/notifier.go","line":41},"msg":"dispatching alerts","count":1}
{"time":"2024-03-26T17:01:19.101881613Z","level":"ERROR","source":{"function":"github.com/mr-karan/calert/internal/notifier.(*Notifier).Dispatch","file":"/home/runner/work/calert/calert/internal/notifier/notifier.go","line":45},"msg":"no provider available for room","room":"cattle-monitoring-system/alertas/alertas"}
{"time":"2024-03-26T17:01:19.102244707Z","level":"ERROR","source":{"function":"main.handleDispatchNotif.func1","file":"/home/runner/work/calert/calert/cmd/handlers.go","line":109},"msg":"error dispatching alerts","error":"no provider configured for room: cattle-monitoring-system/alertas/alertas"}

AlertManager Config

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: alertas
  namespace: cattle-monitoring-system
spec:
  receivers:
    - name: alertas
      webhookConfigs:
        - url: http://caalert-calert:6000/dispatch
  route:
    groupBy:
      - job
    groupInterval: 5m
    groupWait: 30s
    receiver: alertas
    repeatInterval: 12h

ConfigMap

   [providers.alertas]
  
    type = "google_chat"
  
    endpoint =
    "https://chat.googleapis.com/v1/spaces/XXXXXXXXXXXXXXXXXXXXXXXXX"
  
    max_idle_conns = 50
  
    timeout = "30s"
  
    proxy_url = ""
  
    template = "static/message.tmpl"
  
    thread_ttl = "12h"
  
    dry_run = "false"
@NotLGBT
Copy link

NotLGBT commented Apr 23, 2024

Understood?

calert configuration

calert:
prod_alerts:
type: "google_chat"
endpoint: "https://chat.googleapis.com/v1/spaces//messages?key=&token="
max_idle_conns: 50
timeout: "30s"
template: "static/message.tmpl"
thread_ttl: "12h"
dry_run: false

dev_alerts:
type: "google_chat"
endpoint: "https://chat.googleapis.com/v1/spaces//messages?key=&token="
max_idle_conns: 50
timeout: "30s"
template: "static/message.tmpl"
thread_ttl: "12h"
dry_run: false

Alertmanager configuration

receivers:

@Ancocodet
Copy link

Ancocodet commented May 8, 2024

The Problem is that in Kubernetes (which your configuration looks like) the rooms/receivers are always prefixed with the namespace and the name of config (namespace/config_name/receiver).
You can use the query parameter room_name with the dispatch endpoint and set it to the receiver name, that should fix the error.

For example:

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: alertas
  namespace: cattle-monitoring-system
spec:
  receivers:
    - name: alertas
      webhookConfigs:
        - url: http://caalert-calert:6000/dispatch?room_name=alertas
  route:
    groupBy:
      - job
    groupInterval: 5m
    groupWait: 30s
    receiver: alertas
    repeatInterval: 12h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants