prometheus / prometheus/alertmanager

No way to consume the API v2 client code separately from the main module

Open
#1,983 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This has been reported in https://github.com/prometheus/prometheus/issues/5813.

TL;DR: if project X wants to consume github.com/prometheus/alertmanager/api/v2/client, it needs to depend on the github.com/prometheus/alertmanager module which pull dependencies that aren't really needed and can conflict with the own requirement constraints of project X.

One solution would be to create a distinct module for the (generated) API v2 code (see https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories).

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

Read the linked report in prometheus/prometheus#5813 and the Go Modules multi-module repository FAQ first. Then inspect how the generated API v2 client is packaged in this repository. Done means projects can consume github.com/prometheus/alertmanager/api/v2/client through a distinct module without depending on the main Alertmanager module's unrelated dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.