prometheus / prometheus/alertmanager

JSON output flag not implemented for amtool config routes test

Open
#3,741 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What did you do?

Tried to format the output from amtool config routes test as JSON using the --output=json flag.

What did you expect to see?

The list of matched routes as a JSON list, instead of the comma separated strings, e.g.

# amtool config routes test --output=json --config.file=alertmanager-config.yaml --verify.receivers=Default,slack-default namespace=example alertname=KubePodNotReady              
["Default", "slack-default"]

What did you see instead? Under which circumstances?

The default comma separated string where being shown, e.g.

# amtool config routes test --output=json --config.file=alertmanager-config.yaml --verify.receivers=Default,slack-default namespace=example alertname=KubePodNotReady              
Default,slack-default

Environment

  • System information:
Linux 6.7.6-arch1-1 x86_64
  • Alertmanager version:
alertmanager, version 0.26.0 (branch: tarball, revision: 0.26.0)
  build user:       someone@builder
  build date:       20230825-18:04:14
  go version:       go1.21.0
  platform:         linux/amd64
  tags:             unknown
  • Prometheus version:

not relevant for this issue

  • Alertmanager configuration file:

not relevant for this issue

  • Prometheus configuration file:

not relevant for this issue

  • Logs:

not relevant for this issue

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 locating the amtool config routes test command and the existing --output handling for route results. Compare its behavior with other JSON output paths, then verify that the command emits a JSON list of matched receivers rather than comma-separated text.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
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.