prometheus / prometheus/alertmanager

Multiple receivers hide other errors in configuration

Open
#4,991 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
8.6k
Forks
2.5k
Avg merge
2d 6h
Merged PRs (30d)
61

Description

What did you do?
 ./amtool check-config config/testdata/conf.multi-bad-receivers.yml
Checking 'config/testdata/conf.multi-bad-receivers.yml'  FAILED: no global SMTP from set
What did you expect to see?

Errors from all three receivers.

What did you see instead? Under which circumstances?

Only a single error.

System information

No response

Alertmanager version

Alertmanager configuration file
global:
  resolve_timeout: 5m

receivers:
  # RECEIVER 1: Perfectly valid
  - name: 'team-alpha-webhook'
    webhook_configs:
      - url: 'https://webhook.alpha.com/alerts'

  # RECEIVER 2: Broken Email Config (The "Independent Loading" Issue)
  - name: 'team-beta-email'
    email_configs:
      - to: 'beta-team@example.com'
        # ERROR A: Mandatory field 'from' is missing (if not in global)
        # ERROR B: Invalid smarthost port
        smarthost: 'smtp.example.com:not-a-number' 

  # RECEIVER 3: Broken PagerDuty Config (The "Early Return" Issue)
  - name: 'team-gamma-pagerduty'
    pagerduty_configs:
      - service_key: '' # ERROR C: Required field empty
        # If the code returns early at ERROR C, it never sees ERROR D below
        routing_key: 'invalid-key-format-123' # ERROR D: Validation logic

route:
  group_by: ['alertname']
  receiver: 'team-alpha-webhook'
  routes:
    - match:
        team: 'beta'
      receiver: 'team-beta-email'
Prometheus version

Prometheus configuration file

Logs

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running ./amtool check-config config/testdata/conf.multi-bad-receivers.yml and inspect how configuration validation processes the receivers in that fixture. Trace the validation flow for the email and PagerDuty configurations, then add or update coverage so the command reports errors from all invalid receivers rather than stopping after one; done means the expected errors are visible together.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.