Skip to content

feat(api): add status v3 proto - #5317

Merged
siavashs merged 1 commit into
prometheus:mainfrom
siavashs:feat/api/v3
Jul 6, 2026
Merged

siavashs merged 1 commit into
prometheus:mainfrom
siavashs:feat/api/v3

Conversation

@siavashs

Copy link
Copy Markdown
Contributor
  • add proto file
  • run buf generate

Pull Request Checklist

Please check all the applicable boxes.

  • Please list all open issue(s) discussed with maintainers related to this change
    • Fixes #
  • Is this a new Receiver integration?
  • Is this a bugfix?
    • I have added tests that can reproduce the bug which pass with this bugfix applied
  • Is this a new feature?
    • I have added tests that test the new feature's functionality
  • Does this change affect performance?
    • I have provided benchmarks comparison that shows performance is improved or is not degraded
      • You can use benchstat to compare benchmarks
    • I have added new benchmarks if required or requested by maintainers
  • Is this a breaking change?
    • My changes do not break the existing cluster messages
    • My changes do not break the existing api
  • I have added/updated the required documentation
  • I have signed-off my commits
  • I will follow best practices for contributing to this project

Which user-facing changes does this PR introduce?

NONE

@siavashs
siavashs requested a review from a team as a code owner June 19, 2026 09:44
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a new status.v1.StatusService proto definition with GetStatus and GetHealth RPCs, generates corresponding Connect-Go client/handler code, and updates buf.yaml, buf.gen.yaml, go.mod, and internal/tools/go.mod to register the new proto module and Connect-Go plugin/dependency.

Changes

Alertmanager StatusService

Layer / File(s) Summary
Proto schema: StatusService, messages, and enums
proto/api/status/v1/status.proto
Defines StatusService with GetStatus and GetHealth RPCs, plus AlertmanagerStatus, VersionInfo, AlertmanagerConfig, ClusterStatus (with State enum), PeerStatus, and request/response message types.
Generated Connect-Go client and handler wiring
api/status/v1/statusv1connect/status.connect.go
Adds service name/procedure constants, StatusServiceClient interface with NewStatusServiceClient, StatusServiceHandler interface with NewStatusServiceHandler routing by URL path, and UnimplementedStatusServiceHandler returning CodeUnimplemented.
Build tooling and dependency updates
buf.yaml, buf.gen.yaml, go.mod, internal/tools/go.mod
Registers the proto/api module in buf.yaml, adds the protoc-gen-connect-go plugin to buf.gen.yaml, adds connectrpc.com/connect v1.20.0 to go.mod, and adds the generator tool plus version bump in internal/tools/go.mod.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is too sparse and leaves key template items like issue links, test status, and user-facing change details unfilled. Add a fuller summary, fill applicable checklist items, note tests/docs or state why none are needed, and include release-notes details or confirm NONE.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, matches the main change, and follows the requested area: short description form.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@buf.yaml`:
- Around line 12-13: The module root path is set too deeply at
proto/public/alertmanager/v3. When Buf encounters the package alertmanager.v3,
it expects the proto files to be located under alertmanager/v3 relative to the
module root. Adjust the path value in the buf.yaml configuration from
proto/public/alertmanager/v3 to proto/public/alertmanager so that the module
root is positioned at the correct level and satisfies the
PACKAGE_DIRECTORY_MATCH lint requirement.

In `@proto/public/alertmanager/v3/status.proto`:
- Around line 60-64: The enum values in the State enum violate Buf's
ENUM_VALUE_PREFIX lint rule. The values (CLUSTER_STATE_UNSPECIFIED,
CLUSTER_STATE_DISABLED, CLUSTER_STATE_SETTLING, CLUSTER_STATE_READY) are
prefixed with CLUSTER_STATE_ instead of the required STATE_ prefix. Replace the
CLUSTER_STATE_ prefix with STATE_ for each enum value in the State enum to
comply with the Buf lint rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1e140cdf-2d1e-4b5b-bda9-81d224465bc9

📥 Commits

Reviewing files that changed from the base of the PR and between 9384b4e and 024c391.

⛔ Files ignored due to path filters (4)
  • api/alertmanagerv3/status.pb.go is excluded by !**/*.pb.go
  • go.sum is excluded by !**/*.sum
  • internal/tools/go.sum is excluded by !**/*.sum
  • silence/silencepb/silence.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (6)
  • api/alertmanagerv3/alertmanagerv3connect/status.connect.go
  • buf.gen.yaml
  • buf.yaml
  • go.mod
  • internal/tools/go.mod
  • proto/public/alertmanager/v3/status.proto

Comment thread buf.yaml Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@proto/public/alertmanager/v3/status.proto`:
- Line 16: The package declaration in status.proto is `alertmanager.v3` but the
buf.yaml module configuration has the module root set to
`proto/public/alertmanager/v3`, causing a PACKAGE_DIRECTORY_MATCH linter error.
To fix this, change the package declaration from `alertmanager.v3` to `v3` in
the package statement at the top of the status.proto file to align with the
module root directory structure, or alternatively update the buf.yaml module
root configuration from `proto/public/alertmanager/v3` to `proto/public/` to
match the package naming scheme.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6e326468-216b-44dd-bd40-8e539b274a57

📥 Commits

Reviewing files that changed from the base of the PR and between 024c391 and 91baa99.

⛔ Files ignored due to path filters (4)
  • api/alertmanagerv3/status.pb.go is excluded by !**/*.pb.go
  • go.sum is excluded by !**/*.sum
  • internal/tools/go.sum is excluded by !**/*.sum
  • silence/silencepb/silence.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (6)
  • api/alertmanagerv3/alertmanagerv3connect/status.connect.go
  • buf.gen.yaml
  • buf.yaml
  • go.mod
  • internal/tools/go.mod
  • proto/public/alertmanager/v3/status.proto
✅ Files skipped from review due to trivial changes (3)
  • buf.gen.yaml
  • buf.yaml
  • api/alertmanagerv3/alertmanagerv3connect/status.connect.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • internal/tools/go.mod
  • go.mod

Comment thread proto/api/status/v1/status.proto Resolved
Comment thread proto/api/status/v3/status.proto Resolved
@siavashs siavashs changed the title feat(api): add apiv3 status proto feat(api): add status v1 proto Jul 1, 2026
@siavashs
siavashs force-pushed the feat/api/v3 branch 2 times, most recently from 9bbd96e to 5683529 Compare July 3, 2026 15:29
@siavashs
siavashs requested a review from ultrotter July 3, 2026 15:29
- add proto file
- run `buf generate`

Signed-off-by: Siavash Safi <siavash@cloudflare.com>
@siavashs siavashs changed the title feat(api): add status v1 proto feat(api): add status v3 proto Jul 3, 2026
@siavashs
siavashs merged commit 963ed72 into prometheus:main Jul 6, 2026
7 checks passed
@siavashs
siavashs deleted the feat/api/v3 branch July 6, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants