Skip to content

feat: Add silence annotation to web UI#5017

Open
TheMeier wants to merge 1 commit intoprometheus:mainfrom
TheMeier:silence_annotation_ui
Open

feat: Add silence annotation to web UI#5017
TheMeier wants to merge 1 commit intoprometheus:mainfrom
TheMeier:silence_annotation_ui

Conversation

@TheMeier
Copy link
Contributor

@TheMeier TheMeier commented Feb 18, 2026

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?

[FEATURE] UI: Add support for silence annotations

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for displaying and managing silence annotations in the Alertmanager web UI. Annotations are optional key-value pairs that can be attached to silences for additional context. The implementation adds annotation input fields to the silence creation/edit form and displays annotations in both the silence detail view and silence list view.

Changes:

  • Added annotation input field with validation in the silence form
  • Added annotation display in silence detail and list views
  • Implemented parsing and validation logic for annotation key-value pairs

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ui/app/src/Views/SilenceView/Views.elm Displays annotations in the silence detail view with inline matchers styling
ui/app/src/Views/SilenceList/SilenceView.elm Displays annotations in the silence list view and adds "Matchers:" label for consistency
ui/app/src/Views/SilenceForm/Views.elm Adds annotation input UI with add/delete buttons and validation feedback
ui/app/src/Views/SilenceForm/Updates.elm Implements annotation add/delete/update logic and form validation
ui/app/src/Views/SilenceForm/Types.elm Adds annotation data structures, parsing, and validation functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TheMeier TheMeier force-pushed the silence_annotation_ui branch 2 times, most recently from 23de096 to b44107a Compare February 18, 2026 18:36
@TheMeier TheMeier requested a review from Copilot February 18, 2026 18:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@Spaceman1701 Spaceman1701 left a comment

Choose a reason for hiding this comment

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

Not really a code review of the Elm, but I ran this patch locally and the UI seemed good to me.

It might be nice if the annotations box didn't let you add duplicate annotations, but otherwise it seems fine.

@TheMeier TheMeier force-pushed the silence_annotation_ui branch from b44107a to f2d4326 Compare February 24, 2026 17:18
Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 66 to +78
, formGroup "Matchers" <|
div [] <|
List.map (Utils.List.mstring >> Utils.Views.labelButton Nothing) silence.matchers
List.map
(\matcher ->
span
[ class "btn btn-sm btn-light border mr-2 mb-2"
, style "user-select" "text"
, style "-moz-user-select" "text"
, style "-webkit-user-select" "text"
]
[ span [ class "text-muted" ] [ text (Utils.List.mstring matcher) ] ]
)
silence.matchers
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The matcher rendering here duplicates the styling/markup already provided by Utils.Views.labelButton Nothing (including the user-select styles and text-muted wrapper). Reusing the shared helper would reduce duplication and keep matcher pill styling consistent across the UI.

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +97
formGroup "Annotations" <|
div [] <|
List.map
(\( k, v ) ->
span
[ class "btn btn-sm btn-light border mr-2 mb-2"
, style "user-select" "text"
, style "-moz-user-select" "text"
, style "-webkit-user-select" "text"
]
[ span [ class "text-muted" ] [ text (k ++ "=" ++ v) ] ]
)
(Dict.toList annotations)
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Annotations are rendered with inline pill markup that duplicates Utils.Views.annotationButton (added in this PR and already used in the silence list). Consider using the shared helper here as well (e.g., mapping Utils.Views.annotationButton over Dict.toList annotations) to avoid drift between views.

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +69
span
[ class "btn btn-sm btn-light border mr-2 mb-2"
, style "user-select" "text"
, style "-moz-user-select" "text"
, style "-webkit-user-select" "text"
]
[ span [ class "text-muted" ] [ text (key ++ "=" ++ value) ] ]
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

annotationButton duplicates the exact attributes/markup of labelButton Nothing with only the label text differing. To reduce maintenance overhead, consider implementing annotationButton in terms of labelButton Nothing (or extracting the common pill attributes into a single helper) so styling changes don't need to be updated in multiple places.

Suggested change
span
[ class "btn btn-sm btn-light border mr-2 mb-2"
, style "user-select" "text"
, style "-moz-user-select" "text"
, style "-webkit-user-select" "text"
]
[ span [ class "text-muted" ] [ text (key ++ "=" ++ value) ] ]
labelButton Nothing (key ++ "=" ++ value)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants