prometheus / prometheus/alertmanager

amtool: add support for stdin to `config routes test`

Open
#2,776 1 comment 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?

$ command-that-outputs-generated-alertmanager-config | docker run --rm \
        --entrypoint amtool --name alertmanager -i \
        -v $PWD:/work -w /work \
        quay.io/prometheus/alertmanager \
        config routes test alertname="foo", severity="critical"

What did you expect to see?

Validation of my routes passed via stdin.

Similar to what was added support for in https://github.com/prometheus/alertmanager/pull/1431

What did you see instead? Under which circumstances?

amtool: error: You have to specify one of --config.file or --alertmanager.url flags.

I also tried passing - (common identifier for stdin) as --config.file=-

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 at the amtool config routes test entry point and reproduce the documented Docker command that pipes an Alertmanager configuration through stdin. Trace how the command currently requires --config.file or --alertmanager.url; done means a configuration supplied via stdin is validated successfully, including the shown route matcher.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.