Showing preview only (3,221K chars total). Download the full file or copy to clipboard to get everything.
Repository: prometheus/alertmanager
Branch: main
Commit: 5899c15562bc
Files: 593
Total size: 3.0 MB
Directory structure:
gitextract_cu_vryvw/
├── .dockerignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── config.yml
│ │ └── feature_request.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── ci.yml
│ ├── container_description.yml
│ ├── mixin.yml
│ ├── publish.yml
│ ├── release.yml
│ ├── stale.yml
│ └── ui-ci.yml
├── .gitignore
├── .golangci.yml
├── .promu.yml
├── .yamllint
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── COPYRIGHT.txt
├── Dockerfile
├── LICENSE
├── MAINTAINERS.md
├── Makefile
├── Makefile.common
├── NOTICE
├── Procfile
├── README.md
├── RELEASE.md
├── SECURITY.md
├── VERSION
├── alert/
│ ├── alert.go
│ ├── alert_test.go
│ ├── state.go
│ ├── status.go
│ ├── validate.go
│ └── validate_test.go
├── api/
│ ├── api.go
│ ├── metrics/
│ │ └── metrics.go
│ ├── v1_deprecation_router.go
│ └── v2/
│ ├── api.go
│ ├── api_test.go
│ ├── client/
│ │ ├── alert/
│ │ │ ├── alert_client.go
│ │ │ ├── get_alerts_parameters.go
│ │ │ ├── get_alerts_responses.go
│ │ │ ├── post_alerts_parameters.go
│ │ │ └── post_alerts_responses.go
│ │ ├── alertgroup/
│ │ │ ├── alertgroup_client.go
│ │ │ ├── get_alert_groups_parameters.go
│ │ │ └── get_alert_groups_responses.go
│ │ ├── alertmanager_api_client.go
│ │ ├── general/
│ │ │ ├── general_client.go
│ │ │ ├── get_status_parameters.go
│ │ │ └── get_status_responses.go
│ │ ├── receiver/
│ │ │ ├── get_receivers_parameters.go
│ │ │ ├── get_receivers_responses.go
│ │ │ └── receiver_client.go
│ │ └── silence/
│ │ ├── delete_silence_parameters.go
│ │ ├── delete_silence_responses.go
│ │ ├── get_silence_parameters.go
│ │ ├── get_silence_responses.go
│ │ ├── get_silences_parameters.go
│ │ ├── get_silences_responses.go
│ │ ├── post_silences_parameters.go
│ │ ├── post_silences_responses.go
│ │ └── silence_client.go
│ ├── compat.go
│ ├── models/
│ │ ├── alert.go
│ │ ├── alert_group.go
│ │ ├── alert_groups.go
│ │ ├── alert_status.go
│ │ ├── alertmanager_config.go
│ │ ├── alertmanager_status.go
│ │ ├── cluster_status.go
│ │ ├── gettable_alert.go
│ │ ├── gettable_alerts.go
│ │ ├── gettable_silence.go
│ │ ├── gettable_silences.go
│ │ ├── label_set.go
│ │ ├── matcher.go
│ │ ├── matchers.go
│ │ ├── peer_status.go
│ │ ├── postable_alert.go
│ │ ├── postable_alerts.go
│ │ ├── postable_silence.go
│ │ ├── receiver.go
│ │ ├── silence.go
│ │ ├── silence_status.go
│ │ └── version_info.go
│ ├── openapi.yaml
│ ├── restapi/
│ │ ├── configure_alertmanager.go
│ │ ├── doc.go
│ │ ├── embedded_spec.go
│ │ ├── operations/
│ │ │ ├── alert/
│ │ │ │ ├── get_alerts.go
│ │ │ │ ├── get_alerts_parameters.go
│ │ │ │ ├── get_alerts_responses.go
│ │ │ │ ├── get_alerts_urlbuilder.go
│ │ │ │ ├── post_alerts.go
│ │ │ │ ├── post_alerts_parameters.go
│ │ │ │ ├── post_alerts_responses.go
│ │ │ │ └── post_alerts_urlbuilder.go
│ │ │ ├── alertgroup/
│ │ │ │ ├── get_alert_groups.go
│ │ │ │ ├── get_alert_groups_parameters.go
│ │ │ │ ├── get_alert_groups_responses.go
│ │ │ │ └── get_alert_groups_urlbuilder.go
│ │ │ ├── alertmanager_api.go
│ │ │ ├── general/
│ │ │ │ ├── get_status.go
│ │ │ │ ├── get_status_parameters.go
│ │ │ │ ├── get_status_responses.go
│ │ │ │ └── get_status_urlbuilder.go
│ │ │ ├── receiver/
│ │ │ │ ├── get_receivers.go
│ │ │ │ ├── get_receivers_parameters.go
│ │ │ │ ├── get_receivers_responses.go
│ │ │ │ └── get_receivers_urlbuilder.go
│ │ │ └── silence/
│ │ │ ├── delete_silence.go
│ │ │ ├── delete_silence_parameters.go
│ │ │ ├── delete_silence_responses.go
│ │ │ ├── delete_silence_urlbuilder.go
│ │ │ ├── get_silence.go
│ │ │ ├── get_silence_parameters.go
│ │ │ ├── get_silence_responses.go
│ │ │ ├── get_silence_urlbuilder.go
│ │ │ ├── get_silences.go
│ │ │ ├── get_silences_parameters.go
│ │ │ ├── get_silences_responses.go
│ │ │ ├── get_silences_urlbuilder.go
│ │ │ ├── post_silences.go
│ │ │ ├── post_silences_parameters.go
│ │ │ ├── post_silences_responses.go
│ │ │ └── post_silences_urlbuilder.go
│ │ └── server.go
│ └── testing.go
├── buf.gen.yaml
├── buf.yaml
├── cli/
│ ├── alert.go
│ ├── alert_add.go
│ ├── alert_query.go
│ ├── check_config.go
│ ├── check_config_test.go
│ ├── cluster.go
│ ├── config/
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── http_config.go
│ │ └── testdata/
│ │ ├── amtool.bad.yml
│ │ ├── amtool.good1.yml
│ │ ├── amtool.good2.yml
│ │ ├── http_config.bad.yml
│ │ ├── http_config.basic_auth.good.yml
│ │ └── http_config.good.yml
│ ├── config.go
│ ├── format/
│ │ ├── format.go
│ │ ├── format_extended.go
│ │ ├── format_json.go
│ │ ├── format_simple.go
│ │ └── sort.go
│ ├── root.go
│ ├── routing.go
│ ├── silence.go
│ ├── silence_add.go
│ ├── silence_expire.go
│ ├── silence_import.go
│ ├── silence_query.go
│ ├── silence_update.go
│ ├── template.go
│ ├── template_render.go
│ ├── test_routing.go
│ ├── test_routing_test.go
│ ├── testdata/
│ │ ├── conf.bad.yml
│ │ ├── conf.good.yml
│ │ ├── conf.routing-reverted.yml
│ │ └── conf.routing.yml
│ └── utils.go
├── cluster/
│ ├── advertise.go
│ ├── advertise_test.go
│ ├── channel.go
│ ├── channel_test.go
│ ├── cluster.go
│ ├── cluster_test.go
│ ├── clusterpb/
│ │ ├── cluster.pb.go
│ │ └── cluster.proto
│ ├── connection_pool.go
│ ├── delegate.go
│ ├── testdata/
│ │ ├── certs/
│ │ │ ├── ca-config.json
│ │ │ ├── ca-csr.json
│ │ │ ├── ca-key.pem
│ │ │ ├── ca.csr
│ │ │ ├── ca.pem
│ │ │ ├── node1-csr.json
│ │ │ ├── node1-key.pem
│ │ │ ├── node1.csr
│ │ │ ├── node1.pem
│ │ │ ├── node2-csr.json
│ │ │ ├── node2-key.pem
│ │ │ ├── node2.csr
│ │ │ └── node2.pem
│ │ ├── empty_tls_config.yml
│ │ ├── tls_config_node1.yml
│ │ ├── tls_config_node2.yml
│ │ ├── tls_config_with_missing_client.yml
│ │ └── tls_config_with_missing_server.yml
│ ├── tls_config.go
│ ├── tls_connection.go
│ ├── tls_connection_test.go
│ ├── tls_transport.go
│ └── tls_transport_test.go
├── cmd/
│ ├── alertmanager/
│ │ ├── main.go
│ │ └── main_test.go
│ └── amtool/
│ ├── README.md
│ └── main.go
├── config/
│ ├── common/
│ │ ├── inhibitrule.go
│ │ ├── inhibitrule_test.go
│ │ ├── matchers.go
│ │ ├── matchers_test.go
│ │ ├── notifierconfig.go
│ │ ├── url.go
│ │ └── url_test.go
│ ├── config.go
│ ├── config_fuzz_test.go
│ ├── config_test.go
│ ├── coordinator.go
│ ├── coordinator_test.go
│ ├── notifiers.go
│ ├── notifiers_test.go
│ ├── receiver/
│ │ ├── receiver.go
│ │ └── receiver_test.go
│ └── testdata/
│ ├── conf.empty-fields.yml
│ ├── conf.good.yml
│ ├── conf.group-by-all.yml
│ ├── conf.http-config.good.yml
│ ├── conf.mattermost-both-webhook-url-and-file.yml
│ ├── conf.mattermost-default-webhook-url-file.yml
│ ├── conf.mattermost-default-webhook-url.yml
│ ├── conf.mattermost-no-webhook-url.yml
│ ├── conf.mattermost-valid-receiver-both-webhook-url-and-file.yml
│ ├── conf.nil-match_re-route.yml
│ ├── conf.nil-source_match_re-inhibition.yml
│ ├── conf.nil-target_match_re-inhibition.yml
│ ├── conf.opsgenie-both-file-and-apikey.yml
│ ├── conf.opsgenie-default-apikey-file.yml
│ ├── conf.opsgenie-default-apikey-old-team.yml
│ ├── conf.opsgenie-default-apikey.yml
│ ├── conf.opsgenie-no-apikey.yml
│ ├── conf.rocketchat-both-token-and-tokenfile.yml
│ ├── conf.rocketchat-both-tokenid-and-tokenidfile.yml
│ ├── conf.rocketchat-default-token-file.yml
│ ├── conf.rocketchat-default-token.yml
│ ├── conf.rocketchat-no-token.yml
│ ├── conf.slack-both-file-and-token.yml
│ ├── conf.slack-both-file-and-url.yml
│ ├── conf.slack-both-url-and-token.yml
│ ├── conf.slack-default-api-url-file.yml
│ ├── conf.slack-default-app-token.yml
│ ├── conf.slack-no-api-url-or-token.yml
│ ├── conf.slack-update-message-and-webhook.yml
│ ├── conf.smtp-both-password-and-file.yml
│ ├── conf.smtp-no-username-or-password.yml
│ ├── conf.smtp-password-global-and-local.yml
│ ├── conf.sns-invalid.yml
│ ├── conf.sns-topic-arn.yml
│ ├── conf.telegram-both-bot-token-and-file.yml
│ ├── conf.telegram-default-bot-token-file.yml
│ ├── conf.telegram-default-bot-token.yml
│ ├── conf.telegram-no-bot-token.yml
│ ├── conf.telegram-valid-receiver-both-bot-token-and-file.yml
│ ├── conf.victorops-both-file-and-apikey.yml
│ ├── conf.victorops-default-apikey-file.yml
│ ├── conf.victorops-default-apikey.yml
│ ├── conf.victorops-no-apikey.yml
│ ├── conf.wechat-both-file-and-secret.yml
│ ├── conf.wechat-default-api-secret-file.yml
│ └── conf.wechat-no-api-secret.yml
├── dispatch/
│ ├── dispatch.go
│ ├── dispatch_bench_test.go
│ ├── dispatch_test.go
│ ├── route.go
│ └── route_test.go
├── doc/
│ ├── alertmanager-mixin/
│ │ ├── .gitignore
│ │ ├── .lint
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── alerts.jsonnet
│ │ ├── alerts.libsonnet
│ │ ├── config.libsonnet
│ │ ├── dashboards/
│ │ │ └── overview.libsonnet
│ │ ├── dashboards.jsonnet
│ │ ├── dashboards.libsonnet
│ │ ├── jsonnetfile.json
│ │ ├── jsonnetfile.lock.json
│ │ └── mixin.libsonnet
│ ├── arch.xml
│ ├── design/
│ │ └── secure-cluster-traffic.md
│ └── examples/
│ └── simple.yml
├── docs/
│ ├── alertmanager.md
│ ├── alerts_api.md
│ ├── configuration.md
│ ├── high_availability.md
│ ├── https.md
│ ├── index.md
│ ├── integrations.md
│ ├── management_api.md
│ ├── notification_examples.md
│ ├── notifications.md
│ └── overview.md
├── examples/
│ ├── ha/
│ │ ├── send_alerts.sh
│ │ └── tls/
│ │ ├── Makefile
│ │ ├── Procfile
│ │ ├── README.md
│ │ ├── certs/
│ │ │ ├── ca-config.json
│ │ │ ├── ca-csr.json
│ │ │ ├── ca-key.pem
│ │ │ ├── ca.csr
│ │ │ ├── ca.pem
│ │ │ ├── node1-csr.json
│ │ │ ├── node1-key.pem
│ │ │ ├── node1.csr
│ │ │ ├── node1.pem
│ │ │ ├── node2-csr.json
│ │ │ ├── node2-key.pem
│ │ │ ├── node2.csr
│ │ │ └── node2.pem
│ │ ├── tls_config_node1.yml
│ │ └── tls_config_node2.yml
│ └── webhook/
│ ├── echo.go
│ └── teams.tmpl
├── featurecontrol/
│ ├── featurecontrol.go
│ └── featurecontrol_test.go
├── go.mod
├── go.sum
├── inhibit/
│ ├── index.go
│ ├── inhibit.go
│ ├── inhibit_bench_test.go
│ └── inhibit_test.go
├── internal/
│ └── tools/
│ ├── go.mod
│ └── go.sum
├── limit/
│ ├── bucket.go
│ └── bucket_test.go
├── matcher/
│ ├── compat/
│ │ ├── parse.go
│ │ └── parse_test.go
│ ├── compliance/
│ │ └── compliance_test.go
│ └── parse/
│ ├── bench_test.go
│ ├── fuzz_test.go
│ ├── lexer.go
│ ├── lexer_test.go
│ ├── parse.go
│ ├── parse_test.go
│ └── token.go
├── nflog/
│ ├── nflog.go
│ ├── nflog_test.go
│ └── nflogpb/
│ ├── nflog.pb.go
│ ├── nflog.proto
│ ├── set.go
│ └── set_test.go
├── notify/
│ ├── discord/
│ │ ├── discord.go
│ │ └── discord_test.go
│ ├── email/
│ │ ├── email.go
│ │ ├── email_test.go
│ │ └── testdata/
│ │ ├── auth-local.yml
│ │ ├── auth.yml
│ │ ├── noauth-local.yml
│ │ └── noauth.yml
│ ├── incidentio/
│ │ ├── incidentio.go
│ │ └── incidentio_test.go
│ ├── jira/
│ │ ├── jira.go
│ │ ├── jira_test.go
│ │ └── types.go
│ ├── mattermost/
│ │ ├── mattermost.go
│ │ └── mattermost_test.go
│ ├── msteams/
│ │ ├── msteams.go
│ │ └── msteams_test.go
│ ├── msteamsv2/
│ │ ├── msteamsv2.go
│ │ └── msteamsv2_test.go
│ ├── mute.go
│ ├── mute_test.go
│ ├── notify.go
│ ├── notify_test.go
│ ├── opsgenie/
│ │ ├── api_key_file
│ │ ├── opsgenie.go
│ │ └── opsgenie_test.go
│ ├── pagerduty/
│ │ ├── pagerduty.go
│ │ └── pagerduty_test.go
│ ├── pushover/
│ │ ├── pushover.go
│ │ └── pushover_test.go
│ ├── rocketchat/
│ │ ├── rocketchat.go
│ │ └── rocketchat_test.go
│ ├── slack/
│ │ ├── slack.go
│ │ └── slack_test.go
│ ├── sns/
│ │ ├── sns.go
│ │ └── sns_test.go
│ ├── telegram/
│ │ ├── telegram.go
│ │ └── telegram_test.go
│ ├── test/
│ │ └── test.go
│ ├── util.go
│ ├── util_test.go
│ ├── victorops/
│ │ ├── victorops.go
│ │ └── victorops_test.go
│ ├── webex/
│ │ ├── webex.go
│ │ └── webex_test.go
│ ├── webhook/
│ │ ├── webhook.go
│ │ └── webhook_test.go
│ └── wechat/
│ ├── wechat.go
│ └── wechat_test.go
├── pkg/
│ ├── README.md
│ ├── labels/
│ │ ├── matcher.go
│ │ ├── matcher_test.go
│ │ ├── parse.go
│ │ └── parse_test.go
│ └── modtimevfs/
│ └── modtimevfs.go
├── provider/
│ ├── mem/
│ │ ├── mem.go
│ │ └── mem_test.go
│ └── provider.go
├── scripts/
│ ├── genproto.sh
│ └── swagger.sh
├── silence/
│ ├── cache.go
│ ├── cache_test.go
│ ├── silence.go
│ ├── silence_bench_test.go
│ ├── silence_test.go
│ ├── silencepb/
│ │ ├── silence.pb.go
│ │ └── silence.proto
│ ├── state.go
│ └── state_test.go
├── store/
│ ├── store.go
│ └── store_test.go
├── template/
│ ├── Dockerfile
│ ├── Makefile
│ ├── default.tmpl
│ ├── email.html
│ ├── email.tmpl
│ ├── inline-css.js
│ ├── template.go
│ └── template_test.go
├── test/
│ ├── cli/
│ │ ├── acceptance/
│ │ │ └── cli_test.go
│ │ ├── acceptance.go
│ │ └── mock.go
│ ├── testutils/
│ │ ├── acceptance.go
│ │ ├── collector.go
│ │ └── mock.go
│ └── with_api_v2/
│ ├── acceptance/
│ │ ├── api_test.go
│ │ ├── cluster_test.go
│ │ ├── inhibit_test.go
│ │ ├── send_test.go
│ │ ├── silence_test.go
│ │ ├── utf8_test.go
│ │ └── web_test.go
│ ├── acceptance.go
│ └── mock.go
├── timeinterval/
│ ├── timeinterval.go
│ └── timeinterval_test.go
├── tracing/
│ ├── config.go
│ ├── http.go
│ ├── testdata/
│ │ └── ca.cer
│ ├── tracing.go
│ └── tracing_test.go
├── types/
│ ├── types.go
│ └── types_test.go
└── ui/
├── Dockerfile
├── app/
│ ├── .gitignore
│ ├── CONTRIBUTING.md
│ ├── Makefile
│ ├── README.md
│ ├── elm.json
│ ├── index.html
│ ├── lib/
│ │ ├── elm-datepicker/
│ │ │ └── css/
│ │ │ └── elm-datepicker.css
│ │ └── font-awesome-4.7.0/
│ │ ├── css/
│ │ │ └── font-awesome.css
│ │ └── fonts/
│ │ └── FontAwesome.otf
│ ├── review/
│ │ ├── elm.json
│ │ └── src/
│ │ └── ReviewConfig.elm
│ ├── script.js
│ ├── src/
│ │ ├── Alerts/
│ │ │ └── Api.elm
│ │ ├── Data/
│ │ │ ├── Alert.elm
│ │ │ ├── AlertGroup.elm
│ │ │ ├── AlertStatus.elm
│ │ │ ├── AlertmanagerConfig.elm
│ │ │ ├── AlertmanagerStatus.elm
│ │ │ ├── ClusterStatus.elm
│ │ │ ├── GettableAlert.elm
│ │ │ ├── GettableSilence.elm
│ │ │ ├── InlineResponse200.elm
│ │ │ ├── Matcher.elm
│ │ │ ├── PeerStatus.elm
│ │ │ ├── PostableAlert.elm
│ │ │ ├── PostableSilence.elm
│ │ │ ├── Receiver.elm
│ │ │ ├── Silence.elm
│ │ │ ├── SilenceStatus.elm
│ │ │ └── VersionInfo.elm
│ │ ├── DateTime.elm
│ │ ├── Main.elm
│ │ ├── Parsing.elm
│ │ ├── Silences/
│ │ │ ├── Api.elm
│ │ │ ├── Decoders.elm
│ │ │ └── Types.elm
│ │ ├── Status/
│ │ │ ├── Api.elm
│ │ │ └── Types.elm
│ │ ├── Types.elm
│ │ ├── Updates.elm
│ │ ├── Utils/
│ │ │ ├── Api.elm
│ │ │ ├── Date.elm
│ │ │ ├── DateTimePicker/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ ├── Utils.elm
│ │ │ │ └── Views.elm
│ │ │ ├── Filter.elm
│ │ │ ├── FormValidation.elm
│ │ │ ├── Keyboard.elm
│ │ │ ├── List.elm
│ │ │ ├── Match.elm
│ │ │ ├── String.elm
│ │ │ ├── Types.elm
│ │ │ └── Views.elm
│ │ ├── Views/
│ │ │ ├── AlertList/
│ │ │ │ ├── AlertView.elm
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── FilterBar/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── GroupBar/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── NavBar/
│ │ │ │ ├── Types.elm
│ │ │ │ └── Views.elm
│ │ │ ├── NotFound/
│ │ │ │ └── Views.elm
│ │ │ ├── ReceiverBar/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── Settings/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── Shared/
│ │ │ │ ├── Alert.elm
│ │ │ │ ├── AlertCompact.elm
│ │ │ │ ├── AlertListCompact.elm
│ │ │ │ ├── Dialog.elm
│ │ │ │ ├── SilencePreview.elm
│ │ │ │ └── Types.elm
│ │ │ ├── SilenceForm/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── SilenceList/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── SilenceView.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── SilenceView/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ └── Status/
│ │ │ ├── Parsing.elm
│ │ │ ├── Types.elm
│ │ │ ├── Updates.elm
│ │ │ └── Views.elm
│ │ └── Views.elm
│ └── tests/
│ ├── Filter.elm
│ ├── Helpers.elm
│ ├── Match.elm
│ └── StringUtils.elm
├── mantine-ui/
│ ├── .gitignore
│ ├── .nvmrc
│ ├── .prettierrc.mjs
│ ├── .stylelintignore
│ ├── .stylelintrc.json
│ ├── eslint.config.js
│ ├── index.html
│ ├── package.json
│ ├── postcss.config.cjs
│ ├── src/
│ │ ├── App.tsx
│ │ ├── components/
│ │ │ ├── ErrorBoundary.tsx
│ │ │ ├── Header.module.css
│ │ │ ├── Header.tsx
│ │ │ ├── InfoPageCard.tsx
│ │ │ └── InfoPageStack.tsx
│ │ ├── data/
│ │ │ ├── api.ts
│ │ │ ├── groups.ts
│ │ │ ├── silences.ts
│ │ │ └── status.ts
│ │ ├── highlightjs.css
│ │ ├── main.tsx
│ │ ├── pages/
│ │ │ ├── Alerts.page.test.tsx
│ │ │ ├── Alerts.page.tsx
│ │ │ ├── Config.page.tsx
│ │ │ ├── Silences.page.tsx
│ │ │ └── Status.page.tsx
│ │ ├── theme.ts
│ │ └── vite-env.d.ts
│ ├── test-utils/
│ │ ├── index.ts
│ │ └── render.tsx
│ ├── tsconfig.json
│ ├── vite.config.mjs
│ └── vitest.setup.mjs
├── web.go
└── web_test.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
.build/
.tarballs/
!.build/linux-amd64/
!.build/linux-armv7/
!.build/linux-arm64/
!.build/linux-ppc64le/
!.build/linux-s390x/
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
---
name: Bug report
description: Create a report to help us improve.
body:
- type: markdown
attributes:
value: |
Thank you for opening a bug report for Alertmanager.
Please do *NOT* ask support questions in Github issues.
If your issue is not a feature request or bug report use our [community support](https://prometheus.io/community/).
There is also [commercial support](https://prometheus.io/support-training/) available.
- type: textarea
attributes:
label: What did you do?
description: Please provide steps for us to reproduce this issue.
validations:
required: true
- type: textarea
attributes:
label: What did you expect to see?
- type: textarea
attributes:
label: What did you see instead? Under which circumstances?
validations:
required: true
- type: markdown
attributes:
value: |
## Environment
- type: input
attributes:
label: System information
description: Insert output of `uname -srm` here, or operating system version.
placeholder: e.g. Linux 5.16.15 x86_64
- type: textarea
attributes:
label: Alertmanager version
description: Insert output of `alertmanager --version` here.
render: text
placeholder: |
e.g. alertmanager, version 0.22.2 (branch: HEAD, revision: 44f8adc06af5101ad64bd8b9c8b18273f2922051)
build user: root@b595c7f32520
build date: 20210602-07:50:37
go version: go1.16.4
platform: linux/amd64
- type: textarea
attributes:
label: Alertmanager configuration file
description: Insert relevant configuration here. Don't forget to remove secrets.
render: yaml
- type: textarea
attributes:
label: Prometheus version
description: Insert output of `prometheus --version` here (if relevant to the issue).
render: text
placeholder: |
e.g. prometheus, version 2.23.0 (branch: HEAD, revision: 26d89b4b0776fe4cd5a3656dfa520f119a375273)
build user: root@37609b3a0a21
build date: 20201126-10:56:17
go version: go1.15.5
platform: linux/amd64
- type: textarea
attributes:
label: Prometheus configuration file
description: Insert relevant configuration here. Don't forget to remove secrets.
render: yaml
- type: textarea
attributes:
label: Logs
description: Insert Prometheus and Alertmanager logs relevant to the issue here.
render: text
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: true
contact_links:
- name: Prometheus Community Support
url: https://prometheus.io/community/
about: If you need help or support, please request help here.
- name: Commercial Support & Training
url: https://prometheus.io/support-training/
about: If you want commercial support or training, vendors are listed here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yml
================================================
---
name: Feature request
description: Suggest an idea for this project.
body:
- type: markdown
attributes:
value: >-
Please do *NOT* ask support questions in Github issues.
If your issue is not a feature request or bug report use
our [community support](https://prometheus.io/community/).
There is also [commercial
support](https://prometheus.io/support-training/) available.
- type: textarea
attributes:
label: Proposal
description: Use case. Why is this important?
placeholder: “Nice to have” is not a good use case. :)
validations:
required: true
================================================
FILE: .github/pull_request_template.md
================================================
<!--
- Please give your PR a title in the form "area: short description". For example "dispatcher: improve performance"
- Please sign-off your commits by adding the -s / --signoff flag to `git commit`. See https://github.com/apps/dco for more information.
- If the PR adds or changes a behaviour or fixes a bug of an exported API it would need a unit/e2e test.
- Where possible use only exported APIs for tests to simplify the review and make it as close as possible to an actual library usage.
- Performance improvements would need a benchmark test to prove it.
- All exposed objects should have a comment.
- All comments should start with a capital letter and end with a full stop.
-->
#### Pull Request Checklist
Please check all the applicable boxes.
- Please list all open issue(s) discussed with maintainers related to this change
- Fixes #<issue number>
<!--
If it applies.
Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
More at https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
- Is this a new Receiver integration?
- [ ] I have already tried to use the [Webhook Receiver Integration](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config) and [3rd party integrations](https://prometheus.io/docs/operating/integrations/#alertmanager-webhook-receiver) before adding this 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`](https://pkg.go.dev/golang.org/x/perf/cmd/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](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-open-source)
#### Which user-facing changes does this PR introduce?
<!--
If no, just write "NONE" in the release-notes block below.
Otherwise, please describe what should be mentioned in the CHANGELOG. Use the following prefixes:
[FEATURE] [ENHANCEMENT] [PERF] [BUGFIX] [SECURITY] [CHANGE]
Refer to the existing CHANGELOG for inspiration: https://github.com/prometheus/alertmanager/blob/main/CHANGELOG.md
A concrete example may look as follows (be sure to leave out the surrounding quotes): "[FEATURE] API: Add /api/v1/features for clients to understand which features are supported".
If you need help formulating your entries, consult the reviewer(s).
-->
```release-notes
```
================================================
FILE: .github/workflows/ci.yml
================================================
---
name: CI
on: # yamllint disable-line rule:truthy
pull_request:
workflow_call:
jobs:
test_frontend:
name: Test alertmanager frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: make clean
- run: make all
working-directory: ./ui/app
- run: make assets
- run: make apiv2
- run: git diff --exit-code
build:
name: Build Alertmanager for common architectures
runs-on: ubuntu-latest
strategy:
matrix:
thread: [0, 1, 2]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.0.0
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
- uses: ./.github/promci/actions/build
with:
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
parallelism: 3
thread: ${{ matrix.thread }}
test:
name: Test
runs-on: ubuntu-latest
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
container:
image: quay.io/prometheus/golang-builder:1.26-base
services:
maildev-noauth:
image: maildev/maildev:2.2.1
maildev-auth:
image: maildev/maildev:2.2.1
env:
MAILDEV_INCOMING_USER: user
MAILDEV_INCOMING_PASS: pass
env:
EMAIL_NO_AUTH_CONFIG: testdata/noauth.yml
EMAIL_AUTH_CONFIG: testdata/auth.yml
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
- uses: ./.github/promci/actions/setup_environment
- run: make
- run: git diff --exit-code
================================================
FILE: .github/workflows/container_description.yml
================================================
---
name: Push README to Docker Hub
on:
push:
paths:
- "README.md"
- "README-containers.md"
- ".github/workflows/container_description.yml"
branches: [ main, master ]
permissions:
contents: read
jobs:
PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: dockerhub
short_description: ${{ env.DOCKER_REPO_NAME }}
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''
PushQuayIoReadme:
runs-on: ubuntu-latest
name: Push README to quay.io
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to quay.io
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: quay
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''
================================================
FILE: .github/workflows/mixin.yml
================================================
name: mixin
on:
pull_request:
paths:
- "doc/alertmanager-mixin/**"
jobs:
mixin:
name: mixin-lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: 1.26.x
# pin the mixtool version until https://github.com/monitoring-mixins/mixtool/issues/135 is merged.
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@2282201396b69055bb0f92f187049027a16d2130
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
- run: make -C doc/alertmanager-mixin lint
================================================
FILE: .github/workflows/publish.yml
================================================
---
name: Publish
on: # yamllint disable-line rule:truthy
push:
branches:
- main
jobs:
ci:
name: Run ci
uses: ./.github/workflows/ci.yml
build:
name: Build Alertmanager for all architectures
runs-on: ubuntu-latest
strategy:
matrix:
thread: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
needs: ci
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}
publish_main:
name: Publish main branch artefacts
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
- uses: ./.github/promci/actions/publish_main
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
================================================
FILE: .github/workflows/release.yml
================================================
---
name: Release
on: # yamllint disable-line rule:truthy
push:
tags:
- v*
jobs:
ci:
name: Run ci
uses: ./.github/workflows/ci.yml
build:
name: Build Alertmanager for all architectures
runs-on: ubuntu-latest
strategy:
matrix:
thread: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
needs: ci
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}
publish_release:
name: Publish release artefacts
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
- uses: ./.github/promci/actions/publish_release
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
================================================
FILE: .github/workflows/stale.yml
================================================
name: Stale Check
on:
workflow_dispatch: {}
schedule:
- cron: '16 22 * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
runs-on: ubuntu-latest
steps:
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# opt out of defaults to avoid marking issues as stale and closing them
# https://github.com/actions/stale#days-before-close
# https://github.com/actions/stale#days-before-stale
days-before-stale: -1
days-before-close: -1
# Setting it to empty string to skip comments.
# https://github.com/actions/stale#stale-pr-message
# https://github.com/actions/stale#stale-issue-message
stale-pr-message: ''
stale-issue-message: ''
operations-per-run: 30
# override days-before-stale, for only marking the pull requests as stale
days-before-pr-stale: 60
stale-pr-label: stale
exempt-pr-labels: keepalive
================================================
FILE: .github/workflows/ui-ci.yml
================================================
name: UI CI
on:
pull_request:
branches:
- '**'
paths:
- 'ui/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
test_mantine_ui:
name: Test mantine-ui
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ui/mantine-ui
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: './ui/mantine-ui/.nvmrc'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Run tests
run: npm test
================================================
FILE: .gitignore
================================================
/data/
/alertmanager
/amtool
*.yml
*.yaml
/.build
/.release
/.tarballs
/vendor
!.golangci.yml
!/cli/testdata/*.yml
!/cli/config/testdata/*.yml
!/cluster/testdata/*.yml
!/config/testdata/*.yml
!/examples/ha/tls/*.yml
!/notify/email/testdata/*.yml
!/doc/examples/simple.yml
!/circle.yml
!/.travis.yml
!/.promu.yml
!/api/v2/openapi.yaml
!.github/workflows/*.yml
!.github/ISSUE_TEMPLATE/*.yml
!buf*.yaml
================================================
FILE: .golangci.yml
================================================
version: "2"
linters:
enable:
- depguard
- errorlint
- godot
- misspell
- modernize
- revive
- sloglint
- testifylint
settings:
depguard:
rules:
main:
deny:
- pkg: github.com/stretchr/testify/assert
desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
- pkg: github.com/go-kit/kit/log
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
- pkg: github.com/pkg/errors
desc: "Use errors or fmt instead of github.com/pkg/errors"
errcheck:
exclude-functions:
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
- io.Copy
# The next two are used in HTTP handlers, any error is handled by the server itself.
- io.WriteString
- (net/http.ResponseWriter).Write
# No need to check for errors on server's shutdown.
- (*net/http.Server).Shutdown
# Never check for rollback errors as Rollback() is called when a previous error was detected.
- (github.com/prometheus/prometheus/storage.Appender).Rollback
godot:
scope: toplevel
exclude:
- "^ ?This file is safe to edit"
- "^ ?scheme value"
period: true
capital: true
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
arguments:
- disableStutteringCheck
- name: if-return
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: var-declaration
- name: var-naming
disabled: true
testifylint:
disable:
- float-compare
- go-require
enable-all: true
exclusions:
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
# Skip autogenerated files.
- ^.*\.(pb|y)\.go$
rules:
- linters:
- errcheck
path: _test.go
- linters:
- modernize
text: "omitzero: Omitempty has no effect on nested struct fields"
- linters:
- staticcheck
text: "SA1019:.*types\\.Alert.*"
warn-unused: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m
formatters:
enable:
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- github.com/prometheus/alertmanager
================================================
FILE: .promu.yml
================================================
go:
# Whenever the Go version is updated here,
# .circle/config.yml should also be updated.
version: 1.26
repository:
path: github.com/prometheus/alertmanager
build:
binaries:
- name: alertmanager
path: ./cmd/alertmanager
- name: amtool
path: ./cmd/amtool
tags:
all:
- netgo
windows: []
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- examples/ha/alertmanager.yml
- LICENSE
- NOTICE
crossbuild:
platforms:
- darwin
- dragonfly
- freebsd
- illumos
- linux
- netbsd
- openbsd
- windows
================================================
FILE: .yamllint
================================================
---
extends: default
ignore: |
**/node_modules
web/api/v1/testdata/openapi_*_golden.yaml
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
commas: disable
comments: disable
comments-indentation: disable
document-start: disable
indentation:
spaces: consistent
indent-sequences: consistent
key-duplicates:
ignore: |
config/testdata/section_key_dup.bad.yml
line-length: disable
truthy:
check-keys: false
================================================
FILE: CHANGELOG.md
================================================
## main / (unreleased)
* [CHANGE] ...
* [FEATURE] ...
* [ENHANCEMENT] ...
* [BUGFIX] Use dispatcher tick time when evaluating repeat interval in dedup stage. #2461
## 0.31.1 / 2026-02-11
* [BUGFIX] docs: Fix email TLS configuration example. #4976
* [BUGFIX] docs: Add telegram bot token options to global config docs. #4999
## 0.31.0 / 2026-02-02
* [ENHANCEMENT] docs(opsgenie): Fix description of `api_url` field. #4908
* [ENHANCEMENT] docs(slack): Document missing app configs. #4871
* [ENHANCEMENT] docs: Fix `max-silence-size-bytes`. #4805
* [ENHANCEMENT] docs: Update expr for `AlertmanagerClusterFailedToSendAlerts` to exclude value 0. #4872
* [ENHANCEMENT] docs: Use matchers for inhibit rules examples. #4131
* [ENHANCEMENT] docs: add notification integrations. #4901
* [ENHANCEMENT] docs: update `slack_config` attachments documentation links. #4802
* [ENHANCEMENT] docs: update description of filter query params in openapi doc. #4810
* [ENHANCEMENT] provider: Reduce lock contention. #4809
* [FEATURE] slack: Add support for top-level text field in slack notification. #4867
* [FEATURE] smtp: Add support for authsecret from file. #3087
* [FEATURE] smtp: Customize the ssl/tls port support (#4757). #4818
* [FEATURE] smtp: Enhance email notifier configuration validation. #4826
* [FEATURE] telegram: Add `chat_id_file` configuration parameter. #4909
* [FEATURE] telegram: Support global bot token. #4823
* [FEATURE] webhook: Support templating in url fields. #4798
* [FEATURE] wechat: Add config directive to pass api secret via file. #4734
* [FEATURE] provider: Implement per alert limits. #4819
* [BUGFIX] Allow empty `group_by` to override parent route. #4825
* [BUGFIX] Set `spellcheck=false` attribute on silence filter input. #4811
* [BUGFIX] jira: Fix for handling api v3 with ADF. #4756
* [BUGFIX] jira: Prevent hostname corruption in cloud api url replacement. #4892
## 0.30.1 / 2026-01-12
* [BUGFIX] Fix memory leak in tracing client. #4828
## 0.30.0 / 2025-12-15
* [CHANGE] Don't allow calling qids with an empty ids list. #4707
* [FEATURE] Add mattermost integration. #4090
* [FEATURE] Add saturday to the first day of the week options. #4473
* [FEATURE] Add templating functions for working with urls. #4625
* [FEATURE] cluster: Allow persistent peer names. #4636
* [FEATURE] dispatch: Add start delay. #4704
* [FEATURE] provider: Add subscriber channel metrics. #4630
* [FEATURE] template: Add tojson function. #4773
* [FEATURE] Add api http metrics. #4162
* [FEATURE] Add distributed tracing support. #4745
* [FEATURE] Add names to inhibit rules. #4628
* [FEATURE] Add timeout option for pagerduty notifier. #4354
* [FEATURE] Add timeout option for slack notifier. #4355
* [FEATURE] Allow nested details fields in pagerduty. #3944
* [FEATURE] Implement `phantom_threading` to group email alerts into threads. #4623
* [FEATURE] gc: Report errors, but remove erroneous silences and continue. #4724
* [FEATURE] jira: Template customfields. #4029
* [FEATURE] jira: Allow configuring issue update via parameter. #4621
* [FEATURE] Slack app support. #4211
* [ENHANCEMENT] Add comment about smtp plain authentication. #4741
* [ENHANCEMENT] Add documentation about high availability. #4708
* [ENHANCEMENT] Add documentation for `client_allowed_sans`. #4706
* [ENHANCEMENT] Improve logging around webhook dispatch failure. #4511
* [ENHANCEMENT] Compile silence matchers when the silence is added. #4695
* [ENHANCEMENT] Fix '`s/client/alerts_api/g`' broken link in 0.29. #4718
* [ENHANCEMENT] Fix `rocketchat_config` docs. #4767
* [ENHANCEMENT] Fix: `<mute_time_interval>` was renamed. #4729
* [ENHANCEMENT] Improve inhibition performance. #4607
* [ENHANCEMENT] Loadsnapshot: update matcher index properly while not holding lock. #4714
* [ENHANCEMENT] Logging improvements. #4113
* [ENHANCEMENT] Move query locking back into private query function. #4694
* [ENHANCEMENT] Optimize the new inhibitor implementation for ~2.5x performance improvement. #4668
* [ENHANCEMENT] Reduce the time dispatch.group holds the mutex. #4670
* [ENHANCEMENT] Use b.loop() to simplify the code and improve performance. #4642
* [ENHANCEMENT] Remove duplicate slice during silences query. #4696
* [ENHANCEMENT] Silences: optimize incremental mutes queries via a silence version index. #4723
* [ENHANCEMENT] Update description for filter param in openapi. #4775
* [BUGFIX] Add new behavior to avoid races on config reload. #4705
* [BUGFIX] config: Fix duplicate header detection for all case variants. #2810
* [BUGFIX] marker: Stop state leakage from aggregation groups. #4438
* [BUGFIX] Fix pprof debug endpoints not working with --web.route-prefix. #4698
* [BUGFIX] Set context timeout for resolvepeers. #4343
## 0.29.0 / 2025-11-01
* [FEATURE] Add incident.io notifier. #4372
* [FEATURE] Add monospace message formatting. #4362
* [FEATURE] Add ability to customize interval for maintenance to run. #4541
* [ENHANCEMENT] Update Jira notifier to support both Jira cloud API v3 and Jira datacenter API v2. #4542
* [ENHANCEMENT] Increase mixin rate intervals for alert `FailedToSendAlerts`. #4206
* [ENHANCEMENT] Make /alertmanager group writable in docker image. #4469
* [BUGFIX] Fix logged notification count on error in notify. #4323
* [BUGFIX] Fix docker image permissions path. #4288
* [BUGFIX] Fix error handling in template rendering for Telegram. #4353
* [BUGFIX] Fix duplicate `other` in error messages for config. #4366
* [BUGFIX] Fix logic that considers an alert reopened in Jira. #4478
* [BUGFIX] Fix Jira issue count #4615
## 0.28.1 / 2025-03-07
* [ENHANCEMENT] Improved performance of inhibition rules when using Equal labels. #4119
* [ENHANCEMENT] Improve the documentation on escaping in UTF-8 matchers. #4157
* [ENHANCEMENT] Update alertmanager_config_hash metric help to document the hash is not cryptographically strong. #4210
* [BUGFIX] Fix panic in amtool when using `--verbose`. #4218
* [BUGFIX] Fix templating of channel field for Rocket.Chat. #4220
* [BUGFIX] Fix `rocketchat_configs` written as `rocket_configs` in docs. #4217
* [BUGFIX] Fix usage for `--enable-feature` flag. #4214
* [BUGFIX] Trim whitespace from OpsGenie API Key. #4195
* [BUGFIX] Fix Jira project template not rendered when searching for existing issues. #4291
* [BUGFIX] Fix subtle bug in JSON/YAML encoding of inhibition rules that would cause Equal labels to be omitted. #4292
* [BUGFIX] Fix header for `slack_configs` in docs. #4247
* [BUGFIX] Fix weight and wrap of Microsoft Teams notifications. #4222
* [BUGFIX] Fix format of YAML examples in configuration.md. #4207
## 0.28.0 / 2025-01-15
* [CHANGE] Templating errors in the SNS integration now return an error. #3531 #3879
* [CHANGE] Adopt log/slog, drop go-kit/log #4089
* [FEATURE] Add a new Microsoft Teams integration based on Flows #4024
* [FEATURE] Add a new Rocket.Chat integration #3600
* [FEATURE] Add a new Jira integration #3590 #3931
* [FEATURE] Add support for `GOMEMLIMIT`, enable it via the feature flag `--enable-feature=auto-gomemlimit`. #3895
* [FEATURE] Add support for `GOMAXPROCS`, enable it via the feature flag `--enable-feature=auto-gomaxprocs`. #3837
* [FEATURE] Add support for limits of silences including the maximum number of active and pending silences, and the maximum size per silence (in bytes). You can use the flags `--silences.max-silences` and `--silences.max-silence-size-bytes` to set them accordingly #3852 #3862 #3866 #3885 #3886 #3877
* [FEATURE] Muted alerts now show whether they are suppressed or not in both the `/api/v2/alerts` endpoint and the Alertmanager UI. #3793 #3797 #3792
* [ENHANCEMENT] Add support for `content`, `username` and `avatar_url` in the Discord integration. `content` and `username` also support templating. #4007
* [ENHANCEMENT] Only invalidate the silences cache if a new silence is created or an existing silence replaced - should improve latency on both `GET api/v2/alerts` and `POST api/v2/alerts` API endpoint. #3961
* [ENHANCEMENT] Add image source label to Dockerfile. To get changelogs shown when using Renovate #4062
* [ENHANCEMENT] Build using go 1.23 #4071
* [ENHANCEMENT] Support setting a global SMTP TLS configuration. #3732
* [ENHANCEMENT] The setting `room_id` in the WebEx integration can now be templated to allow for dynamic room IDs. #3801
* [ENHANCEMENT] Enable setting `message_thread_id` for the Telegram integration. #3638
* [ENHANCEMENT] Support the `since` and `humanizeDuration` functions to templates. This means users can now format time to more human-readable text. #3863
* [ENHANCEMENT] Support the `date` and `tz` functions to templates. This means users can now format time in a specified format and also change the timezone to their specific locale. #3812
* [ENHANCEMENT] Latency metrics now support native histograms. #3737
* [ENHANCEMENT] Add full width to adaptive card for msteamsv2 #4135
* [ENHANCEMENT] Add timeout option for webhook notifier. #4137
* [ENHANCEMENT] Update config to allow showing secret values when marshaled #4158
* [ENHANCEMENT] Enable templating for Jira project and issue_type #4159
* [BUGFIX] Fix the SMTP integration not correctly closing an SMTP submission, which may lead to unsuccessful dispatches being marked as successful. #4006
* [BUGFIX] The `ParseMode` option is now set explicitly in the Telegram integration. If we don't HTML tags had not been parsed by default. #4027
* [BUGFIX] Fix a memory leak that was caused by updates silences continuously. #3930
* [BUGFIX] Fix hiding secret URLs when the URL is incorrect. #3887
* [BUGFIX] Fix a race condition in the alerts - it was more of a hypothetical race condition that could have occurred in the alert reception pipeline. #3648
* [BUGFIX] Fix a race condition in the alert delivery pipeline that would cause a firing alert that was delivered earlier to be deleted from the aggregation group when instead it should have been delivered again. #3826
* [BUGFIX] Fix version in APIv1 deprecation notice. #3815
* [BUGFIX] Fix crash errors when using `url_file` in the Webhook integration. #3800
* [BUGFIX] fix `Route.ID()` returns conflicting IDs. #3803
* [BUGFIX] Fix deadlock on the alerts memory store. #3715
* [BUGFIX] Fix `amtool template render` when using the default values. #3725
* [BUGFIX] Fix `webhook_url_file` for both the Discord and Microsoft Teams integrations. #3728 #3745
* [BUGFIX] Fix wechat api link #4084
* [BUGFIX] Fix build info metric #4166
* [BUGFIX] Fix UTF-8 not allowed in Equal field for inhibition rules #4177
## 0.27.0 / 2024-02-28
* [CHANGE] Discord Integration: Enforce max length in `message`. #3597
* [CHANGE] API: Removal of all `api/v1/` endpoints. These endpoints now log and return a deprecation message and respond with a status code of `410`. #2970
* [FEATURE] UTF-8 Support: Introduction of support for any UTF-8 character as part of label names and matchers. Please read more below. #3453, #3483, #3567, #3570
* [FEATURE] Metrics: Introduced the experimental feature flag `--enable-feature=receiver-name-in-metrics` to include the receiver name in the following metrics: #3045
* `alertmanager_notifications_total`
* `alertmanager_notifications_failed_totall`
* `alertmanager_notification_requests_total`
* `alertmanager_notification_requests_failed_total`
* `alertmanager_notification_latency_seconds`
* [FEATURE] Metrics: Introduced a new gauge named `alertmanager_inhibition_rules` that counts the number of configured inhibition rules. #3681
* [FEATURE] Metrics: Introduced a new counter named `alertmanager_alerts_supressed_total` that tracks muted alerts, it contains a `reason` label to indicate the source of the mute. #3565
* [ENHANCEMENT] Discord Integration: Introduced support for `webhook_url_file`. #3555
* [ENHANCEMENT] Microsoft Teams Integration: Introduced support for `webhook_url_file`. #3555
* [ENHANCEMENT] Microsoft Teams Integration: Add support for `summary`. #3616
* [ENHANCEMENT] Metrics: Notification metrics now support two new values for the label `reason`, `contextCanceled` and `contextDeadlineExceeded`. #3631
* [ENHANCEMENT] Email Integration: Contents of `auth_password_file` are now trimmed of prefixed and suffixed whitespace. #3680
* [BUGFIX] amtool: Fixes the error `scheme required for webhook url` when using amtool with `--alertmanager.url`. #3509
* [BUGFIX] Mixin: Fix `AlertmanagerFailedToSendAlerts`, `AlertmanagerClusterFailedToSendAlerts`, and `AlertmanagerClusterFailedToSendAlerts` to make sure they ignore the `reason` label. #3599
### Removal of API v1
The Alertmanager `v1` API has been deprecated since January 2019 with the release of Alertmanager `v0.16.0`. With the release of version `0.27.0` it is now removed.
A successful HTTP request to any of the `v1` endpoints will log and return a deprecation message while responding with a status code of `410`.
Please ensure you switch to the `v2` equivalent endpoint in your integrations before upgrading.
### Alertmanager support for all UTF-8 characters in matchers and label names
Starting with Alertmanager `v0.27.0`, we have a new parser for matchers that has a number of backwards incompatible changes. While most matchers will be forward-compatible, some will not. Alertmanager is operating a transition period where it supports both UTF-8 and classic matchers, so **it's entirely safe to upgrade without any additional configuration**. With that said, we recommend the following:
- If this is a new Alertmanager installation, we recommend enabling UTF-8 strict mode before creating an Alertmanager configuration file. You can enable strict mode with `alertmanager --config.file=config.yml --enable-feature="utf8-strict-mode"`.
- If this is an existing Alertmanager installation, we recommend running the Alertmanager in the default mode called fallback mode before enabling UTF-8 strict mode. In this mode, Alertmanager will log a warning if you need to make any changes to your configuration file before UTF-8 strict mode can be enabled. **Alertmanager will make UTF-8 strict mode the default in the next two versions**, so it's important to transition as soon as possible.
Irrespective of whether an Alertmanager installation is a new or existing installation, you can also use `amtool` to validate that an Alertmanager configuration file is compatible with UTF-8 strict mode before enabling it in Alertmanager server by running `amtool check-config config.yml` and inspecting the log messages.
Should you encounter any problems, you can run the Alertmanager with just the classic parser enabled by running `alertmanager --config.file=config.yml --enable-feature="classic-mode"`. If so, please submit a bug report via GitHub issues.
## 0.26.0 / 2023-08-23
* [SECURITY] Fix stored XSS via the /api/v1/alerts endpoint in the Alertmanager UI. CVE-2023-40577
* [CHANGE] Telegram Integration: `api_url` is now optional. #2981
* [CHANGE] Telegram Integration: `ParseMode` default is now `HTML` instead of `MarkdownV2`. #2981
* [CHANGE] Webhook Integration: `url` is now marked as a secret. It will no longer show up in the logs as clear-text. #3228
* [CHANGE] Metrics: New label `reason` for `alertmanager_notifications_failed_total` metric to indicate the type of error of the alert delivery. #3094 #3307
* [FEATURE] Clustering: New flag `--cluster.label`, to help to block any traffic that is not meant for the cluster. #3354
* [FEATURE] Integrations: Add Microsoft Teams as a supported integration. #3324
* [ENHANCEMENT] Telegram Integration: Support `bot_token_file` for loading this secret from a file. #3226
* [ENHANCEMENT] Webhook Integration: Support `url_file` for loading this secret from a file. #3223
* [ENHANCEMENT] Webhook Integration: Leading and trailing white space is now removed for the contents of `url_file`. #3363
* [ENHANCEMENT] Pushover Integration: Support options `device` and `sound` (sound was previously supported but undocumented). #3318
* [ENHANCEMENT] Pushover Integration: Support `user_key_file` and `token_file` for loading this secret from a file. #3200
* [ENHANCEMENT] Slack Integration: Support errors wrapped in successful (HTTP status code 200) responses. #3121
* [ENHANCEMENT] API: Add `CORS` and `Cache-Control` HTTP headers to all version 2 API routes. #3195
* [ENHANCEMENT] UI: Receiver name is now visible as part of the alerts page. #3289
* [ENHANCEMENT] Templating: Better default text when using `{{ .Annotations }}` and `{{ .Labels }}`. #3256
* [ENHANCEMENT] Templating: Introduced a new function `trimSpace` which removes leading and trailing white spaces. #3223
* [ENHANCEMENT] CLI: `amtool silence query` now supports the `--id` flag to query an individual silence. #3241
* [ENHANCEMENT] Metrics: Introduced `alertmanager_nflog_maintenance_total` and `alertmanager_nflog_maintenance_errors_total` to monitor maintenance of the notification log. #3286
* [ENHANCEMENT] Metrics: Introduced `alertmanager_silences_maintenance_total` and `alertmanager_silences_maintenance_errors_total` to monitor maintenance of silences. #3285
* [ENHANCEMENT] Logging: Log GroupKey and alerts on alert delivery when using debug mode. #3438
* [BUGFIX] Configuration: Empty list of `receivers` and `inhibit_rules` would cause the alertmanager to crash. #3209
* [BUGFIX] Templating: Fixed a race condition when using the `title` function. It is now race-safe. #3278
* [BUGFIX] API: Fixed duplicate receiver names in the `api/v2/receivers` API endpoint. #3338
* [BUGFIX] API: Attempting to delete a silence now returns the correct status code, `404` instead of `500`. #3352
* [BUGFIX] Clustering: Fixes a panic when `tls_client_config` is empty. #3443
* [BUGFIX] Fix stored XSS via the /api/v1/alerts endpoint in the Alertmanager UI.
## 0.25.0 / 2022-12-22
* [CHANGE] Change the default `parse_mode` value from `MarkdownV2` to `HTML` for Telegram. #2981
* [CHANGE] Make `api_url` field optional for Telegram. #2981
* [CHANGE] Use CanonicalMIMEHeaderKey instead of TitleCasing for email headers. #3080
* [CHANGE] Reduce the number of notification logs broadcasted between peers by expiring them after (2 * repeat interval). #2982
* [FEATURE] Add `proxy_url` support for OAuth2 in HTTP client configuration. #3010
* [FEATURE] Reload TLS certificate and key from disk when updated. #3168
* [FEATURE] Add Discord integration. #2948
* [FEATURE] Add Webex integration. #3132
* [ENHANCEMENT] Add `--web.systemd-socket` flag to systemd socket activation listeners instead of port listeners (Linux only). #3140
* [ENHANCEMENT] Add `enable_http2` support in HTTP client configuration. #3010
* [ENHANCEMENT] Add `min_version` support to select the minimum TLS version in HTTP client configuration. #3010
* [ENHANCEMENT] Add `max_version` support to select the maximum TLS version in HTTP client configuration. #3168
* [ENHANCEMENT] Emit warning logs when truncating messages in notifications. #3145
* [ENHANCEMENT] Add `--data.maintenance-interval` flag to define the interval between the garbage collection and snapshotting to disk of the silences and the notification logs. #2849
* [ENHANCEMENT] Support HEAD method for the `/-/healty` and `/-/ready` endpoints. #3039
* [ENHANCEMENT] Truncate messages with the `…` ellipsis character instead of the 3-dots string `...`. #3072
* [ENHANCEMENT] Add support for reading global and local SMTP passwords from files. #3038
* [ENHANCEMENT] Add Location support to time intervals. #2782
* [ENHANCEMENT] UI: Add 'Link' button to alerts in list. #2880
* [ENHANCEMENT] Add the `source` field to the PagerDuty configuration. #3106
* [ENHANCEMENT] Add support for reading PagerDuty routing and service keys from files. #3107
* [ENHANCEMENT] Log response details when notifications fail for Webhooks, Pushover and VictorOps. #3103
* [ENHANCEMENT] UI: Allow to choose the first day of the week as Sunday or Monday. #3093
* [ENHANCEMENT] Add support for reading VictorOps API key from file. #3111
* [ENHANCEMENT] Support templating for Opsgenie's responder type. #3060
* [BUGFIX] Fail configuration loading if `api_key` and `api_key_file` are defined at the same time. #2910
* [BUGFIX] Fix the `alertmanager_alerts` metric to avoid counting resolved alerts as active. Also added a new `alertmanager_marked_alerts` metric that retain the old behavior. #2943
* [BUGFIX] Trim contents of Slack API URLs when reading from files. #2929
* [BUGFIX] amtool: Avoid panic when the label value matcher is empty. #2968
* [BUGFIX] Fail configuration loading if `api_url` is empty for OpsGenie. #2910
* [BUGFIX] Fix email template for resolved notifications. #3166
* [BUGFIX] Use the HTML template engine when the parse mode is HTML for Telegram. #3183
## 0.24.0 / 2022-03-24
* [CHANGE] Add the `/api/v2` prefix to all endpoints in the OpenAPI specification and generated client code. #2696
* [CHANGE] Remove the `github.com/prometheus/alertmanager/client` Go package. #2763
* [FEATURE] Add `--cluster.tls-config` experimental flag to secure cluster traffic via mutual TLS. #2237
* [FEATURE] Add support for active time intervals. Active and mute time intervals should be defined via `time_intervals` rather than `mute_time_intervals` (the latter is deprecated but it will be supported until v1.0). #2779
* [FEATURE] Add Telegram integration. #2827
* [ENHANCEMENT] Add `update_alerts` field to the OpsGenie configuration to update message and description when sending alerts. #2519
* [ENHANCEMENT] Add `--cluster.allow-insecure-public-advertise-address-discovery` feature flag to enable discovery and use of public IP addresses for clustering. #2719
* [ENHANCEMENT] Add `entity` and `actions` fields to the OpsGenie configuration. #2753
* [ENHANCEMENT] Add `opsgenie_api_key_file` field to the global configuration. #2728
* [ENHANCEMENT] Add support for `teams` responders to the OpsGenie configuration. #2685
* [ENHANCEMENT] Add the User-Agent header to all notification requests. #2730
* [ENHANCEMENT] Re-enable HTTP/2. #2720
* [ENHANCEMENT] web: Add support for security-related HTTP headers. #2759
* [ENHANCEMENT] amtool: Allow filtering of silences by `createdBy` author. #2718
* [ENHANCEMENT] amtool: add `--http.config.file` flag to configure HTTP settings. #2764
* [BUGFIX] Fix HTTP client configuration for the SNS receiver. #2706
* [BUGFIX] Fix unclosed file descriptor after reading the silences snapshot file. #2710
* [BUGFIX] Fix field names for `mute_time_intervals` in JSON marshaling. #2765
* [BUGFIX] Ensure that the root route doesn't have any matchers. #2780
* [BUGFIX] Truncate the message's title to 1024 chars to avoid hitting Slack limits. #2774
* [BUGFIX] Fix the default HTML email template (`email.default.html`) to match with the canonical source. #2798
* [BUGFIX] Detect SNS FIFO topic based on the rendered value. #2819
* [BUGFIX] Avoid deleting and recreating a silence when an update is possible. #2816
* [BUGFIX] api/v2: Return 200 OK when deleting an expired silence. #2817
* [BUGFIX] amtool: Fix the silence's end date when adding a silence. The end date is (start date + duration) while it used to be (current time + duration). The new behavior is consistent with the update operation. #2741
## 0.23.0 / 2021-08-25
* [FEATURE] Add AWS SNS receiver. #2615
* [FEATURE] amtool: add new template render command. #2538
* [ENHANCEMENT] amtool: Add ability to skip TLS verification for amtool. #2663
* [ENHANCEMENT] amtool: Detect version drift and warn users. #2672
* [BUGFIX] Time-based muting: Ensure time interval comparisons are in UTC. #2648
* [BUGFIX] amtool: Fix empty isEqual when talking to incompatible alertmanager. #2668
## 0.22.2 / 2021-06-01
* [BUGFIX] Include pending silences for future muting decisions. #2590
## 0.22.1 / 2021-05-27
This release addresses a regression in the API v1 that was introduced in 0.22.0.
Matchers in silences created with the API v1 could be considered negative
matchers. This affects users using amtool prior to v0.17.0.
* [BUGFIX] API v1: Decode matchers without isEqual are positive matchers. #2603
## 0.22.0 / 2021-05-21
* [CHANGE] Amtool and Alertmanager binaries help now prints to stdout. #2505
* [CHANGE] Use path relative to the configuration file for certificates and password files. #2502
* [CHANGE] Display Silence and Alert dates in ISO8601 format. #2363
* [FEATURE] Add date picker to silence form views. #2262
* [FEATURE] Add support for negative matchers. #2434 #2460 and many more.
* [FEATURE] Add time-based muting to routing tree. #2393
* [FEATURE] Support TLS and basic authentication on the web server. #2446
* [FEATURE] Add OAuth 2.0 client support in HTTP client. #2560
* [ENHANCEMENT] Add composite durations in the configuration (e.g. 2h20m). #2353
* [ENHANCEMENT] Add follow_redirect option to disable following redirects. #2551
* [ENHANCEMENT] Add metric for permanently failed notifications. #2383
* [ENHANCEMENT] Add support for custom authorization scheme. #2499
* [ENHANCEMENT] Add support for not following HTTP redirects. #2499
* [ENHANCEMENT] Add support to set the Slack URL from a file. #2534
* [ENHANCEMENT] amtool: Add alert status to extended and simple output. #2324
* [ENHANCEMENT] Do not omit false booleans in the configuration page. #2317
* [ENHANCEMENT] OpsGenie: Propagate labels to Opsgenie details. #2276
* [ENHANCEMENT] PagerDuty: Filter out empty images and links. #2379
* [ENHANCEMENT] WeChat: add markdown support. #2309
* [BUGFIX] Fix a possible deadlock on shutdown. #2558
* [BUGFIX] UI: Fix extended printing of regex sign. #2445
* [BUGFIX] UI: Fix the favicon when using a path prefix. #2392
* [BUGFIX] Make filter labels consistent with Prometheus. #2403
* [BUGFIX] alertmanager_config_last_reload_successful takes templating failures into account. #2373
* [BUGFIX] amtool: avoid nil dereference in silence update. #2427
* [BUGFIX] VictorOps: Catch routing_key templating errors. #2467
## 0.21.0 / 2020-06-16
This release removes the HipChat integration as it is discontinued by Atlassian on June 30th 2020.
* [CHANGE] [HipChat] Remove HipChat integration as it is end-of-life. #2282
* [CHANGE] [amtool] Remove default assignment of environment variables. #2161
* [CHANGE] [PagerDuty] Enforce 512KB event size limit. #2225
* [ENHANCEMENT] [amtool] Add `cluster` command to show cluster and peer statuses. #2256
* [ENHANCEMENT] Add redirection from `/` to the routes prefix when it isn't empty. #2235
* [ENHANCEMENT] [Webhook] Add `max_alerts` option to limit the number of alerts included in the payload. #2274
* [ENHANCEMENT] Improve logs for API v2, notifications and clustering. #2177 #2188 #2260 #2261 #2273
* [BUGFIX] Fix child routes not inheriting their parent route's grouping when `group_by: [...]`. #2154
* [BUGFIX] [UI] Fix the receiver selector in the Alerts page when the receiver name contains regular expression metacharacters such as `+`. #2090
* [BUGFIX] Fix error message about start and end time validation. #2173
* [BUGFIX] Fix a potential race condition in dispatcher. #2208
* [BUGFIX] [API v2] Return an empty array of peers when the clustering is disabled. #2203
* [BUGFIX] Fix the registration of `alertmanager_dispatcher_aggregation_groups` and `alertmanager_dispatcher_alert_processing_duration_seconds` metrics. #2200
* [BUGFIX] Always retry notifications with back-off. #2290
## 0.20.0 / 2019-12-11
* [CHANGE] Check that at least one silence matcher matches a non-empty string. #2081
* [ENHANCEMENT] [pagerduty] Check that PagerDuty keys aren't empty. #2085
* [ENHANCEMENT] [template] Add the `stringSlice` function. #2101
* [ENHANCEMENT] Add `alertmanager_dispatcher_aggregation_groups` and `alertmanager_dispatcher_alert_processing_duration_seconds` metrics. #2113
* [ENHANCEMENT] Log unused receivers. #2114
* [ENHANCEMENT] Add `alertmanager_receivers` metric. #2114
* [ENHANCEMENT] Add `alertmanager_integrations` metric. #2117
* [ENHANCEMENT] [email] Add Message-Id Header to outgoing emails. #2057
* [BUGFIX] Don't garbage-collect alerts from the store. #2040
* [BUGFIX] [ui] Disable the grammarly plugin on all textareas. #2061
* [BUGFIX] [config] Forbid nil regexp matchers. #2083
* [BUGFIX] [ui] Fix Silences UI when several filters are applied. #2075
Contributors:
* @CharlesJUDITH
* @NotAFile
* @Pger-Y
* @TheMeier
* @johncming
* @n33pm
* @ntk148v
* @oddlittlebird
* @perlun
* @qoops-1
* @roidelapluie
* @simonpasquier
* @stephenreddek
* @sylr
* @vrischmann
## 0.19.0 / 2019-09-03
* [CHANGE] Reject invalid external URLs at startup. #1960
* [CHANGE] Add Fingerprint to template data. #1945
* [CHANGE] Check Smarthost validity at config loading. #1957
* [ENHANCEMENT] Improve error messages for email receiver. #1953
* [ENHANCEMENT] Log error messages from OpsGenie API. #1965
* [ENHANCEMENT] Add the ability to configure Slack markdown field. #1967
* [ENHANCEMENT] Log warning when repeat_interval > retention. #1993
* [ENHANCEMENT] Add `alertmanager_cluster_enabled` metric. #1973
* [ENHANCEMENT] [ui] Recreate silence with previous comment. #1927
* [BUGFIX] [ui] Fix /api/v2/alerts/groups endpoint with similar alert groups. #1964
* [BUGFIX] Allow slashes in receivers. #2011
* [BUGFIX] [ui] Fix expand/collapse button with identical alert groups. #2012
## 0.18.0 / 2019-07-08
* [CHANGE] Remove quantile labels from Summary metrics. #1921
* [CHANGE] [OpsGenie] Move from the deprecated `teams` field in the configuration to `responders`. #1863
* [CHANGE] [ui] Collapse alert groups on the initial view. #1876
* [CHANGE] [Wechat] Set the default API secret to blank. #1888
* [CHANGE/BUGFIX] [PagerDuty] Fix embedding of images, the `text` field in the configuration has been renamed to `href`. #1931
* [ENHANCEMENT] Use persistent HTTP clients. #1904
* [ENHANCEMENT] Add `alertmanager_cluster_alive_messages_total`, `alertmanager_cluster_peer_info` and `alertmanager_cluster_pings_seconds` metrics. #1941
* [ENHANCEMENT] [api] Add missing metrics for API v2. #1902
* [ENHANCEMENT] [Slack] Log error message on retry errors. #1655
* [ENHANCEMENT] [ui] Allow to create silences from the alerts filter bar. #1911
* [ENHANCEMENT] [ui] Enable auto resize the textarea fields. #1893
* [BUGFIX] [amtool] Use scheme, authentication and base path from the URL if present. #1892 #1940
* [BUGFIX] [amtool] Support filtering alerts by receiver. #1915
* [BUGFIX] [api] Fix /api/v2/alerts with multiple receivers. #1948
* [BUGFIX] [PagerDuty] Truncate description to 1024 chars for PagerDuty v1. #1922
* [BUGFIX] [ui] Add filtering based off of "active" query param. #1879
## 0.17.0 / 2019-05-02
This release includes changes to amtool which are not fully backwards
compatible with the previous amtool version (#1798) related to backup and
import of silences. If a backup of silences is created using a previous
version of amtool (v0.16.1 or earlier), it is possible that not all silences
can be correctly imported using a later version of amtool.
Additionally, the groups endpoint that was dropped from api v1 has been added
to api v2. The default for viewing alerts in the UI now consumes from this
endpoint and displays alerts grouped according to the groups defined in the
running configuration. Custom grouping is still supported.
This release has added two new flags that may need to be tweaked. For people
running with a lot of concurrent requests, consider increasing the value of
`--web.get-concurrency`. An increase in 503 errors indicates that the request
rate is exceeding the number of currently available workers. The other new
flag, --web.timeout, limits the time a request is allowed to run. The default
behavior is to not use a timeout.
* [CHANGE] Modify the self-inhibition prevention semantics (#1873)
* [CHANGE] Make api/v2/status.cluster.{name,peers} properties optional for Alertmanager with disabled clustering (#1728)
* [FEATURE] Add groups endpoint to v2 api (#1791)
* [FEATURE] Optional timeout for HTTP requests (#1743)
* [ENHANCEMENT] Set HTTP headers to prevent asset caching (#1817)
* [ENHANCEMENT] API returns current silenced/inhibited state of alerts (#1733)
* [ENHANCEMENT] Configurable concurrency limit for GET requests (#1743)
* [ENHANCEMENT] Pushover notifier: support HTML, URL title and custom sounds (#1634)
* [ENHANCEMENT] Support adding custom fields to VictorOps notifications (#1420)
* [ENHANCEMENT] Migrate amtool CLI to API v2 (#1798)
* [ENHANCEMENT][ui] Default alert list view grouped by configured alert groups (#1864)
* [ENHANCEMENT][ui] Remove superfluous inhibited/silenced text, show inhibited status (#1698, #1862)
* [ENHANCEMENT][ui] Silence preview now shows already-muted alerts (#1776)
* [ENHANCEMENT][ui] Sort silences from api/v2 similarly to api/v1 (#1786)
* [BUGFIX] Trim PagerDuty message summary to 1024 chars (#1701)
* [BUGFIX] Add fix for race causing alerts to be dropped (#1843)
* [BUGFIX][ui] Correctly construct filter query string for api (#1869)
* [BUGFIX][ui] Do not display GroupByAll and GroupBy in marshaled config (#1665)
* [BUGFIX][ui] Respect regex setting when creating silences (#1697)
## 0.16.2 / 2019-04-03
Updating to v0.16.2 is recommended for all users using the Slack, Pagerduty,
Hipchat, Wechat, VictorOps and Pushover notifier, as connection errors could
leak secrets embedded in the notifier's URL to stdout.
* [BUGFIX] Redact notifier URL from logs to not leak secrets embedded in the URL (#1822, #1825)
* [BUGFIX] Allow sending of unauthenticated SMTP requests when `smtp_auth_username` is not supplied (#1739)
## 0.16.1 / 2019-01-31
* [BUGFIX] Do not populate cluster info if clustering is disabled in API v2 (#1726)
## 0.16.0 / 2019-01-17
This release introduces a new API v2, fully generated via the OpenAPI project
[1]. At the same time with this release the previous API v1 is being
deprecated. API v1 will be removed with Alertmanager release v0.18.0.
* [CHANGE] Deprecate API v1
* [CHANGE] Remove `api/v1/alerts/groups` GET endpoint (#1508 & #1525)
* [CHANGE] Revert Alertmanager working directory changes in Docker image back to `/alertmanager` (#1435)
* [CHANGE] Using the recommended label syntax for maintainer in Dockerfile (#1533)
* [CHANGE] Change `alertmanager_notifications_total` to count attempted notifications, not only successful ones (#1578)
* [CHANGE] Run as nobody inside container (#1586)
* [CHANGE] Support `w` for weeks when creating silences, remove `y` for year (#1620)
* [FEATURE] Introduce OpenAPI generated API v2 (#1352)
* [FEATURE] Lookup parts in strings using regexp.MatchString in templates (#1452)
* [FEATURE] Support image/thumb url in attachment in Slack notifier (#1506)
* [FEATURE] Support custom TLS certificates for the email notifier (#1528)
* [FEATURE] Add support for images and links in the PagerDuty notification config (#1559)
* [FEATURE] Add support for grouping by all labels (#1588)
* [FEATURE] [amtool] Add timeout support to amtool commands (#1471)
* [FEATURE] [amtool] Added `config routes` tools for visualization and testing routes (#1511)
* [FEATURE] [amtool] Support adding alerts using amtool (#1461)
* [ENHANCEMENT] Add support for --log.format (#1658)
* [ENHANCEMENT] Add CORS support to API v2 (#1667)
* [ENHANCEMENT] Support HTML, URL title and custom sounds for Pushover (#1634)
* [ENHANCEMENT] Update Alert compact view (#1698)
* [ENHANCEMENT] Support adding custom fields to VictorOps notifications (#1420)
* [ENHANCEMENT] Add help link in UI to Alertmanager documentation (#1522)
* [ENHANCEMENT] Enforce HTTP or HTTPS URLs in Alertmanager config (#1567)
* [ENHANCEMENT] Make OpsGenie API Key a templated string (#1594)
* [ENHANCEMENT] Add name, value and SlackConfirmationField to action in Slack notifier (#1557)
* [ENHANCEMENT] Show more alert information on silence form and silence view pages (#1601)
* [ENHANCEMENT] Add cluster peers DNS refresh job (#1428)
* [BUGFIX] Fix unmarshaling of secret URLs in config (#1663)
* [BUGFIX] Do not write groupbyall and groupby when marshaling config (#1665)
* [BUGFIX] Make a copy of firing alerts with EndsAt=0 when flushing (#1686)
* [BUGFIX] Respect regex matchers when recreating silences in UI (#1697)
* [BUGFIX] Change DefaultGlobalConfig to a function in Alertmanager configuration (#1656)
* [BUGFIX] Fix email template typo in alert-warning style (#1421)
* [BUGFIX] Fix silence redirect on silence creation UI page (#1548)
* [BUGFIX] Add missing `callback_id` parameter in Slack notifier (#1592)
* [BUGFIX] Throw error if no auth mechanism matches in email notifier (#1608)
* [BUGFIX] Use quoted-printable transfer encoding for the email notifier (#1609)
* [BUGFIX] Do not merge expired gossip messages (#1631)
* [BUGFIX] Fix "PLAIN" auth during notification via smtp-over-tls on port 465 (#1591)
* [BUGFIX] [amtool] Support for assuming first label is alertname in silence add and query (#1693)
* [BUGFIX] [amtool] Support assuming first label is alertname in alert query with matchers (#1575)
* [BUGFIX] [amtool] Fix config path check in amtool (#1538)
* [BUGFIX] [amtool] Fix rfc3339 example texts (#1526)
* [BUGFIX] [amtool] Fixed issue with loading path of a default configs (#1529)
[1] https://github.com/prometheus/alertmanager#api
## 0.15.3 / 2018-11-09
* [BUGFIX] Fix alert merging supporting both empty and set EndsAt property for firing alerts send by Prometheus (#1611)
## 0.15.2 / 2018-08-14
* [ENHANCEMENT] [amtool] Add support for stdin to check-config (#1431)
* [ENHANCEMENT] Log PagerDuty v1 response on BadRequest (#1481)
* [BUGFIX] Correctly encode query strings in notifiers (#1516)
* [BUGFIX] Add cache control headers to the API responses to avoid IE caching (#1500)
* [BUGFIX] Avoid listener blocking on unsubscribe (#1482)
* [BUGFIX] Fix a bunch of unhandled errors (#1501)
* [BUGFIX] Update PagerDuty API V2 to send full details on resolve (#1483)
* [BUGFIX] Validate URLs at config load time (#1468)
* [BUGFIX] Fix Settle() interval (#1478)
* [BUGFIX] Fix email to be green if only none firing (#1475)
* [BUGFIX] Handle errors in notify (#1474)
* [BUGFIX] Fix templating of hipchat room id (#1463)
## 0.15.1 / 2018-07-10
* [BUGFIX] Fix email template typo in alert-warning style (#1421)
* [BUGFIX] Fix regression in Pager Duty config (#1455)
* [BUGFIX] Catch templating errors in Wechat Notify (#1436)
* [BUGFIX] Fail when no private address can be found for cluster (#1437)
* [BUGFIX] Make sure we don't miss the first pushPull when joining cluster (#1456)
* [BUGFIX] Fix concurrent read and write group error in dispatch (#1447)
## 0.15.0 / 2018-06-22
* [CHANGE] [amtool] Update silence add and update flags (#1298)
* [CHANGE] Replace deprecated InstrumentHandler() (#1302)
* [CHANGE] Validate Slack field config and only allow the necessary input (#1334)
* [CHANGE] Remove legacy alert ingest endpoint (#1362)
* [CHANGE] Move to memberlist as underlying gossip protocol including cluster flag changes from --mesh.xxx to --cluster.xxx (#1232)
* [CHANGE] Move Alertmanager working directory in Docker image to /etc/alertmanager (#1313)
* [BUGFIX/CHANGE] The default group by is no labels. (#1287)
* [FEATURE] [amtool] Filter alerts by receiver (#1402)
* [FEATURE] Wait for mesh to settle before sending alerts (#1209)
* [FEATURE] [amtool] Support basic auth in alertmanager url (#1279)
* [FEATURE] Make HTTP clients used for integrations configurable
* [ENHANCEMENT] Support receiving alerts with end time and zero start time
* [ENHANCEMENT] Sort dispatched alerts by job+instance (#1234)
* [ENHANCEMENT] Support alert query filters `active` and `unprocessed` (#1366)
* [ENHANCEMENT] [amtool] Expose alert query flags --active and --unprocessed (#1370)
* [ENHANCEMENT] Add Slack actions to notifications (#1355)
* [BUGFIX] Register nflog snapShotSize metric
* [BUGFIX] Sort alerts in correct order before flushing to notifiers (#1349)
* [BUGFIX] Don't reset initial wait timer if flush is in-progress (#1301)
* [BUGFIX] Fix resolved alerts still inhibiting (#1331)
* [BUGFIX] Template wechat config fields (#1356)
* [BUGFIX] Notify resolved alerts properly (#1408)
* [BUGFIX] Fix parsing for label values with commas (#1395)
* [BUGFIX] Hide sensitive Wechat configuration (#1253)
* [BUGFIX] Prepopulate matchers when recreating a silence (#1270)
* [BUGFIX] Fix wechat panic (#1293)
* [BUGFIX] Allow empty matchers in silences/filtering (#1289)
* [BUGFIX] Properly configure HTTP client for Wechat integration
## 0.14.0 / 2018-02-12
* [ENHANCEMENT] [amtool] Silence update support dwy suffixes to expire flag (#1197)
* [ENHANCEMENT] Allow templating PagerDuty receiver severity (#1214)
* [ENHANCEMENT] Include receiver name in failed notifications log messages (#1207)
* [ENHANCEMENT] Allow global opsgenie api key (#1208)
* [ENHANCEMENT] Add mesh metrics (#1225)
* [ENHANCEMENT] Add Class field to PagerDuty; add templating to PagerDuty-CEF fields (#1231)
* [BUGFIX] Don't notify of resolved alerts if none were reported firing (#1198)
* [BUGFIX] Notify only when new firing alerts are added (#1205)
* [BUGFIX] [mesh] Fix pending connections never set to established (#1204)
* [BUGFIX] Allow OpsGenie notifier to have empty team fields (#1224)
* [BUGFIX] Don't count alerts with EndTime in the future as resolved (#1233)
* [BUGFIX] Speed up re-rendering of Silence UI (#1235)
* [BUGFIX] Forbid 0 value for group_interval and repeat_interval (#1230)
* [BUGFIX] Fix WeChat agentid issue (#1229)
## 0.13.0 / 2018-01-12
* [CHANGE] Switch cmd/alertmanager to kingpin (#974)
* [CHANGE] [amtool] Switch amtool to kingpin (#976)
* [CHANGE] [amtool] silence query: --expired flag only shows expired silences (#1190)
* [CHANGE] Return config reload result from reload endpoint (#1180)
* [FEATURE] UI silence form is populated from location bar (#1148)
* [FEATURE] Add /-/healthy endpoint (#1159)
* [ENHANCEMENT] Instrument and log snapshot sizes on maintenance (#1155)
* [ENHANCEMENT] Make alertGC interval configurable (#1151)
* [ENHANCEMENT] Display mesh connections in the Status page (#1164)
* [BUGFIX] Template service keys for pagerduty notifier (#1182)
* [BUGFIX] Fix expire buttons on the silences page (#1171)
* [BUGFIX] Fix JavaScript error in MSIE due to endswith() usage (#1172)
* [BUGFIX] Correctly format UI error output (#1167)
## 0.12.0 / 2017-12-15
* [FEATURE] package amtool in docker container (#1127)
* [FEATURE] Add notify support for Chinese User wechat (#1059)
* [FEATURE] [amtool] Add a new `silence import` command (#1082)
* [FEATURE] [amtool] Add new command to update silence (#1123)
* [FEATURE] [amtool] Add ability to query for silences that will expire soon (#1120)
* [ENHANCEMENT] Template source field in PagerDuty alert payload (#1117)
* [ENHANCEMENT] Add footer field for slack messages (#1141)
* [ENHANCEMENT] Add Slack additional "fields" to notifications (#1135)
* [ENHANCEMENT] Adding check for webhook's URL formatting (#1129)
* [ENHANCEMENT] Let the browser remember the creator of a silence (#1112)
* [BUGFIX] Fix race in stopping inhibitor (#1118)
* [BUGFIX] Fix browser UI when entering negative duration (#1132)
## 0.11.0 / 2017-11-16
* [CHANGE] Make silence negative filtering consistent with alert filtering (#1095)
* [CHANGE] Change HipChat and OpsGenie api config names (#1087)
* [ENHANCEMENT] amtool: Allow 'd', 'w', 'y' time suffixes when creating silence (#1091)
* [ENHANCEMENT] Support OpsGenie Priority field (#1094)
* [BUGFIX] Fix UI when no silences are present (#1090)
* [BUGFIX] Fix OpsGenie Teams field (#1101)
* [BUGFIX] Fix OpsGenie Tags field (#1108)
## 0.10.0 / 2017-11-09
* [CHANGE] Prevent inhibiting alerts in the source of the inhibition (#1017)
* [ENHANCEMENT] Improve amtool check-config use and description text (#1016)
* [ENHANCEMENT] Add metrics about current silences and alerts (#998)
* [ENHANCEMENT] Sorted silences based on current status (#1015)
* [ENHANCEMENT] Add metric of alertmanager position in mesh (#1024)
* [ENHANCEMENT] Initialise notifications_total and notifications_failed_total (#1011)
* [ENHANCEMENT] Allow selectable matchers on silence view (#1030)
* [ENHANCEMENT] Allow template in victorops message_type field (#1038)
* [ENHANCEMENT] Optionally hide inhibited alerts in API response (#1039)
* [ENHANCEMENT] Toggle silenced and inhibited alerts in UI (#1049)
* [ENHANCEMENT] Fix pushover limits (title, message, url) (#1055)
* [ENHANCEMENT] Add limit to OpsGenie message (#1045)
* [ENHANCEMENT] Upgrade OpsGenie notifier to v2 API. (#1061)
* [ENHANCEMENT] Allow template in victorops routing_key field (#1083)
* [ENHANCEMENT] Add support for PagerDuty API v2 (#1054)
* [BUGFIX] Fix inhibit race (#1032)
* [BUGFIX] Fix segfault on amtool (#1031)
* [BUGFIX] Remove .WasInhibited and .WasSilenced fields of Alert type (#1026)
* [BUGFIX] nflog: Fix Log() crash when gossip is nil (#1064)
* [BUGFIX] Fix notifications for flapping alerts (#1071)
* [BUGFIX] Fix shutdown crash with nil mesh router (#1077)
* [BUGFIX] Fix negative matchers filtering (#1077)
## 0.9.1 / 2017-09-29
* [BUGFIX] Fix -web.external-url regression in ui (#1008)
* [BUGFIX] Fix multipart email implementation (#1009)
## 0.9.0 / 2017-09-28
* [ENHANCEMENT] Add current time to webhook message (#909)
* [ENHANCEMENT] Add link_names to slack notifier (#912)
* [ENHANCEMENT] Make ui labels selectable/highlightable (#932)
* [ENHANCEMENT] Make links in ui annotations selectable (#946)
* [ENHANCEMENT] Expose the alert's "fingerprint" (unique identifier) through API (#786)
* [ENHANCEMENT] Add README information for amtool (#939)
* [ENHANCEMENT] Use user-set logging option consistently throughout alertmanager (#968)
* [ENHANCEMENT] Sort alerts returned from API by their fingerprint (#969)
* [ENHANCEMENT] Add edit/delete silence buttons on silence page view (#970)
* [ENHANCEMENT] Add check-config subcommand to amtool (#978)
* [ENHANCEMENT] Add email notification text content support (#934)
* [ENHANCEMENT] Support passing binary name to make build target (#990)
* [ENHANCEMENT] Show total no. of silenced alerts in preview (#994)
* [ENHANCEMENT] Added confirmation dialog when expiring silences (#993)
* [BUGFIX] Fix crash when no mesh router is configured (#919)
* [BUGFIX] Render status page without mesh (#920)
* [BUGFIX] Exit amtool subcommands with non-zero error code (#938)
* [BUGFIX] Change mktemp invocation in makefile to work for macOS (#971)
* [BUGFIX] Add a mutex to silences.go:gossipData (#984)
* [BUGFIX] silences: avoid deadlock (#995)
* [BUGFIX] Ignore expired silences OnGossip (#999)
## 0.8.0 / 2017-07-20
* [FEATURE] Add ability to filter alerts by receiver in the UI (#890)
* [FEATURE] Add User-Agent for webhook requests (#893)
* [ENHANCEMENT] Add possibility to have a global victorops api_key (#897)
* [ENHANCEMENT] Add EntityDisplayName and improve StateMessage for Victorops
(#769)
* [ENHANCEMENT] Omit empty config fields and show regex upon re-marshaling to
elide secrets (#864)
* [ENHANCEMENT] Parse API error messages in UI (#866)
* [ENHANCEMENT] Enable sending mail via smtp port 465 (#704)
* [BUGFIX] Prevent duplicate notifications by sorting matchers (#882)
* [BUGFIX] Remove timeout for UI requests (#890)
* [BUGFIX] Update config file location of CLI in flag usage text (#895)
## 0.7.1 / 2017-06-09
* [BUGFIX] Fix filtering by label on Alert list and Silence list page
## 0.7.0 / 2017-06-08
* [CHANGE] Rewrite UI from scratch improving UX
* [CHANGE] Rename `config` to `configYAML` on `api/v1/status`
* [FEATURE] Add ability to update a silence on `api/v1/silences` POST endpoint (See #765)
* [FEATURE] Return alert status on `api/v1/alerts` GET endpoint
* [FEATURE] Serve silence state on `api/v1/silences` GET endpoint
* [FEATURE] Add ability to specify a route prefix
* [FEATURE] Add option to disable AM listening on mesh port
* [ENHANCEMENT] Add ability to specify `filter` string and `silenced` flag on `api/v1/alerts` GET endpoint
* [ENHANCEMENT] Update `cache-control` to prevent caching for web assets in general.
* [ENHANCEMENT] Serve web assets by alertmanager instead of external CDN (See #846)
* [ENHANCEMENT] Elide secrets in alertmanager config (See #840)
* [ENHANCEMENT] AMTool: Move config file to a more consistent location (See #843)
* [BUGFIX] Enable builds for Solaris/Illumos
* [BUGFIX] Load web assets based on url path (See #323)
## 0.6.2 / 2017-05-09
* [BUGFIX] Correctly link to silences from alert again
* [BUGFIX] Correctly hide silenced/show active alerts in UI again
* [BUGFIX] Fix regression of alerts not being displayed until first processing
* [BUGFIX] Fix internal usage of wrong lock for silence markers
* [BUGFIX] Adapt amtool's API parsing to recent API changes
* [BUGFIX] Correctly marshal regexes in config JSON response
* [CHANGE] Anchor silence regex matchers to be consistent with Prometheus
* [ENHANCEMENT] Error if root route is using `continue` keyword
## 0.6.1 / 2017-04-28
* [BUGFIX] Fix incorrectly serialized hash for notification providers.
* [ENHANCEMENT] Add processing status field to alerts.
* [FEATURE] Add config hash metric.
## 0.6.0 / 2017-04-25
* [BUGFIX] Add `groupKey` to `alerts/groups` endpoint https://github.com/prometheus/alertmanager/pull/576
* [BUGFIX] Only notify on firing alerts https://github.com/prometheus/alertmanager/pull/595
* [BUGFIX] Correctly marshal regex's in config for routing tree https://github.com/prometheus/alertmanager/pull/602
* [BUGFIX] Prevent panic when failing to load config https://github.com/prometheus/alertmanager/pull/607
* [BUGFIX] Prevent panic when alertmanager is started with an empty `-mesh.peer` https://github.com/prometheus/alertmanager/pull/726
* [CHANGE] Rename VictorOps config variables https://github.com/prometheus/alertmanager/pull/667
* [CHANGE] No longer generate releases for openbsd/arm https://github.com/prometheus/alertmanager/pull/732
* [ENHANCEMENT] Add `DELETE` as accepted CORS method https://github.com/prometheus/alertmanager/commit/0ecc59076ca6b4cbb63252fa7720a3d89d1c81d3
* [ENHANCEMENT] Switch to using `gogoproto` for protobuf https://github.com/prometheus/alertmanager/pull/715
* [ENHANCEMENT] Include notifier type in logs and errors https://github.com/prometheus/alertmanager/pull/702
* [FEATURE] Expose mesh peers on status page https://github.com/prometheus/alertmanager/pull/644
* [FEATURE] Add `reReplaceAll` template function https://github.com/prometheus/alertmanager/pull/639
* [FEATURE] Allow label-based filtering alerts/silences through API https://github.com/prometheus/alertmanager/pull/633
* [FEATURE] Add commandline tool for interacting with alertmanager https://github.com/prometheus/alertmanager/pull/636
## 0.5.1 / 2016-11-24
* [BUGFIX] Fix crash caused by race condition in silencing
* [ENHANCEMENT] Improve logging of API errors
* [ENHANCEMENT] Add metrics for the notification log
## 0.5.0 / 2016-11-01
This release requires a storage wipe. It contains fundamental internal
changes that came with implementing the high availability mode.
* [FEATURE] Alertmanager clustering for high availability
* [FEATURE] Garbage collection of old silences and notification logs
* [CHANGE] New storage format
* [CHANGE] Stricter silence semantics for consistent historical view
## 0.4.2 / 2016-09-02
* [BUGFIX] Fix broken regex checkbox in silence form
* [BUGFIX] Simplify inconsistent silence update behavior
## 0.4.1 / 2016-08-31
* [BUGFIX] Wait for silence query to finish instead of showing error
* [BUGFIX] Fix sorting of silences
* [BUGFIX] Provide visual feedback after creating a silence
* [BUGFIX] Fix styling of silences
* [ENHANCEMENT] Provide cleaner API silence interface
## 0.4.0 / 2016-08-23
* [FEATURE] Silences are now paginated in the web ui
* [CHANGE] Failure to start on unparsed flags
## 0.3.0 / 2016-07-07
* [CHANGE] Alerts are purely in memory and no longer persistent across restarts
* [FEATURE] Add SMTP LOGIN authentication mechanism
## 0.2.1 / 2016-06-23
* [ENHANCEMENT] Allow inheritance of route receiver
* [ENHANCEMENT] Add silence cache to silence provider
* [BUGFIX] Fix HipChat room number in integration URL
## 0.2.0 / 2016-06-17
This release uses a new storage backend based on BoltDB. You have to backup
and wipe your former storage path to run it.
* [CHANGE] Use BoltDB as data store.
* [CHANGE] Move SMTP authentication to configuration file
* [FEATURE] add /-/reload HTTP endpoint
* [FEATURE] Filter silenced alerts in web UI
* [ENHANCEMENT] reduce inhibition computation complexity
* [ENHANCEMENT] Add support for teams and tags in OpsGenie integration
* [BUGFIX] Handle OpsGenie responses correctly
* [BUGFIX] Fix Pushover queue length issue
* [BUGFIX] STARTTLS before querying auth mechanism in email integration
## 0.1.1 / 2016-03-15
* [BUGFIX] Fix global database lock issue
* [ENHANCEMENT] Improve SQLite alerts index
* [ENHANCEMENT] Enable debug endpoint
## 0.1.0 / 2016-02-23
This version is a full rewrite of the Alertmanager with a very different
feature set. Thus, there is no meaningful changelog.
Changes with respect to 0.1.0-beta2:
* [CHANGE] Expose same data structure to templates and webhook
* [ENHANCEMENT] Show generator URL in default templates and web UI
* [ENHANCEMENT] Support for Slack icon_emoji field
* [ENHANCEMENT] Expose incident key to templates and webhook data
* [ENHANCEMENT] Allow markdown in Slack 'text' field
* [BUGFIX] Fixed database locking issue
## 0.1.0-beta2 / 2016-02-03
* [BUGFIX] Properly set timeout for incoming alerts with fixed start time
* [ENHANCEMENT] Send source field in OpsGenie integration
* [ENHANCEMENT] Improved routing configuration validation
* [FEATURE] Basic instrumentation added
## 0.1.0-beta1 / 2016-01-08
* [BUGFIX] Send full alert group state on each update. Fixes erroneous resolved notifications.
* [FEATURE] HipChat integration
* [CHANGE] Slack integration no longer sends resolved notifications by default
## 0.1.0-beta0 / 2015-12-23
This version is a full rewrite of the Alertmanager with a very different
feature set. Thus, there is no meaningful changelog.
## 0.0.4 / 2015-09-09
* [BUGFIX] Fix version info string in startup message.
* [BUGFIX] Fix Pushover notifications by setting the right priority level, as
well as required retry and expiry intervals.
* [FEATURE] Make it possible to link to individual alerts in the UI.
* [FEATURE] Rearrange alert columns in UI and allow expanding more alert details.
* [FEATURE] Add Amazon SNS notifications.
* [FEATURE] Add OpsGenie Webhook notifications.
* [FEATURE] Add `-web.external-url` flag to control the externally visible
Alertmanager URL.
* [FEATURE] Add runbook and alertmanager URLs to PagerDuty and email notifications.
* [FEATURE] Add a GET API to /api/alerts which pulls JSON formatted
AlertAggregates.
* [ENHANCEMENT] Sort alerts consistently in web UI.
* [ENHANCEMENT] Suggest to use email address as silence creator.
* [ENHANCEMENT] Make Slack timeout configurable.
* [ENHANCEMENT] Add channel name to error logging about Slack notifications.
* [ENHANCEMENT] Refactoring and tests for Flowdock notifications.
* [ENHANCEMENT] New Dockerfile using alpine-golang-make-onbuild base image.
* [CLEANUP] Add Docker instructions and other cleanups in README.md.
* [CLEANUP] Update Makefile.COMMON from prometheus/utils.
## 0.0.3 / 2015-06-10
* [BUGFIX] Fix email template body writer being called with parameters in wrong order.
## 0.0.2 / 2015-06-09
* [BUGFIX] Fixed silences.json permissions in Docker image.
* [CHANGE] Changed case of API JSON properties to initial lower letter.
* [CHANGE] Migrated logging to use http://github.com/prometheus/log.
* [FEATURE] Flowdock notification support.
* [FEATURE] Slack notification support.
* [FEATURE] Generic webhook notification support.
* [FEATURE] Support for "@"-mentions in HipChat notifications.
* [FEATURE] Path prefix option to support reverse proxies.
* [ENHANCEMENT] Improved web redirection and 404 behavior.
* [CLEANUP] Updated compiled web assets from source.
* [CLEANUP] Updated fsnotify package to its new source location.
* [CLEANUP] Updates to README.md and AUTHORS.md.
* [CLEANUP] Various smaller cleanups and improvements.
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Prometheus Community Code of Conduct
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
================================================
FILE: COPYRIGHT.txt
================================================
Copyright Prometheus Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: Dockerfile
================================================
ARG ARCH="amd64"
ARG OS="linux"
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest
LABEL maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>"
LABEL org.opencontainers.image.source="https://github.com/prometheus/alertmanager"
ARG ARCH="amd64"
ARG OS="linux"
COPY .build/${OS}-${ARCH}/amtool /bin/amtool
COPY .build/${OS}-${ARCH}/alertmanager /bin/alertmanager
COPY examples/ha/alertmanager.yml /etc/alertmanager/alertmanager.yml
RUN mkdir -p /alertmanager && \
chown -R nobody:nobody /etc/alertmanager /alertmanager && \
chmod -R g+w /alertmanager
USER nobody
EXPOSE 9093
VOLUME [ "/alertmanager" ]
WORKDIR /alertmanager
ENTRYPOINT [ "/bin/alertmanager" ]
CMD [ "--config.file=/etc/alertmanager/alertmanager.yml", \
"--storage.path=/alertmanager" ]
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: MAINTAINERS.md
================================================
* Simon Pasquier <pasquier.simon@gmail.com> @simonpasquier
* Andrey Kuzmin <unsoundscapes@gmail.com> @w0rm
* Josue Abreu <josue.abreu@gmail.com> @gotjosh
* George Robinson <george.robinson@grafana.com> @grobinson-grafana
* Solomon Jacobs <solomonjacobs@protonmail.com> @SoloJacobs
* Ethan Hunter <fc.spaceman@gmail.com> @Spaceman1701
* Guido Trotter <ultrotter@gmail.com> @ultrotter
* Siavash Safi <siavash@cloudflare.com> @siavashs
================================================
FILE: Makefile
================================================
# Copyright 2015 The Prometheus Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Needs to be defined before including Makefile.common to auto-generate targets
DOCKER_ARCHS ?= amd64 armv7 arm64 ppc64le s390x
include Makefile.common
FRONTEND_DIR = $(BIN_DIR)/ui/app
TEMPLATE_DIR = $(BIN_DIR)/template
DOCKER_IMAGE_NAME ?= alertmanager
STATICCHECK_IGNORE =
.PHONY: build-all
# Will build both the front-end as well as the back-end
build-all: assets apiv2 build
.PHONY: build
build: common-build
.PHONY: lint
lint: common-lint
.PHONY: assets
assets: ui/app/script.js template/email.tmpl
ui/app/script.js: $(shell find ui/app/src -iname *.elm) api/v2/openapi.yaml
cd $(FRONTEND_DIR) && $(MAKE) script.js
template/email.tmpl: template/email.html
cd $(TEMPLATE_DIR) && $(MAKE) email.tmpl
.PHONY: apiv2
apiv2: api/v2/models api/v2/restapi api/v2/client
api/v2/models api/v2/restapi api/v2/client: api/v2/openapi.yaml
scripts/swagger.sh
.PHONY: fuzz-config
fuzz-config:
go test -fuzz=^Fuzz -fuzztime=5s ./config
.PHONY: clean
clean:
- @rm -rf template/email.tmpl \
api/v2/models api/v2/restapi api/v2/client
- @cd $(FRONTEND_DIR) && $(MAKE) clean
================================================
FILE: Makefile.common
================================================
# Copyright The Prometheus Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# A common Makefile that includes rules to be reused in different prometheus projects.
# !!! Open PRs only against the prometheus/prometheus/Makefile.common repository!
# Example usage :
# Create the main Makefile in the root project directory.
# include Makefile.common
# customTarget:
# @echo ">> Running customTarget"
#
# Ensure GOBIN is not set during build so that promu is installed to the correct path
unexport GOBIN
GO ?= go
GOFMT ?= $(GO)fmt
FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
GOOPTS ?=
GOHOSTOS ?= $(shell $(GO) env GOHOSTOS)
GOHOSTARCH ?= $(shell $(GO) env GOHOSTARCH)
GO_VERSION ?= $(shell $(GO) version)
GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION))
PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.')
PROMU := $(FIRST_GOPATH)/bin/promu
pkgs = ./...
ifeq (arm, $(GOHOSTARCH))
GOHOSTARM ?= $(shell GOARM= $(GO) env GOARM)
GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH)v$(GOHOSTARM)
else
GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH)
endif
GOTEST := $(GO) test
GOTEST_DIR :=
ifneq ($(CIRCLE_JOB),)
ifneq ($(shell command -v gotestsum 2> /dev/null),)
GOTEST_DIR := test-results
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
endif
endif
PROMU_VERSION ?= 0.18.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v2.10.1
GOLANGCI_FMT_OPTS ?=
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64))
# If we're in CI and there is an Actions file, that means the linter
# is being run in Actions, so we don't need to run it here.
ifneq (,$(SKIP_GOLANGCI_LINT))
GOLANGCI_LINT :=
else ifeq (,$(CIRCLE_JOB))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
endif
endif
endif
PREFIX ?= $(shell pwd)
BIN_DIR ?= $(shell pwd)
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
DOCKERBUILD_CONTEXT ?= ./
DOCKER_REPO ?= prom
# Check if deprecated DOCKERFILE_PATH is set
ifdef DOCKERFILE_PATH
$(error DOCKERFILE_PATH is deprecated. Use DOCKERFILE_VARIANTS ?= $(DOCKERFILE_PATH) in the Makefile)
endif
DOCKER_ARCHS ?= amd64
DOCKERFILE_VARIANTS ?= Dockerfile $(wildcard Dockerfile.*)
# Function to extract variant from Dockerfile label.
# Returns the variant name from io.prometheus.image.variant label, or "default" if not found.
define dockerfile_variant
$(strip $(or $(shell sed -n 's/.*io\.prometheus\.image\.variant="\([^"]*\)".*/\1/p' $(1)),default))
endef
# Check for duplicate variant names (including default for Dockerfiles without labels).
DOCKERFILE_VARIANT_NAMES := $(foreach df,$(DOCKERFILE_VARIANTS),$(call dockerfile_variant,$(df)))
DOCKERFILE_VARIANT_NAMES_SORTED := $(sort $(DOCKERFILE_VARIANT_NAMES))
ifneq ($(words $(DOCKERFILE_VARIANT_NAMES)),$(words $(DOCKERFILE_VARIANT_NAMES_SORTED)))
$(error Duplicate variant names found. Each Dockerfile must have a unique io.prometheus.image.variant label, and only one can be without a label (default))
endif
# Build variant:dockerfile pairs for shell iteration.
DOCKERFILE_VARIANTS_WITH_NAMES := $(foreach df,$(DOCKERFILE_VARIANTS),$(call dockerfile_variant,$(df)):$(df))
# Shell helper to check whether a dockerfile/arch pair is excluded.
define dockerfile_arch_is_excluded
case " $(DOCKERFILE_ARCH_EXCLUSIONS) " in \
*" $$dockerfile:$(1) "*) true ;; \
*) false ;; \
esac
endef
# Shell helper to check whether a registry/arch pair is excluded.
# Extracts registry from DOCKER_REPO (e.g., quay.io/prometheus -> quay.io)
define registry_arch_is_excluded
registry=$$(echo "$(DOCKER_REPO)" | cut -d'/' -f1); \
case " $(DOCKER_REGISTRY_ARCH_EXCLUSIONS) " in \
*" $$registry:$(1) "*) true ;; \
*) false ;; \
esac
endef
BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS))
PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS))
TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS))
SANITIZED_DOCKER_IMAGE_TAG := $(subst +,-,$(DOCKER_IMAGE_TAG))
ifeq ($(GOHOSTARCH),amd64)
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows))
# Only supported on amd64
test-flags := -race
endif
endif
# This rule is used to forward a target like "build" to "common-build". This
# allows a new "build" target to be defined in a Makefile which includes this
# one and override "common-build" without override warnings.
%: common-% ;
.PHONY: common-all
common-all: precheck style check_license lint yamllint unused build test
.PHONY: common-style
common-style:
@echo ">> checking code style"
@fmtRes=$$($(GOFMT) -d $$(git ls-files '*.go' ':!:vendor/*' || find . -path ./vendor -prune -o -name '*.go' -print)); \
if [ -n "$${fmtRes}" ]; then \
echo "gofmt checking failed!"; echo "$${fmtRes}"; echo; \
echo "Please ensure you are using $$($(GO) version) for formatting code."; \
exit 1; \
fi
.PHONY: common-check_license
common-check_license:
@echo ">> checking license header"
@licRes=$$(for file in $$(git ls-files '*.go' ':!:vendor/*' || find . -path ./vendor -prune -o -type f -iname '*.go' -print) ; do \
awk 'NR<=3' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
echo "license header checking failed:"; echo "$${licRes}"; \
exit 1; \
fi
@echo ">> checking for copyright years 2026 or later"
@futureYearRes=$$(git grep -E 'Copyright (202[6-9]|20[3-9][0-9])' -- '*.go' ':!:vendor/*' || true); \
if [ -n "$${futureYearRes}" ]; then \
echo "Files with copyright year 2026 or later found (should use 'Copyright The Prometheus Authors'):"; echo "$${futureYearRes}"; \
exit 1; \
fi
.PHONY: common-deps
common-deps:
@echo ">> getting dependencies"
$(GO) mod download
.PHONY: update-go-deps
update-go-deps:
@echo ">> updating Go dependencies"
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
$(GO) get $$m; \
done
$(GO) mod tidy
.PHONY: common-test-short
common-test-short: $(GOTEST_DIR)
@echo ">> running short tests"
$(GOTEST) -short $(GOOPTS) $(pkgs)
.PHONY: common-test
common-test: $(GOTEST_DIR)
@echo ">> running all tests"
$(GOTEST) $(test-flags) $(GOOPTS) $(pkgs)
$(GOTEST_DIR):
@mkdir -p $@
.PHONY: common-format
common-format: $(GOLANGCI_LINT)
@echo ">> formatting code"
$(GO) fmt $(pkgs)
ifdef GOLANGCI_LINT
@echo ">> formatting code with golangci-lint"
$(GOLANGCI_LINT) fmt $(GOLANGCI_FMT_OPTS)
endif
.PHONY: common-vet
common-vet:
@echo ">> vetting code"
$(GO) vet $(GOOPTS) $(pkgs)
.PHONY: common-lint
common-lint: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint"
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
endif
.PHONY: common-lint-fix
common-lint-fix: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint fix"
$(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs)
endif
.PHONY: common-yamllint
common-yamllint:
@echo ">> running yamllint on all YAML files in the repository"
ifeq (, $(shell command -v yamllint 2> /dev/null))
@echo "yamllint not installed so skipping"
else
yamllint .
endif
# For backward-compatibility.
.PHONY: common-staticcheck
common-staticcheck: lint
.PHONY: common-unused
common-unused:
@echo ">> running check for unused/missing packages in go.mod"
$(GO) mod tidy
@git diff --exit-code -- go.sum go.mod
.PHONY: common-build
common-build: promu
@echo ">> building binaries"
$(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES)
.PHONY: common-tarball
common-tarball: promu
@echo ">> building release tarball"
$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
.PHONY: common-docker-repo-name
common-docker-repo-name:
@echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)"
.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
common-docker: $(BUILD_DOCKER_ARCHS)
$(BUILD_DOCKER_ARCHS): common-docker-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
if $(call dockerfile_arch_is_excluded,$*); then \
echo "Skipping $$variant_name variant for linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
distroless_arch="$*"; \
if [ "$*" = "armv7" ]; then \
distroless_arch="arm"; \
fi; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Building default variant ($$variant_name) for linux-$* using $$dockerfile"; \
docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \
-f $$dockerfile \
--build-arg ARCH="$*" \
--build-arg OS="linux" \
--build-arg DISTROLESS_ARCH="$$distroless_arch" \
$(DOCKERBUILD_CONTEXT); \
if [ "$$variant_name" != "default" ]; then \
echo "Tagging default variant with $$variant_name suffix"; \
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \
"$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \
fi; \
else \
echo "Building $$variant_name variant for linux-$* using $$dockerfile"; \
docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" \
-f $$dockerfile \
--build-arg ARCH="$*" \
--build-arg OS="linux" \
--build-arg DISTROLESS_ARCH="$$distroless_arch" \
$(DOCKERBUILD_CONTEXT); \
fi; \
done
.PHONY: common-docker-publish $(PUBLISH_DOCKER_ARCHS)
common-docker-publish: $(PUBLISH_DOCKER_ARCHS)
$(PUBLISH_DOCKER_ARCHS): common-docker-publish-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
if $(call dockerfile_arch_is_excluded,$*); then \
echo "Skipping push for $$variant_name variant on linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if $(call registry_arch_is_excluded,$*); then \
echo "Skipping push for $$variant_name variant on linux-$* to $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Pushing $$variant_name variant for linux-$*"; \
docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \
fi; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Pushing default variant ($$variant_name) for linux-$*"; \
docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)"; \
fi; \
if [ "$(DOCKER_IMAGE_TAG)" = "latest" ]; then \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Pushing $$variant_name variant version tags for linux-$*"; \
docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \
fi; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Pushing default variant version tag for linux-$*"; \
docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)"; \
fi; \
fi; \
done
DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION)))
.PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS)
common-docker-tag-latest: $(TAG_DOCKER_ARCHS)
$(TAG_DOCKER_ARCHS): common-docker-tag-latest-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
if $(call dockerfile_arch_is_excluded,$*); then \
echo "Skipping tag for $$variant_name variant on linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if $(call registry_arch_is_excluded,$*); then \
echo "Skipping tag for $$variant_name variant on linux-$* for $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Tagging $$variant_name variant for linux-$* as latest"; \
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest-$$variant_name"; \
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \
fi; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Tagging default variant ($$variant_name) for linux-$* as latest"; \
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest"; \
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)"; \
fi; \
done
.PHONY: common-docker-manifest
common-docker-manifest:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Creating manifest for $$variant_name variant"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
if $(call dockerfile_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for $$variant_name (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if $(call registry_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for $$variant_name on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \
done; \
if [ -z "$$refs" ]; then \
echo "Skipping manifest for $$variant_name variant (no supported architectures)"; \
continue; \
fi; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" $$refs; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \
fi; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Creating default variant ($$variant_name) manifest"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
if $(call dockerfile_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for default variant (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if $(call registry_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for default variant on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:$(SANITIZED_DOCKER_IMAGE_TAG)"; \
done; \
if [ -z "$$refs" ]; then \
echo "Skipping default variant manifest (no supported architectures)"; \
continue; \
fi; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" $$refs; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)"; \
fi; \
if [ "$(DOCKER_IMAGE_TAG)" = "latest" ]; then \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Creating manifest for $$variant_name variant version tag"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
if $(call dockerfile_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for $$variant_name version tag (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if $(call registry_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for $$variant_name version tag on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \
done; \
if [ -z "$$refs" ]; then \
echo "Skipping version-tag manifest for $$variant_name variant (no supported architectures)"; \
continue; \
fi; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name" $$refs; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \
fi; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Creating default variant version tag manifest"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
if $(call dockerfile_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for default variant version tag (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
if $(call registry_arch_is_excluded,$$arch); then \
echo " Skipping $$arch for default variant version tag on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
continue; \
fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:v$(DOCKER_MAJOR_VERSION_TAG)"; \
done; \
if [ -z "$$refs" ]; then \
echo "Skipping default variant version-tag manifest (no supported architectures)"; \
continue; \
fi; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)" $$refs; \
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)"; \
fi; \
fi; \
done
.PHONY: promu
promu: $(PROMU)
$(PROMU):
$(eval PROMU_TMP := $(shell mktemp -d))
curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP)
mkdir -p $(FIRST_GOPATH)/bin
cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
rm -r $(PROMU_TMP)
.PHONY: common-proto
common-proto:
@echo ">> generating code from proto files"
@./scripts/genproto.sh
ifdef GOLANGCI_LINT
$(GOLANGCI_LINT):
mkdir -p $(FIRST_GOPATH)/bin
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_LINT_VERSION)/install.sh \
| sed -e '/install -d/d' \
| sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION)
endif
.PHONY: common-print-golangci-lint-version
common-print-golangci-lint-version:
@echo $(GOLANGCI_LINT_VERSION)
.PHONY: precheck
precheck::
define PRECHECK_COMMAND_template =
precheck:: $(1)_precheck
PRECHECK_COMMAND_$(1) ?= $(1) $$(strip $$(PRECHECK_OPTIONS_$(1)))
.PHONY: $(1)_precheck
$(1)_precheck:
@if ! $$(PRECHECK_COMMAND_$(1)) 1>/dev/null 2>&1; then \
echo "Execution of '$$(PRECHECK_COMMAND_$(1))' command failed. Is $(1) installed?"; \
exit 1; \
fi
endef
govulncheck: install-govulncheck
govulncheck ./...
install-govulncheck:
command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest
================================================
FILE: NOTICE
================================================
Prometheus Alertmanager
Copyright 2013-2015 The Prometheus Authors
This product includes software developed at
SoundCloud Ltd. (http://soundcloud.com/).
The following components are included in this product:
Bootstrap
http://getbootstrap.com
Copyright 2011-2014 Twitter, Inc.
Licensed under the MIT License
================================================
FILE: Procfile
================================================
a1: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a1 --web.listen-address=:9093 --cluster.listen-address=127.0.0.1:8001 --config.file=examples/ha/alertmanager.yml
a2: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a2 --web.listen-address=:9094 --cluster.listen-address=127.0.0.1:8002 --cluster.peer=127.0.0.1:8001 --config.file=examples/ha/alertmanager.yml
a3: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a3 --web.listen-address=:9095 --cluster.listen-address=127.0.0.1:8003 --cluster.peer=127.0.0.1:8001 --config.file=examples/ha/alertmanager.yml
wh: go run ./examples/webhook/echo.go
================================================
FILE: README.md
================================================
# Alertmanager [][circleci]
[][quay]
[][hub]
The Alertmanager handles alerts sent by client applications such as the Prometheus server. It takes care of deduplicating, grouping, and routing them to the correct [receiver integrations](https://prometheus.io/docs/alerting/latest/configuration/#receiver) such as email, PagerDuty, OpsGenie, or many other [mechanisms](https://prometheus.io/docs/operating/integrations/#alertmanager-webhook-receiver) thanks to the webhook receiver. It also takes care of silencing and inhibition of alerts.
* [Documentation](http://prometheus.io/docs/alerting/alertmanager/)
## Install
There are various ways of installing Alertmanager.
### Precompiled binaries
Precompiled binaries for released versions are available in the
[*download* section](https://prometheus.io/download/)
on [prometheus.io](https://prometheus.io). Using the latest production release binary
is the recommended way of installing Alertmanager.
### Docker images
Docker images are available on [Quay.io](https://quay.io/repository/prometheus/alertmanager) or [Docker Hub](https://hub.docker.com/r/prom/alertmanager/).
You can launch an Alertmanager container for trying it out with
$ docker run --name alertmanager -d -p 127.0.0.1:9093:9093 quay.io/prometheus/alertmanager
Alertmanager will now be reachable at http://localhost:9093/.
### Compiling the binary
You can either `go install` it:
```
$ go install github.com/prometheus/alertmanager/cmd/...@latest
# cd $GOPATH/src/github.com/prometheus/alertmanager
$ alertmanager --config.file=<your_file>
```
Or clone the repository and build manually:
```
$ mkdir -p $GOPATH/src/github.com/prometheus
$ cd $GOPATH/src/github.com/prometheus
$ git clone https://github.com/prometheus/alertmanager.git
$ cd alertmanager
$ make build
$ ./alertmanager --config.file=<your_file>
```
You can also build just one of the binaries in this repo by passing a name to the build function:
```
$ make build BINARIES=amtool
```
## Example
This is an example configuration that should cover most relevant aspects of the new YAML configuration format. The full documentation of the configuration can be found [here](https://prometheus.io/docs/alerting/configuration/).
```yaml
global:
# The smarthost and SMTP sender used for mail notifications.
smtp_smarthost: 'localhost:25'
smtp_from: 'alertmanager@example.org'
# The root route on which each incoming alert enters.
route:
# The root route must not have any matchers as it is the entry point for
# all alerts. It needs to have a receiver configured so alerts that do not
# match any of the sub-routes are sent to someone.
receiver: 'team-X-mails'
# The labels by which incoming alerts are grouped together. For example,
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would
# be batched into a single group.
#
# To aggregate by all possible labels use '...' as the sole label name.
# This effectively disables aggregation entirely, passing through all
# alerts as-is. This is unlikely to be what you want, unless you have
# a very low alert volume or your upstream notification system performs
# its own grouping. Example: group_by: [...]
group_by: ['alertname', 'cluster']
# When a new group of alerts is created by an incoming alert, wait at
# least 'group_wait' to send the initial notification.
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait: 30s
# When the first notification was sent, wait 'group_interval' to send a batch
# of new alerts that started firing for that group.
group_interval: 5m
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 3h
# All the above attributes are inherited by all child routes and can
# overwritten on each.
# The child route trees.
routes:
# This route performs a regular expression match on alert labels to
# catch alerts that are related to a list of services.
- matchers:
- service=~"^(foo1|foo2|baz)$"
receiver: team-X-mails
# The service has a sub-route for critical alerts, any alerts
# that do not match, i.e. severity != critical, fall-back to the
# parent node and are sent to 'team-X-mails'
routes:
- matchers:
- severity="critical"
receiver: team-X-pager
- matchers:
- service="files"
receiver: team-Y-mails
routes:
- matchers:
- severity="critical"
receiver: team-Y-pager
# This route handles all alerts coming from a database service. If there's
# no team to handle it, it defaults to the DB team.
- matchers:
- service="database"
receiver: team-DB-pager
# Also group alerts by affected database.
group_by: [alertname, cluster, database]
routes:
- matchers:
- owner="team-X"
receiver: team-X-pager
- matchers:
- owner="team-Y"
receiver: team-Y-pager
# Inhibition rules allow to mute a set of alerts given that another alert is
# firing.
# We use this to mute any warning-level notifications if the same alert is
# already critical.
inhibit_rules:
- source_matchers:
- severity="critical"
target_matchers:
- severity="warning"
# Apply inhibition if the alertname is the same.
# CAUTION:
# If all label names listed in `equal` are missing
# from both the source and target alerts,
# the inhibition rule will apply!
equal: ['alertname']
receivers:
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org, team-Y+alerts@example.org'
- name: 'team-X-pager'
email_configs:
- to: 'team-X+alerts-critical@example.org'
pagerduty_configs:
- routing_key: <team-X-key>
- name: 'team-Y-mails'
email_configs:
- to: 'team-Y+alerts@example.org'
- name: 'team-Y-pager'
pagerduty_configs:
- routing_key: <team-Y-key>
- name: 'team-DB-pager'
pagerduty_configs:
- routing_key: <team-DB-key>
```
## API
The current Alertmanager API is version 2. This API is fully generated via the
[OpenAPI project](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)
and [Go Swagger](https://github.com/go-swagger/go-swagger/) with the exception
of the HTTP handlers themselves. The API specification can be found in
[api/v2/openapi.yaml](api/v2/openapi.yaml). A HTML rendered version can be
accessed [here](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/prometheus/alertmanager/main/api/v2/openapi.yaml).
Clients can be easily generated via any OpenAPI generator for all major languages.
APIv2 is accessed via the `/api/v2` prefix. APIv1 was deprecated in `0.16.0` and is removed as of version `0.27.0`.
The v2 `/status` endpoint would be `/api/v2/status`. If `--web.route-prefix` is set then API routes are
prefixed with that as well, so `--web.route-prefix=/alertmanager/` would
relate to `/alertmanager/api/v2/status`.
## amtool
`amtool` is a cli tool for interacting with the Alertmanager API. It is bundled with all releases of Alertmanager.
### Install
Alternatively you can install with:
```
$ go install github.com/prometheus/alertmanager/cmd/amtool@latest
```
### Examples
View all currently firing alerts:
```
$ amtool alert
Alertname Starts At Summary
Test_Alert 2017-08-02 18:30:18 UTC This is a testing alert!
Test_Alert 2017-08-02 18:30:18 UTC This is a testing alert!
Check_Foo_Fails 2017-08-02 18:30:18 UTC This is a testing alert!
Check_Foo_Fails 2017-08-02 18:30:18 UTC This is a testing alert!
```
View all currently firing alerts with extended output:
```
$ amtool -o extended alert
Labels Annotations Starts At Ends At Generator URL
alertname="Test_Alert" instance="node0" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
alertname="Test_Alert" instance="node1" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
alertname="Check_Foo_Fails" instance="node0" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
alertname="Check_Foo_Fails" instance="node1" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
```
In addition to viewing alerts, you can use the rich query syntax provided by Alertmanager:
```
$ amtool -o extended alert query alertname="Test_Alert"
Labels Annotations Starts At Ends At Generator URL
alertname="Test_Alert" instance="node0" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
alertname="Test_Alert" instance="node1" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
$ amtool -o extended alert query instance=~".+1"
Labels Annotations Starts At Ends At Generator URL
alertname="Test_Alert" instance="node1" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
alertname="Check_Foo_Fails" instance="node1" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
$ amtool -o extended alert query alertname=~"Test.*" instance=~".+1"
Labels Annotations Starts At Ends At Generator URL
alertname="Test_Alert" instance="node1" link="https://example.com" summary="This is a testing alert!" 2017-08-02 18:31:24 UTC 0001-01-01 00:00:00 UTC http://my.testing.script.local
```
Silence an alert:
```
$ amtool silence add alertname=Test_Alert
b3ede22e-ca14-4aa0-932c-ca2f3445f926
$ amtool silence add alertname="Test_Alert" instance=~".+0"
e48cb58a-0b17-49ba-b734-3585139b1d25
```
View silences:
```
$ amtool silence query
ID Matchers Ends At Created By Comment
b3ede22e-ca14-4aa0-932c-ca2f3445f926 alertname=Test_Alert 2017-08-02 19:54:50 UTC kellel
$ amtool silence query instance=~".+0"
ID Matchers Ends At Created By Comment
e48cb58a-0b17-49ba-b734-3585139b1d25 alertname=Test_Alert instance=~.+0 2017-08-02 22:41:39 UTC kellel
```
Expire a silence:
```
$ amtool silence expire b3ede22e-ca14-4aa0-932c-ca2f3445f926
```
Expire all silences matching a query:
```
$ amtool silence query instance=~".+0"
ID Matchers Ends At Created By Comment
e48cb58a-0b17-49ba-b734-3585139b1d25 alertname=Test_Alert instance=~.+0 2017-08-02 22:41:39 UTC kellel
$ amtool silence expire $(amtool silence query -q instance=~".+0")
$ amtool silence query instance=~".+0"
```
Expire all silences:
```
$ amtool silence expire $(amtool silence query -q)
```
Try out how a template works. Let's say you have this in your configuration file:
```
templates:
- '/foo/bar/*.tmpl'
```
Then you can test out how a template would look like with example by using this command:
```
amtool template render --template.glob='/foo/bar/*.tmpl' --template.text='{{ template "slack.default.markdown.v1" . }}'
```
### Configuration
`amtool` allows a configuration file to specify some options for convenience. The default configuration file paths are `$HOME/.config/amtool/config.yml` or `/etc/amtool/config.yml`
An example configuration file might look like the following:
```
# Define the path that `amtool` can find your `alertmanager` instance
alertmanager.url: "http://localhost:9093"
# Override the default author. (unset defaults to your username)
author: me@example.com
# Force amtool to give you an error if you don't include a comment on a silence
comment_required: true
# Set a default output format. (unset defaults to simple)
output: extended
# Set a default receiver
receiver: team-X-pager
```
### Routes
`amtool` allows you to visualize the routes of your configuration in form of text tree view.
Also you can use it to test the routing by passing it label set of an alert
and it prints out all receivers the alert would match ordered and separated by `,`.
(If you use `--verify.receivers` amtool returns error code 1 on mismatch)
Example of usage:
```
# View routing tree of remote Alertmanager
$ amtool config routes --alertmanager.url=http://localhost:9090
# Test if alert matches expected receiver
$ amtool config routes test --config.file=doc/examples/simple.yml --tree --verify.receivers=team-X-pager service=database owner=team-X
```
## High Availability
Alertmanager's high availability is in production use at many companies and is enabled by default.
> Important: Both UDP and TCP are needed in alertmanager 0.15 and higher for the cluster to work.
> - If you are using a firewall, make sure to whitelist the clustering port for both protocols.
> - If you are running in a container, make sure to expose the clustering port for both protocols.
To create a highly available cluster of the Alertmanager the instances need to
be configured to communicate with each other. This is configured using the
`--cluster.*` flags.
- `--cluster.listen-address` string: cluster listen address (default "0.0.0.0:9094"; empty string disables HA mode)
- `--cluster.advertise-address` string: cluster advertise address
- `--cluster.peer` value: initial peers (repeat flag for each additional peer)
- `--cluster.peer-timeout` value: peer timeout period (default "15s")
- `--cluster.peers-resolve-timeout` value: peers resolve timeout period (default "15s")
- `--cluster.gossip-interval` value: cluster message propagation speed
(default "200ms")
- `--cluster.pushpull-interval` value: lower values will increase
convergence speeds at expense of bandwidth (default "1m0s")
- `--cluster.settle-timeout` value: maximum time to wait for cluster
connections to settle before evaluating notifications.
- `--cluster.tcp-timeout` value: timeout value for tcp connections, reads and writes (default "10s")
- `--cluster.probe-timeout` value: time to wait for ack before marking node unhealthy
(default "500ms")
- `--cluster.probe-interval` value: interval between random node probes (default "1s")
- `--cluster.reconnect-interval` value: interval between attempting to reconnect to lost peers (default "10s")
- `--cluster.reconnect-timeout` value: length of time to attempt to reconnect to a lost peer (default: "6h0m0s")
- `--cluster.label` value: the label is an optional string to include on each packet and stream. It uniquely identifies the cluster and prevents cross-communication issues when sending gossip messages (default:"")
The chosen port in the `cluster.listen-address` flag is the port that needs to be
specified in the `cluster.peer` flag of the other peers.
The `cluster.advertise-address` flag is required if the instance doesn't have
an IP address that is part of [RFC 6890](https://tools.ietf.org/html/rfc6890)
with a default route.
To start a cluster of three peers on your local machine use [`goreman`](https://github.com/mattn/goreman) and the
Procfile within this repository.
goreman start
To point your Prometheus 1.4, or later, instance to multiple Alertmanagers, configure them
in your `prometheus.yml` configuration file, for example:
```yaml
alerting:
alertmanagers:
- static_configs:
- targets:
- alertmanager1:9093
- alertmanager2:9093
- alertmanager3:9093
```
> Important: Do not load balance traffic between Prometheus and its Alertmanagers, but instead point Prometheus to a list of all Alertmanagers. The Alertmanager implementation expects all alerts to be sent to all Alertmanagers to ensure high availability.
### Turn off high availability
If running Alertmanager in high availability mode is not desired, setting `--cluster.listen-address=` prevents Alertmanager from listening to incoming peer requests.
## Contributing
Check the [Prometheus contributing page](https://github.com/prometheus/prometheus/blob/main/CONTRIBUTING.md).
To contribute to the user interface, refer to [ui/app/CONTRIBUTING.md](ui/app/CONTRIBUTING.md).
## Architecture

## License
Apache License 2.0, see [LICENSE](https://github.com/prometheus/alertmanager/blob/main/LICENSE).
[hub]: https://hub.docker.com/r/prom/alertmanager/
[circleci]: https://circleci.com/gh/prometheus/alertmanager
[quay]: https://quay.io/repository/prometheus/alertmanager
================================================
FILE: RELEASE.md
================================================
# Releases
This page describes the release process and the currently planned schedule for upcoming releases as well as the respective release shepherd. Release shepherds are chosen on a voluntary basis.
## Release Schedule
Release cadence of first pre-releases being cut is 12 weeks.
| release series | date (year-month-day) | release shepherd |
|----------------|-----------------------|-------------------------------------------|
| v0.26 | 2023-08-23 | Josh Abreu (Github: @gotjosh) |
| v0.27 | 2024-02-28 | Josh Abreu (Github: @gotjosh) |
| v0.28 | 2024-05-28 | Josh Abreu (Github: @gotjosh) |
| v0.29 | 2025-11-01 | Joe Adams (Github: @sysadmind) |
| v0.30 | 2025-12-12 | Solomon Jacobs (Github: @SoloJacobs) |
| v0.31 | 2026-01-31 | Solomon Jacobs (Github: @SoloJacobs) |
| v0.32 | 2026-04-06 | Anand Rajagopal (Github: @rajagopalanand) |
| v0.33 | 2026-06-06 | **volunteer welcome** |
If you are interested in volunteering please create a pull request against the [prometheus/alertmanager](https://github.com/prometheus/alertmanager) repository and propose yourself for the release of your choice.
If you'd like to know more about the shepherd responsibilities or the release instructions please [refer to the `RELEASE.MD`](https://github.com/prometheus/prometheus/blob/main/RELEASE.md) in [prometheus/prometheus](https://github.com/prometheus/prometheus).
================================================
FILE: SECURITY.md
================================================
# Reporting a security issue
The Prometheus security policy, including how to report vulnerabilities, can be
found here:
<https://prometheus.io/docs/operating/security/>
================================================
FILE: VERSION
================================================
0.31.1
================================================
FILE: alert/alert.go
================================================
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package alert
import (
"fmt"
"time"
"github.com/prometheus/common/model"
)
// Alert wraps a model.Alert with additional information relevant
// to internal of the Alertmanager.
// The type is never exposed to external communication and the
// embedded alert has to be sanitized beforehand.
type Alert struct {
model.Alert
// The authoritative timestamp.
UpdatedAt time.Time
Timeout bool
}
// Merge merges the timespan of two alerts based and overwrites annotations
// based on the authoritative timestamp. A new alert is returned, the labels
// are assumed to be equal.
func (a *Alert) Merge(o *Alert) *Alert {
// Let o always be the younger alert.
if o.UpdatedAt.Before(a.UpdatedAt) {
return o.Merge(a)
}
res := *o
// Always pick the earliest starting time.
if a.StartsAt.Before(o.StartsAt) {
res.StartsAt = a.StartsAt
}
if o.Resolved() {
// The latest explicit resolved timestamp wins if both alerts are effectively resolved.
if a.Resolved() && a.EndsAt.After(o.EndsAt) {
res.EndsAt = a.EndsAt
}
} else {
// A non-timeout timestamp always rules if it is the latest.
if a.EndsAt.After(o.EndsAt) && !a.Timeout {
res.EndsAt = a.EndsAt
}
}
return &res
}
// Validate overrides the same method in model.Alert to allow UTF-8 labels.
// This can be removed once prometheus/common has support for UTF-8.
func (a *Alert) Validate() error {
if a.StartsAt.IsZero() {
return fmt.Errorf("start time missing")
}
if !a.EndsAt.IsZero() && a.EndsAt.Before(a.StartsAt) {
return fmt.Errorf("start time must be before end time")
}
if len(a.Labels) == 0 {
return fmt.Errorf("at least one label pair required")
}
if err := validateLs(a.Labels); err != nil {
return fmt.Errorf("invalid label set: %w", err)
}
if err := validateLs(a.Annotations); err != nil {
return fmt.Errorf("invalid annotations: %w", err)
}
return nil
}
// AlertSlice is a sortable slice of Alerts.
type AlertSlice []*Alert
func (as AlertSlice) Less(i, j int) bool {
// Look at labels.job, then labels.instance.
for _, overrideKey := range [...]model.LabelName{"job", "instance"} {
iVal, iOk := as[i].Labels[overrideKey]
jVal, jOk := as[j].Labels[overrideKey]
if !iOk && !jOk {
continue
}
if !iOk {
return false
}
if !jOk {
return true
}
if iVal != jVal {
return iVal < jVal
}
}
return as[i].Labels.Before(as[j].Labels)
}
func (as AlertSlice) Swap(i, j int) { as[i], as[j] = as[j], as[i] }
func (as AlertSlice) Len() int { return len(as) }
// Alerts turns a sequence of internal alerts into a list of
// exposable model.Alert structures.
func Alerts(alerts ...*Alert) model.Alerts {
res := make(model.Alerts, 0, len(alerts))
for _, a := range alerts {
v := a.Alert
// If the end timestamp is not reached yet, do not expose it.
if !a.Resolved() {
v.EndsAt = time.Time{}
}
res = append(res, &v)
}
return res
}
================================================
FILE: alert/alert_test.go
================================================
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package alert
import (
"reflect"
"sort"
"strconv"
"testing"
"time"
"github.com/prometheus/common/model"
)
func TestAlertMerge(t *testing.T) {
now := time.Now()
// By convention, alert A is always older than alert B.
pairs := []struct {
A, B, Res *Alert
}{
{
// Both alerts have the Timeout flag set.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert B.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-2 * time.Minute),
EndsAt: now.Add(2 * time.Minute),
},
UpdatedAt: now,
Timeout: true,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
Timeout: true,
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-2 * time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
Timeout: true,
},
},
{
// Alert A has the Timeout flag set while Alert B has it unset.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert B.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now,
Timeout: true,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now,
EndsAt: now.Add(2 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(2 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
},
{
// Alert A has the Timeout flag unset while Alert B has it set.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert A.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now,
EndsAt: now.Add(2 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
Timeout: true,
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
Timeout: true,
},
},
{
// Both alerts have the Timeout flag unset and are not resolved.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert A.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now,
EndsAt: now.Add(2 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
},
{
// Both alerts have the Timeout flag unset and are not resolved.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert B.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(4 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-time.Minute),
EndsAt: now.Add(4 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
},
{
// Both alerts have the Timeout flag unset, A is resolved while B isn't.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert B.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-3 * time.Minute),
EndsAt: now.Add(-time.Minute),
},
UpdatedAt: now,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-2 * time.Minute),
EndsAt: now.Add(time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-3 * time.Minute),
EndsAt: now.Add(time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
},
{
// Both alerts have the Timeout flag unset, B is resolved while A isn't.
// StartsAt is defined by Alert A.
// EndsAt is defined by Alert B.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-2 * time.Minute),
EndsAt: now.Add(3 * time.Minute),
},
UpdatedAt: now,
},
B: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-2 * time.Minute),
EndsAt: now,
},
UpdatedAt: now.Add(time.Minute),
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-2 * time.Minute),
EndsAt: now,
},
UpdatedAt: now.Add(time.Minute),
},
},
{
// Both alerts are resolved (EndsAt < now).
// StartsAt is defined by Alert B.
// EndsAt is defined by Alert A.
A: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-3 * time.Minute),
EndsAt: now.Add(-time.Minute),
},
UpdatedAt: now.Add(-time.Minute),
},
B: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-4 * time.Minute),
EndsAt: now.Add(-2 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
Res: &Alert{
Alert: model.Alert{
StartsAt: now.Add(-4 * time.Minute),
EndsAt: now.Add(-1 * time.Minute),
},
UpdatedAt: now.Add(time.Minute),
},
},
}
for i, p := range pairs {
t.Run(strconv.Itoa(i), func(t *testing.T) {
if res := p.A.Merge(p.B); !reflect.DeepEqual(p.Res, res) {
t.Errorf("unexpected merged alert %#v", res)
}
if res := p.B.Merge(p.A); !reflect.DeepEqual(p.Res, res) {
t.Errorf("unexpected merged alert %#v", res)
}
})
}
}
func TestAlertSliceSort(t *testing.T) {
var (
a1 = &Alert{
Alert: model.Alert{
Labels: model.LabelSet{
"job": "j1",
"instance": "i1",
"alertname": "an1",
},
},
}
a2 = &Alert{
Alert: model.Alert{
Labels: model.LabelSet{
"job": "j1",
"instance": "i1",
"alertname": "an2",
},
},
}
a3 = &Alert{
Alert: model.Alert{
Labels: model.LabelSet{
"job": "j2",
"instance": "i1",
"alertname": "an1",
},
},
}
a4 = &Alert{
Alert: model.Alert{
Labels: model.LabelSet{
"alertname": "an1",
},
},
}
a5 = &Alert{
Alert: model.Alert{
Labels: model.LabelSet{
"alertname": "an2",
},
},
}
)
cases := []struct {
alerts AlertSlice
exp AlertSlice
}{
{
alerts: AlertSlice{a2, a1},
exp: AlertSlice{a1, a2},
},
{
alerts: AlertSlice{a3, a2, a1},
exp: AlertSlice{a1, a2, a3},
},
{
alerts: AlertSlice{a4, a2, a4},
exp: AlertSlice{a2, a4, a4},
},
{
alerts: AlertSlice{a5, a4},
exp: AlertSlice{a4, a5},
},
}
for _, tc := range cases {
sort.Stable(tc.alerts)
if !reflect.DeepEqual(tc.alerts, tc.exp) {
t.Fatalf("expected %v but got %v", tc.exp, tc.alerts)
}
}
}
================================================
FILE: alert/state.go
================================================
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package alert
// AlertState is used as part of AlertStatus.
type AlertState string
// Possible values for AlertState.
const (
AlertStateUnprocessed AlertState = "unprocessed"
AlertStateActive AlertState = "active"
AlertStateSuppressed AlertState = "suppressed"
)
================================================
FILE: alert/status.go
================================================
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package alert
// AlertStatus stores the state of an alert and, as applicable, the IDs of
// silences silencing the alert and of other alerts inhibiting the alert. Note
// that currently, SilencedBy is supposed to be the complete set of the relevant
// silences while InhibitedBy may contain only a subset of the inhibiting alerts
// – in practice exactly one ID. (This somewhat confusing semantics might change
// in the future.)
type AlertStatus struct {
State AlertState `json:"state"`
SilencedBy []string `json:"silencedBy"`
InhibitedBy []string `json:"inhibitedBy"`
}
================================================
FILE: alert/validate.go
================================================
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package alert
import (
"fmt"
"github.com/prometheus/common/model"
"github.com/prometheus/alertmanager/matcher/compat"
)
func validateLs(ls model.LabelSet) error {
for ln, lv := range ls {
if !compat.IsValidLabelName(ln) {
return fmt.Errorf("invalid name %q", ln)
}
if !lv.IsValid() {
return fmt.Errorf("invalid value %q", lv)
}
}
return nil
}
================================================
FILE: alert/validate_test.go
================================================
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package alert
import (
"testing"
"github.com/prometheus/common/model"
"github.com/prometheus/common/promslog"
"github.com/stretchr/testify/require"
"github.com/prometheus/alertmanager/featurecontrol"
"github.com/prometheus/alertmanager/matcher/compat"
)
func TestValidateUTF8Ls(t *testing.T) {
tests := []struct {
name string
ls model.LabelSet
err string
}{{
name: "valid UTF-8 label set",
ls: model.LabelSet{
"a": "a",
"00": "b",
"Σ": "c",
"\xf0\x9f\x99\x82": "dΘ",
},
}, {
name: "invalid UTF-8 label set",
ls: model.LabelSet{
"\xff": "a",
},
err: "invalid name \"\\xff\"",
}}
// Change the mode to UTF-8 mode.
ff, err := featurecontrol.NewFlags(promslog.NewNopLogger(), featurecontrol.FeatureUTF8StrictMode)
require.NoError(t, err)
compat.InitFromFlags(promslog.NewNopLogger(), ff)
// Restore the mode to classic at the end of the test.
ff, err = featurecontrol.NewFlags(promslog.NewNopLogger(), featurecontrol.FeatureClassicMode)
require.NoError(t, err)
defer compat.InitFromFlags(promslog.NewNopLogger(), ff)
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
err := validateLs(test.ls)
if err != nil && err.Error() != test.err {
t.Errorf("unexpected err for %s: %s", test.ls, err)
} else if err == nil && test.err != "" {
t.Error("expected error, got nil")
}
})
}
}
================================================
FILE: api/api.go
================================================
// Copyright 2019 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package api
import (
"context"
"errors"
"fmt"
"log/slog"
"net/http"
"runtime"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/model"
"github.com/prometheus/common/promslog"
"github.com/prometheus/common/route"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
apiv2 "github.com/prometheus/alertmanager/api/v2"
"github.com/prometheus/alertmanager/cluster"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/dispatch"
"github.com/prometheus/alertmanager/provider"
"github.com/prometheus/alertmanager/silence"
"github.com/prometheus/alertmanager/types"
)
// API represents all APIs of Alertmanager.
type API struct {
v2 *apiv2.API
deprecationRouter *V1DeprecationRouter
requestDuration *prometheus.HistogramVec
requestsInFlight prometheus.Gauge
concurrencyLimitExceeded prometheus.Counter
timeout time.Duration
inFlightSem chan struct{}
}
// Options for the creation of an API object. Alerts, Silences, AlertStatusFunc
// and GroupMutedFunc are mandatory. The zero value for everything else is a safe
// default.
type Options struct {
// Alerts to be used by the API. Mandatory.
Alerts provider.Alerts
// Silences to be used by the API. Mandatory.
Silences *silence.Silences
// AlertStatusFunc is used be the API to retrieve the AlertStatus of an
// alert. Mandatory.
AlertStatusFunc func(model.Fingerprint) types.AlertStatus
// GroupMutedFunc is used be the API to know if an alert is muted.
// Mandatory.
GroupMutedFunc func(routeID, groupKey string) ([]string, bool)
// Peer from the gossip cluster. If nil, no clustering will be used.
Peer cluster.ClusterPeer
// Timeout for all HTTP connections. The zero value (and negative
// values) result in no timeout.
Timeout time.Duration
// Concurrency limit for GET requests. The zero value (and negative
// values) result in a limit of GOMAXPROCS or 8, whichever is
// larger. Status code 503 is served for GET requests that would exceed
// the concurrency limit.
Concurrency int
// Logger is used for logging, if nil, no logging will happen.
Logger *slog.Logger
// Registry is used to register Prometheus metrics. If nil, no metrics
// registration will happen.
Registry prometheus.Registerer
// RequestDuration is used to measure the duration of HTTP requests.
RequestDuration *prometheus.HistogramVec
// GroupFunc returns a list of alert groups. The alerts are grouped
// according to the current active configuration. Alerts returned are
// filtered by the arguments provided to the function.
GroupFunc func(context.Context, func(*dispatch.Route) bool, func(*types.Alert, time.Time) bool) (dispatch.AlertGroups, map[model.Fingerprint][]string, error)
}
func (o Options) validate() error {
if o.Alerts == nil {
return errors.New("mandatory field Alerts not set")
}
if o.Silences == nil {
return errors.New("mandatory field Silences not set")
}
if o.AlertStatusFunc == nil {
return errors.New("mandatory field AlertStatusFunc not set")
}
if o.GroupMutedFunc == nil {
return errors.New("mandatory field GroupMutedFunc not set")
}
if o.GroupFunc == nil {
return errors.New("mandatory field GroupFunc not set")
}
return nil
}
// New creates a new API object combining all API versions. Note that an Update
// call is also needed to get the APIs into an operational state.
func New(opts Options) (*API, error) {
if err := opts.validate(); err != nil {
return nil, fmt.Errorf("invalid API options: %w", err)
}
l := opts.Logger
if l == nil {
l = promslog.NewNopLogger()
}
concurrency := opts.Concurrency
if concurrency < 1 {
concurrency = max(runtime.GOMAXPROCS(0), 8)
}
v2, err := apiv2.NewAPI(
opts.Alerts,
opts.GroupFunc,
opts.AlertStatusFunc,
opts.GroupMutedFunc,
opts.Silences,
opts.Peer,
l.With("version", "v2"),
opts.Registry,
)
if err != nil {
return nil, err
}
requestsInFlight := prometheus.NewGauge(prometheus.GaugeOpts{
Name: "alertmanager_http_requests_in_flight",
Help: "Current number of HTTP requests being processed.",
ConstLabels: prometheus.Labels{"method": "get"},
})
concurrencyLimitExceeded := prometheus.NewCounter(prometheus.CounterOpts{
Name: "alertmanager_http_concurrency_limit_exceeded_total",
Help: "Total number of times an HTTP request failed because the concurrency limit was reached.",
ConstLabels: prometheus.Labels{"method": "get"},
})
if opts.Registry != nil {
if err := opts.Registry.Register(requestsInFlight); err != nil {
return nil, err
}
if err := opts.Registry.Register(concurrencyLimitExceeded); err != nil {
return nil, err
}
}
return &API{
deprecationRouter: NewV1DeprecationRouter(l.With("version", "v1")),
v2: v2,
requestDuration: opts.RequestDuration,
requestsInFlight: requestsInFlight,
concurrencyLimitExceeded: concurrencyLimitExceeded,
timeout: opts.Timeout,
inFlightSem: make(chan struct{}, concurrency),
}, nil
}
// Register API. As APIv2 works on the http.Handler level, this method also creates a new
// http.ServeMux and then uses it to register both the provided router (to
// handle "/") and APIv2 (to handle "<routePrefix>/api/v2"). The method returns
// the newly created http.ServeMux. If a timeout has been set on construction of
// API, it is enforced for all HTTP request going through this mux. The same is
// true for the concurrency limit, with the exception that it is only applied to
// GET requests.
func (api *API) Register(r *route.Router, routePrefix string) *http.ServeMux {
// TODO(gotjosh) API V1 was removed as of version 0.27, when we reach 1.0.0 we should removed these deprecation warnings.
api.deprecationRouter.Register(r.WithPrefix("/api/v1"))
mux := http.NewServeMux()
mux.Handle("/", api.limitHandler(r))
apiPrefix := ""
if routePrefix != "/" {
apiPrefix = routePrefix
}
mux.Handle(
apiPrefix+"/api/v2/",
api.instrumentHandler(
apiPrefix,
api.limitHandler(
http.StripPrefix(
apiPrefix,
api.v2.Handler,
),
),
),
)
return mux
}
// Update config and resolve timeout of each API. APIv2 also needs
// setAlertStatus to be updated.
func (api *API) Update(cfg *config.Config, setAlertStatus func(ctx context.Context, labels model.LabelSet)) {
api.v2.Update(cfg, setAlertStatus)
}
func (api *API) limitHandler(h http.Handler) http.Handler {
concLimiter := http.HandlerFunc(func(rsp http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodGet { // Only limit concurrency of GETs.
select {
case api.inFlightSem <- struct{}{}: // All good, carry on.
api.requestsInFlight.Inc()
defer func() {
<-api.inFlightSem
api.requestsInFlight.Dec()
}()
default:
api.concurrencyLimitExceeded.Inc()
http.Error(rsp, fmt.Sprintf(
"Limit of concurrent GET requests reached (%d), try again later.\n", cap(api.inFlightSem),
), http.StatusServiceUnavailable)
return
}
}
h.ServeHTTP(rsp, req)
})
if api.timeout <= 0 {
return concLimiter
}
return http.TimeoutHandler(concLimiter, api.timeout, fmt.Sprintf(
"Exceeded configured timeout of %v.\n", api.timeout,
))
}
func (api *API) instrumentHandler(prefix string, h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
path, _ := strings.CutPrefix(r.URL.Path, prefix)
// avoid high cardinality label values by replacing the actual silence IDs with a placeholder
if strings.HasPrefix(path, "/api/v2/silence/") {
path = "/api/v2/silence/{silenceID}"
}
promhttp.InstrumentHandlerDuration(
api.requestDuration.MustCurryWith(prometheus.Labels{"handler": path}),
otelhttp.NewHandler(h, path),
).ServeHTTP(w, r)
})
}
================================================
FILE: api/metrics/metrics.go
================================================
// Copyright 2019 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
// Alerts stores metrics for alerts.
type Alerts struct {
firing prometheus.Counter
resolved prometheus.Counter
invalid prometheus.Counter
}
// NewAlerts returns an *Alerts struct for the given API version.
// Since v1 was deprecated in 0.27, v2 is now hardcoded.
func NewAlerts(r prometheus.Registerer) *Alerts {
if r == nil {
return nil
}
numReceivedAlerts := promauto.With(r).NewCounterVec(prometheus.CounterOpts{
Name: "alertmanager_alerts_received_total",
Help: "The total number of received alerts.",
ConstLabels: prometheus.Labels{"version": "v2"},
}, []string{"status"})
numInvalidAlerts := promauto.With(r).NewCounter(prometheus.CounterOpts{
Name: "alertmanager_alerts_invalid_total",
Help: "The total number of received alerts that were invalid.",
ConstLabels: prometheus.Labels{"version": "v2"},
})
return &Alerts{
firing: numReceivedAlerts.WithLabelValues("firing"),
resolved: numReceivedAlerts.WithLabelValues("resolved"),
invalid: numInvalidAlerts,
}
}
// Firing returns a counter of firing alerts.
func (a *Alerts) Firing() prometheus.Counter { return a.firing }
// Resolved returns a counter of resolved alerts.
func (a *Alerts) Resolved() prometheus.Counter { return a.resolved }
// Invalid returns a counter of invalid alerts.
func (a *Alerts) Invalid() prometheus.Counter { return a.invalid }
================================================
FILE: api/v1_deprecation_router.go
================================================
// Copyright 2023 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package api
import (
"encoding/json"
"log/slog"
"net/http"
"github.com/prometheus/common/route"
)
// V1DeprecationRouter is the router to signal v1 users that the API v1 is now removed.
type V1DeprecationRouter struct {
logger *slog.Logger
}
// NewV1DeprecationRouter returns a new V1DeprecationRouter.
func NewV1DeprecationRouter(l *slog.Logger) *V1DeprecationRouter {
return &V1DeprecationRouter{
logger: l,
}
}
// Register registers all the API v1 routes with an endpoint that returns a JSON deprecation notice and a logs a warning.
func (dr *V1DeprecationRouter) Register(r *route.Router) {
r.Get("/status", dr.deprecationHandler)
r.Get("/receivers", dr.deprecationHandler)
r.Get("/alerts", dr.deprecationHandler)
r.Post("/alerts", dr.deprecationHandler)
r.Get("/silences", dr.deprecationHandler)
r.Post("/silences", dr.deprecationHandler)
r.Get("/silence/:sid", dr.deprecationHandler)
r.Del("/silence/:sid", dr.deprecationHandler)
}
func (dr *V1DeprecationRouter) deprecationHandler(w http.ResponseWriter, req *http.Request) {
dr.logger.Warn("v1 API received a request on a removed endpoint", "path", req.URL.Path, "method", req.Method)
resp := struct {
Status string `json:"status"`
Error string `json:"error"`
}{
"deprecated",
"The Alertmanager v1 API was deprecated in version 0.16.0 and is removed as of version 0.27.0 - please use the equivalent route in the v2 API",
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(410)
if err := json.NewEncoder(w).Encode(resp); err != nil {
dr.logger.Error("failed to write response", "err", err)
}
}
================================================
FILE: api/v2/api.go
================================================
// Copyright 2018 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package v2
import (
"context"
"errors"
"fmt"
"log/slog"
"net/http"
"regexp"
"slices"
"sort"
"sync"
"time"
"github.com/go-openapi/analysis"
"github.com/go-openapi/loads"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/prometheus/client_golang/prometheus"
prometheus_model "github.com/prometheus/common/model"
"github.com/prometheus/common/version"
"github.com/rs/cors"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"github.com/prometheus/alertmanager/api/metrics"
open_api_models "github.com/prometheus/alertmanager/api/v2/models"
"github.com/prometheus/alertmanager/api/v2/restapi"
"github.com/prometheus/alertmanager/api/v2/restapi/operations"
alert_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/alert"
alertgroup_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup"
general_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/general"
receiver_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/receiver"
silence_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/silence"
"github.com/prometheus/alertmanager/cluster"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/dispatch"
"github.com/prometheus/alertmanager/matcher/compat"
"github.com/prometheus/alertmanager/pkg/labels"
"github.com/prometheus/alertmanager/provider"
"github.com/prometheus/alertmanager/silence"
"github.com/prometheus/alertmanager/silence/silencepb"
"github.com/prometheus/alertmanager/types"
)
var tracer = otel.Tracer("github.com/prometheus/alertmanager/api/v2")
// API represents an Alertmanager API v2.
type API struct {
peer cluster.ClusterPeer
silences *silence.Silences
alerts provider.Alerts
alertGroups groupsFn
getAlertStatus getAlertStatusFn
groupMutedFunc groupMutedFunc
uptime time.Time
// mtx protects alertmanagerConfig, setAlertStatus and route.
mtx sync.RWMutex
// resolveTimeout represents the default resolve timeout that an alert is
// assigned if no end time is specified.
alertmanagerConfig *config.Config
route *dispatch.Route
setAlertStatus setAlertStatusFn
logger *slog.Logger
m *metrics.Alerts
Handler http.Handler
}
type (
groupsFn func(context.Context, func(*dispatch.Route) bool, func(*types.Alert, time.Time) bool) (dispatch.AlertGroups, map[prometheus_model.Fingerprint][]string, error)
groupMutedFunc func(routeID, groupKey string) ([]string, bool)
getAlertStatusFn func(prometheus_model.Fingerprint) types.AlertStatus
setAlertStatusFn func(ctx context.Context, labels prometheus_model.LabelSet)
)
// NewAPI returns a new Alertmanager API v2.
func NewAPI(
alerts provider.Alerts,
gf groupsFn,
asf getAlertStatusFn,
gmf groupMutedFunc,
silences *silence.Silences,
peer cluster.ClusterPeer,
l *slog.Logger,
r prometheus.Registerer,
) (*API, error) {
api := API{
alerts: alerts,
getAlertStatus: asf,
alertGroups: gf,
groupMutedFunc: gmf,
peer: peer,
silences: silences,
logger: l,
m: metrics.NewAlerts(r),
uptime: time.Now(),
}
// Load embedded swagger file.
swaggerSpec, swaggerSpecAnalysis, err := getSwaggerSpec()
if err != nil {
return nil, err
}
// Create new service API.
openAPI := operations.NewAlertmanagerAPI(swaggerSpec)
// Skip the redoc middleware, only serving the OpenAPI specification and
// the API itself via RoutesHandler. See:
// https://github.com/go-swagger/go-swagger/issues/1779
openAPI.Middleware = func(b middleware.Builder) http.Handler {
// Manually create the context so that we can use the singleton swaggerSpecAnalysis.
swaggerContext := middleware.NewRoutableContextWithAnalyzedSpec(swaggerSpec, swaggerSpecAnalysis, openAPI, nil)
return middleware.Spec("", swaggerSpec.Raw(), swaggerContext.RoutesHandler(b))
}
openAPI.AlertGetAlertsHandler = alert_ops.GetAlertsHandlerFunc(api.getAlertsHandler)
openAPI.AlertPostAlertsHandler = alert_ops.PostAlertsHandlerFunc(api.postAlertsHandler)
openAPI.AlertgroupGetAlertGroupsHandler = alertgroup_ops.GetAlertGroupsHandlerFunc(api.getAlertGroupsHandler)
openAPI.GeneralGetStatusHandler = general_ops.GetStatusHandlerFunc(api.getStatusHandler)
openAPI.ReceiverGetReceiversHandler = receiver_ops.GetReceiversHandlerFunc(api.getReceiversHandler)
openAPI.SilenceDeleteSilenceHandler = silence_ops.DeleteSilenceHandlerFunc(api.deleteSilenceHandler)
openAPI.SilenceGetSilenceHandler = silence_ops.GetSilenceHandlerFunc(api.getSilenceHandler)
openAPI.SilenceGetSilencesHandler = silence_ops.GetSilencesHandlerFunc(api.getSilencesHandler)
openAPI.SilencePostSilencesHandler = silence_ops.PostSilencesHandlerFunc(api.postSilencesHandler)
handleCORS := cors.Default().Handler
api.Handler = handleCORS(setResponseHeaders(openAPI.Serve(nil)))
return &api, nil
}
var responseHeaders = map[string]string{
"Cache-Control": "no-store",
}
func setResponseHeaders(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
for h, v := range responseHeaders {
w.Header().Set(h, v)
}
h.ServeHTTP(w, r)
})
}
func (api *API) requestLogger(req *http.Request) *slog.Logger {
return api.logger.With("path", req.URL.Path, "method", req.Method)
}
// Update sets the API struct members that may change between reloads of alertmanager.
func (api *API) Update(cfg *config.Config, setAlertStatus setAlertStatusFn) {
api.mtx.Lock()
defer api.mtx.Unlock()
api.alertmanagerConfig = cfg
api.route = dispatch.NewRoute(cfg.Route, nil)
api.setAlertStatus = setAlertStatus
}
func (api *API) getStatusHandler(params general_ops.GetStatusParams) middleware.Responder {
api.mtx.RLock()
defer api.mtx.RUnlock()
_, span := tracer.Start(params.HTTPRequest.Context(), "api.getStatusHandler")
defer span.End()
original := api.alertmanagerConfig.String()
uptime := strfmt.DateTime(api.uptime)
status := open_api_models.ClusterStatusStatusDisabled
resp := open_api_models.AlertmanagerStatus{
Uptime: &uptime,
VersionInfo: &open_api_models.VersionInfo{
Version: &version.Version,
Revision: &version.Revision,
Branch: &version.Branch,
BuildUser: &version.BuildUser,
BuildDate: &version.BuildDate,
GoVersion: &version.GoVersion,
},
Config: &open_api_models.AlertmanagerConfig{
Original: &original,
},
Cluster: &open_api_models.ClusterStatus{
Status: &status,
Peers: []*open_api_models.PeerStatus{},
},
}
// If alertmanager cluster feature is disabled, then api.peers == nil.
if api.peer != nil {
status := api.peer.Status()
peers := []*open_api_models.PeerStatus{}
for _, n := range api.peer.Peers() {
address := n.Address()
name := n.Name()
peers = append(peers, &open_api_models.PeerStatus{
Name: &name,
Address: &address,
})
}
sort.Slice(peers, func(i, j int) bool {
return *peers[i].Name < *peers[j].Name
})
resp.Cluster = &open_api_models.ClusterStatus{
Name: api.peer.Name(),
Status: &status,
Peers: peers,
}
}
return general_ops.NewGetStatusOK().WithPayload(&resp)
}
func (api *API) getReceiversHandler(params receiver_ops.GetReceiversParams) middleware.Responder {
api.mtx.RLock()
defer api.mtx.RUnlock()
_, span := tracer.Start(params.HTTPRequest.Context(), "api.getReceiversHandler")
defer span.End()
receivers := make([]*open_api_models.Receiver, 0, len(api.alertmanagerConfig.Receivers))
for i := range api.alertmanagerConfig.Receivers {
receivers = append(receivers, &open_api_models.Receiver{Name: &api.alertmanagerConfig.Receivers[i].Name})
}
return receiver_ops.NewGetReceiversOK().WithPayload(receivers)
}
func (api *API) getAlertsHandler(params alert_ops.GetAlertsParams) middleware.Responder {
var (
receiverFilter *regexp.Regexp
// Initialize result slice to prevent api returning `null` when there
// are no alerts present
res = open_api_models.GettableAlerts{}
logger = api.requestLogger(params.HTTPRequest)
)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.getAlertsHandler")
defer span.End()
matchers, err := parseFilter(params.Filter)
if err != nil {
logger.Debug("Failed to parse matchers", "err", err)
return alertgroup_ops.NewGetAlertGroupsBadRequest().WithPayload(err.Error())
}
if params.Receiver != nil {
receiverFilter, err = regexp.Compile("^(?:" + *params.Receiver + ")$")
if err != nil {
logger.Debug("Failed to compile receiver regex", "err", err)
return alert_ops.
NewGetAlertsBadRequest().
WithPayload(
fmt.Sprintf("failed to parse receiver param: %v", err.Error()),
)
}
}
alerts := api.alerts.GetPending()
defer alerts.Close()
alertFilter := api.alertFilter(matchers, *params.Silenced, *params.Inhibited, *params.Active)
now := time.Now()
api.mtx.RLock()
for a := range alerts.Next() {
alert := a.Data
if err = alerts.Err(); err != nil {
break
}
if err = ctx.Err(); err != nil {
break
}
routes := api.route.Match(alert.Labels)
receivers := make([]string, 0, len(routes))
for _, r := range routes {
receivers = append(receivers, r.RouteOpts.Receiver)
}
if receiverFilter != nil && !slices.ContainsFunc(receivers, receiverFilter.MatchString) {
continue
}
if !alertFilter(alert, now) {
continue
}
openAlert := AlertToOpenAPIAlert(alert, api.getAlertStatus(alert.Fingerprint()), receivers, nil)
res = append(res, openAlert)
}
api.mtx.RUnlock()
if err != nil {
logger.Error("Failed to get alerts", "err", err)
return alert_ops.NewGetAlertsInternalServerError().WithPayload(err.Error())
}
sort.Slice(res, func(i, j int) bool {
return *res[i].Fingerprint < *res[j].Fingerprint
})
return alert_ops.NewGetAlertsOK().WithPayload(res)
}
func (api *API) postAlertsHandler(params alert_ops.PostAlertsParams) middleware.Responder {
logger := api.requestLogger(params.HTTPRequest)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.postAlertsHandler")
defer span.End()
alerts := OpenAPIAlertsToAlerts(ctx, params.Alerts)
now := time.Now()
api.mtx.RLock()
resolveTimeout := time.Duration(api.alertmanagerConfig.Global.ResolveTimeout)
api.mtx.RUnlock()
for _, alert := range alerts {
alert.UpdatedAt = now
// Ensure StartsAt is set.
if alert.StartsAt.IsZero() {
if alert.EndsAt.IsZero() {
alert.StartsAt = now
} else {
alert.StartsAt = alert.EndsAt
}
}
// If no end time is defined, set a timeout after which an alert
// is marked resolved if it is not updated.
if alert.EndsAt.IsZero() {
alert.Timeout = true
alert.EndsAt = now.Add(resolveTimeout)
}
if alert.EndsAt.After(time.Now()) {
api.m.Firing().Inc()
} else {
api.m.Resolved().Inc()
}
}
// Make a best effort to insert all alerts that are valid.
var (
validAlerts = make([]*types.Alert, 0, len(alerts))
validationErrs error
)
for _, a := range alerts {
removeEmptyLabels(a.Labels)
if err := a.Validate(); err != nil {
validationErrs = errors.Join(validationErrs, err)
api.m.Invalid().Inc()
continue
}
validAlerts = append(validAlerts, a)
}
if err := api.alerts.Put(ctx, validAlerts...); err != nil {
message := "Failed to create alerts"
logger.Error(message, "err", err)
span.SetStatus(codes.Error, message)
span.RecordError(err)
return alert_ops.NewPostAlertsInternalServerError().WithPayload(err.Error())
}
if validationErrs != nil {
message := "Failed to validate alerts"
logger.Error(message, "err", validationErrs.Error())
span.SetStatus(codes.Error, message)
span.RecordError(validationErrs)
return alert_ops.NewPostAlertsBadRequest().WithPayload(validationErrs.Error())
}
return alert_ops.NewPostAlertsOK()
}
func (api *API) getAlertGroupsHandler(params alertgroup_ops.GetAlertGroupsParams) middleware.Responder {
logger := api.requestLogger(params.HTTPRequest)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.getAlertGroupsHandler")
defer span.End()
matchers, err := parseFilter(params.Filter)
if err != nil {
logger.Debug("Failed to parse matchers", "err", err)
return alertgroup_ops.NewGetAlertGroupsBadRequest().WithPayload(err.Error())
}
var receiverFilter *regexp.Regexp
if params.Receiver != nil {
receiverFilter, err = regexp.Compile("^(?:" + *params.Receiver + ")$")
if err != nil {
logger.Error("Failed to compile receiver regex", "err", err)
return alertgroup_ops.
NewGetAlertGroupsBadRequest().
WithPayload(
fmt.Sprintf("failed to parse receiver param: %v", err.Error()),
)
}
}
rf := func(receiverFilter *regexp.Regexp) func(r *dispatch.Route) bool {
return func(r *dispatch.Route) bool {
receiver := r.RouteOpts.Receiver
if receiverFilter != nil && !receiverFilter.MatchString(receiver) {
return false
}
return true
}
}(receiverFilter)
af := api.alertFilter(matchers, *params.Silenced, *params.Inhibited, *params.Active)
alertGroups, allReceivers, err := api.alertGroups(ctx, rf, af)
if err != nil {
message := "Failed to get alert groups"
logger.Error(message, "err", err)
span.SetStatus(codes.Error, message)
span.RecordError(err)
return alertgroup_ops.NewGetAlertGroupsInternalServerError()
}
res := make(open_api_models.AlertGroups, 0, len(alertGroups))
for _, alertGroup := range alertGroups {
mutedBy, isMuted := api.groupMutedFunc(alertGroup.RouteID, alertGroup.GroupKey)
if !*params.Muted && isMuted {
continue
}
ag := &open_api_models.AlertGroup{
Receiver: &open_api_models.Receiver{Name: &alertGroup.Receiver},
Labels: ModelLabelSetToAPILabelSet(alertGroup.Labels),
Alerts: make([]*open_api_models.GettableAlert, 0, len(alertGroup.Alerts)),
}
for _, alert := range alertGroup.Alerts {
fp := alert.Fingerprint()
receivers := allReceivers[fp]
status := api.getAlertStatus(fp)
apiAlert := AlertToOpenAPIAlert(alert, status, receivers, mutedBy)
ag.Alerts = append(ag.Alerts, apiAlert)
}
res = append(res, ag)
}
return alertgroup_ops.NewGetAlertGroupsOK().WithPayload(res)
}
func (api *API) alertFilter(matchers []*labels.Matcher, silenced, inhibited, active bool) func(a *types.Alert, now time.Time) bool {
return func(a *types.Alert, now time.Time) bool {
ctx, span := tracer.Start(context.Background(), "alertFilter")
defer span.End()
if !a.EndsAt.IsZero() && a.EndsAt.Before(now) {
return false
}
// Set alert's current status based on its label set.
api.setAlertStatus(ctx, a.Labels)
// Get alert's current status after seeing if it is suppressed.
status := api.getAlertStatus(a.Fingerprint())
if !active && status.State == types.AlertStateActive {
return false
}
if !silenced && len(status.SilencedBy) != 0 {
return false
}
if !inhibited && len(status.InhibitedBy) != 0 {
return false
}
return alertMatchesFilterLabels(&a.Alert, matchers)
}
}
func removeEmptyLabels(ls prometheus_model.LabelSet) {
for k, v := range ls {
if string(v) == "" {
delete(ls, k)
}
}
}
func alertMatchesFilterLabels(a *prometheus_model.Alert, matchers []*labels.Matcher) bool {
sms := make(map[string]string)
for name, value := range a.Labels {
sms[string(name)] = string(value)
}
return matchFilterLabels(matchers, sms)
}
func matchFilterLabels(matchers []*labels.Matcher, sms map[string]string) bool {
for _, m := range matchers {
v, prs := sms[m.Name]
switch m.Type {
case labels.MatchNotRegexp, labels.MatchNotEqual:
if m.Value == "" && prs {
continue
}
if !m.Matches(v) {
return false
}
default:
if m.Value == "" && !prs {
continue
}
if !m.Matches(v) {
return false
}
}
}
return true
}
func (api *API) getSilencesHandler(params silence_ops.GetSilencesParams) middleware.Responder {
logger := api.requestLogger(params.HTTPRequest)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.getSilencesHandler")
defer span.End()
matchers, err := parseFilter(params.Filter)
if err != nil {
logger.Debug("Failed to parse matchers", "err", err)
return silence_ops.NewGetSilencesBadRequest().WithPayload(err.Error())
}
psils, _, err := api.silences.Query(ctx)
if err != nil {
logger.Error("Failed to get silences", "err", err)
return silence_ops.NewGetSilencesInternalServerError().WithPayload(err.Error())
}
sils := open_api_models.GettableSilences{}
for _, ps := range psils {
if !CheckSilenceMatchesFilterLabels(ps, matchers) {
continue
}
silence, err := GettableSilenceFromProto(ps)
if err != nil {
logger.Error("Failed to unmarshal silence from proto", "err", err)
return silence_ops.NewGetSilencesInternalServerError().WithPayload(err.Error())
}
sils = append(sils, &silence)
}
SortSilences(sils)
return silence_ops.NewGetSilencesOK().WithPayload(sils)
}
var silenceStateOrder = map[silence.SilenceState]int{
silence.SilenceStateActive: 1,
silence.SilenceStatePending: 2,
silence.SilenceStateExpired: 3,
}
// SortSilences sorts first according to the state "active, pending, expired"
// then by end time or start time depending on the state.
// Active silences should show the next to expire first
// pending silences are ordered based on which one starts next
// expired are ordered based on which one expired most recently.
func SortSilences(sils open_api_models.GettableSilences) {
sort.Slice(sils, func(i, j int) bool {
state1 := silence.SilenceState(*sils[i].Status.State)
state2 := silence.SilenceState(*sils[j].Status.State)
if state1 != state2 {
return silenceStateOrder[state1] < silenceStateOrder[state2]
}
switch state1 {
case silence.SilenceStateActive:
endsAt1 := time.Time(*sils[i].EndsAt)
endsAt2 := time.Time(*sils[j].EndsAt)
return endsAt1.Before(endsAt2)
case silence.SilenceStatePending:
startsAt1 := time.Time(*sils[i].StartsAt)
startsAt2 := time.Time(*sils[j].StartsAt)
return startsAt1.Before(startsAt2)
case silence.SilenceStateExpired:
endsAt1 := time.Time(*sils[i].EndsAt)
endsAt2 := time.Time(*sils[j].EndsAt)
return endsAt1.After(endsAt2)
}
return false
})
}
// CheckSilenceMatchesFilterLabels returns true if
// a given silence matches a list of matchers.
// A silence matches a filter (list of matchers) if
// for all matchers in the filter, there exists a matcher in the silence
// such that their names, types, and values are equivalent.
func CheckSilenceMatchesFilterLabels(s *silencepb.Silence, matchers []*labels.Matcher) bool {
// Check if any matcher set matches (OR logic)
for _, ms := range s.MatcherSets {
if checkMatcherSetMatchesFilterLabels(ms, matchers) {
return true
}
}
return false
}
func checkMatcherSetMatchesFilterLabels(ms *silencepb.MatcherSet, matchers []*labels.Matcher) bool {
for _, matcher := range matchers {
found := false
for _, m := range ms.Matchers {
if matcher.Name == m.Name &&
(matcher.Type == labels.MatchEqual && m.Type == silencepb.Matcher_EQUAL ||
matcher.Type == labels.MatchRegexp && m.Type == silencepb.Matcher_REGEXP ||
matcher.Type == labels.MatchNotEqual && m.Type == silencepb.Matcher_NOT_EQUAL ||
matcher.Type == labels.MatchNotRegexp && m.Type == silencepb.Matcher_NOT_REGEXP) &&
matcher.Value == m.Pattern {
found = true
break
}
}
if !found {
return false
}
}
return true
}
func (api *API) getSilenceHandler(params silence_ops.GetSilenceParams) middleware.Responder {
logger := api.requestLogger(params.HTTPRequest)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.getSilenceHandler")
defer span.End()
sils, _, err := api.silences.Query(ctx, silence.QIDs(params.SilenceID.String()))
if err != nil {
logger.Error("Failed to get silence by id", "err", err, "id", params.SilenceID.String())
return silence_ops.NewGetSilenceInternalServerError().WithPayload(err.Error())
}
if len(sils) == 0 {
logger.Error("Failed to find silence", "err", err, "id", params.SilenceID.String())
return silence_ops.NewGetSilenceNotFound()
}
sil, err := GettableSilenceFromProto(sils[0])
if err != nil {
logger.Error("Failed to convert unmarshal from proto", "err", err)
return silence_ops.NewGetSilenceInternalServerError().WithPayload(err.Error())
}
return silence_ops.NewGetSilenceOK().WithPayload(&sil)
}
func (api *API) deleteSilenceHandler(params silence_ops.DeleteSilenceParams) middleware.Responder {
logger := api.requestLogger(params.HTTPRequest)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.deleteSilenceHandler")
defer span.End()
sid := params.SilenceID.String()
if err := api.silences.Expire(ctx, sid); err != nil {
logger.Error("Failed to expire silence", "err", err)
if errors.Is(err, silence.ErrNotFound) {
return silence_ops.NewDeleteSilenceNotFound()
}
return silence_ops.NewDeleteSilenceInternalServerError().WithPayload(err.Error())
}
return silence_ops.NewDeleteSilenceOK()
}
func (api *API) postSilencesHandler(params silence_ops.PostSilencesParams) middleware.Responder {
logger := api.requestLogger(params.HTTPRequest)
ctx, span := tracer.Start(params.HTTPRequest.Context(), "api.postSilencesHandler")
defer span.End()
sil, err := PostableSilenceToProto(params.Silence)
if err != nil {
logger.Error("Failed to marshal silence to proto", "err", err)
return silence_ops.NewPostSilencesBadRequest().WithPayload(
fmt.Sprintf("failed to convert API silence to internal silence: %v", err.Error()),
)
}
if sil.StartsAt.AsTime().After(sil.EndsAt.AsTime()) || sil.StartsAt.AsTime().Equal(sil.EndsAt.AsTime()) {
msg := "Failed to create silence: start time must be before end time"
logger.Error(msg, "starts_at", sil.StartsAt, "ends_at", sil.EndsAt)
return silence_ops.NewPostSilencesBadRequest().WithPayload(msg)
}
if sil.EndsAt.AsTime().Before(time.Now()) {
msg := "Failed to create silence: end time can't be in the past"
logger.Error(msg, "ends_at", sil.EndsAt)
return silence_ops.NewPostSilencesBadRequest().WithPayload(msg)
}
if err = api.silences.Set(ctx, sil); err != nil {
logger.Error("Failed to create silence", "err", err)
if errors.Is(err, silence.ErrNotFound) {
return silence_ops.NewPostSilencesNotFound().WithPayload(err.Error())
}
return silence_ops.NewPostSilencesBadRequest().WithPayload(err.Error())
}
return silence_ops.NewPostSilencesOK().WithPayload(&silence_ops.PostSilencesOKBody{
SilenceID: sil.Id,
})
}
func parseFilter(filter []string) ([]*labels.Matcher, error) {
matchers := make([]*labels.Matcher, 0, len(filter))
for _, matcherString := range filter {
matcher, err := compat.Matcher(matcherString, "api")
if err != nil {
return nil, err
}
matchers = append(matchers, matcher)
}
return matchers, nil
}
var (
swaggerSpecCacheMx sync.Mutex
swaggerSpecCache *loads.Document
swaggerSpecAnalysisCache *analysis.Spec
)
// getSwaggerSpec loads and caches the swagger spec. If a cached version already exists,
// it returns the cached one. The reason why we cache it is because some downstream projects
// (e.g. Grafana Mimir) creates many Alertmanager instances in the same process, so they would
// incur in a significant memory penalty if we would reload the swagger spec each time.
func getSwaggerSpec() (*loads.Document, *analysis.Spec, error) {
swaggerSpecCacheMx.Lock()
defer swaggerSpecCacheMx.Unlock()
// Check if a cached version exists.
if swaggerSpecCache != nil {
return swaggerSpecCache, swaggerSpecAnalysisCache, nil
}
// Load embedded swagger file.
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
if err != nil {
return nil, nil, fmt.Errorf("failed to load embedded swagger file: %w", err)
}
swaggerSpecCache = swaggerSpec
swaggerSpecAnalysisCache = analysis.New(swaggerSpec.Spec())
return swaggerSpec, swaggerSpecAnalysisCache, nil
}
================================================
FILE: api/v2/api_test.go
================================================
// Copyright 2019 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package v2
import (
"bytes"
"context"
"encoding/json"
"io"
"net/http"
"net/http/httptest"
"strconv"
"testing"
"time"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
"github.com/prometheus/common/promslog"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/timestamppb"
open_api_models "github.com/prometheus/alertmanager/api/v2/models"
general_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/general"
receiver_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/receiver"
silence_ops "github.com/prometheus/alertmanager/api/v2/restapi/operations/silence"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/pkg/labels"
"github.com/prometheus/alertmanager/silence"
"github.com/prometheus/alertmanager/silence/silencepb"
"github.com/prometheus/alertmanager/types"
)
// If api.peers == nil, Alertmanager cluster feature is disabled. Make sure to
// not try to access properties of peer, which would trigger a nil pointer
// dereference.
func TestGetStatusHandlerWithNilPeer(t *testing.T) {
api := API{
uptime: time.Now(),
peer: nil,
alertmanagerConfig: &config.Config{},
}
// Test ensures this method call does not panic.
status := api.getStatusHandler(
general_ops.GetStatusParams{
HTTPRequest: httptest.NewRequest(
"GET",
"/api/v2/status",
nil,
),
},
).(*general_ops.GetStatusOK)
c := status.Payload.Cluster
if c == nil || c.Status == nil {
t.Fatal("expected cluster status not to be nil, violating the openapi specification")
}
if c.Peers == nil {
t.Fatal("expected cluster peers to be not nil when api.peer is nil, violating the openapi specification")
}
if len(c.Peers) != 0 {
t.Fatal("expected cluster peers to be empty when api.peer is nil, violating the openapi specification")
}
if c.Name != "" {
t.Fatal("expected cluster name to be empty, violating the openapi specification")
}
}
func assertEqualStrings(t *testing.T, expected, actual string) {
if expected != actual {
t.Fatal("expected: ", expected, ", actual: ", actual)
}
}
var (
testComment = "comment"
createdBy = "test"
)
func newSilences(t *testing.T) *silence.Silences {
silences, err := silence.New(silence.Options{Metrics: prometheus.NewRegistry()})
require.NoError(t, err)
return silences
}
func gettableSilence(id, state string,
updatedAt, start, end string,
) *open_api_models.GettableSilence {
updAt, err := strfmt.ParseDateTime(updatedAt)
if err != nil {
panic(err)
}
strAt, err := strfmt.ParseDateTime(start)
if err != nil {
panic(err)
}
endAt, err := strfmt.ParseDateTime(end)
if err != nil {
panic(err)
}
return &open_api_models.GettableSilence{
Silence: open_api_models.Silence{
StartsAt: &strAt,
EndsAt: &endAt,
Comment: &testComment,
CreatedBy: &createdBy,
},
ID: &id,
UpdatedAt: &updAt,
Status: &open_api_models.SilenceStatus{
State: &state,
},
}
}
func TestGetSilencesHandler(t *testing.T) {
updateTime := "2019-01-01T12:00:00+00:00"
silences := []*open_api_models.GettableSilence{
gettableSilence("silence-6-expired", "expired", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T11:00:00+00:00"),
gettableSilence("silence-1-active", "active", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T13:00:00+00:00"),
gettableSilence("silence-7-expired", "expired", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T10:00:00+00:00"),
gettableSilence("silence-5-expired", "expired", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T12:00:00+00:00"),
gettableSilence("silence-0-active", "active", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T12:00:00+00:00"),
gettableSilence("silence-4-pending", "pending", updateTime,
"2019-01-01T13:00:00+00:00", "2019-01-01T12:00:00+00:00"),
gettableSilence("silence-3-pending", "pending", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T12:00:00+00:00"),
gettableSilence("silence-2-active", "active", updateTime,
"2019-01-01T12:00:00+00:00", "2019-01-01T14:00:00+00:00"),
}
SortSilences(open_api_models.GettableSilences(silences))
for i, sil := range silences {
assertEqualStrings(t, "silence-"+strconv.Itoa(i)+"-"+*sil.Status.State, *sil.ID)
}
}
func TestDeleteSilenceHandler(t *testing.T) {
now := timestamppb.Now()
silences := newSilences(t)
m := &silencepb.Matcher{Type: silencepb.Matcher_EQUAL, Name: "a", Pattern: "b"}
unexpiredSil := &silencepb.Silence{
MatcherSets: []*silencepb.MatcherSet{{
Matchers: []*silencepb.Matcher{m},
}},
StartsAt: now,
EndsAt: timestamppb.New(now.AsTime().Add(time.Hour)),
UpdatedAt: now,
}
require.NoError(t, silences.Set(t.Context(), unexpiredSil))
expiredSil := &silencepb.Silence{
MatcherSets: []*silencepb.MatcherSet{{
Matchers: []*silencepb.Matcher{m},
}},
StartsAt: timestamppb.New(now.AsTime().Add(-time.Hour)),
EndsAt: timestamppb.New(now.AsTime().Add(time.Hour)),
UpdatedAt: now,
}
require.NoError(t, silences.Set(t.Context(), expiredSil))
require.NoError(t, silences.Expire(t.Context(), expiredSil.Id))
for i, tc := range []struct {
sid string
expectedCode int
}{
{
"unknownSid",
404,
},
{
unexpiredSil.Id,
200,
},
{
expiredSil.Id,
200,
},
} {
api := API{
uptime: time.Now(),
silences: silences,
logger: promslog.NewNopLogger(),
}
r, err := http.NewRequest("DELETE", "/api/v2/silence/${tc.sid}", nil)
require.NoError(t, err)
w := httptest.NewRecorder()
p := runtime.TextProducer()
responder := api.deleteSilenceHandler(silence_ops.DeleteSilenceParams{
SilenceID: strfmt.UUID(tc.sid),
HTTPRequest: r,
})
responder.WriteResponse(w, p)
body, _ := io.ReadAll(w.Result().Body)
require.Equal(t, tc.expectedCode, w.Code, "test case: %d, response: %s", i, string(body))
}
}
func TestPostSilencesHandler(t *testing.T) {
now := timestamppb.Now()
silences := newSilences(t)
m := &silencepb.Matcher{Type: silencepb.Matcher_EQUAL, Name: "a", Pattern: "b"}
unexpiredSil := &silencepb.Silence{
MatcherSets: []*silencepb.MatcherSet{{
Matchers: []*silencepb.Matcher{m},
}},
StartsAt: now,
EndsAt: timestamppb.New(now.AsTime().Add(time.Hour)),
UpdatedAt: now,
}
require.NoError(t, silences.Set(t.Context(), unexpiredSil))
expiredSil := &silencepb.Silence{
MatcherSets: []*silencepb.MatcherSet{{
Matchers: []*silencepb.Matcher{m},
}},
StartsAt: timestamppb.New(now.AsTime().Add(-time.Hour)),
EndsAt: timestamppb.New(now.AsTime().Add(time.Hour)),
UpdatedAt: now,
}
require.NoError(t, silences.Set(t.Context(), expiredSil))
require.NoError(t, silences.Expire(t.Context(), expiredSil.Id))
t.Run("Silences CRUD", func(t *testing.T) {
for i, tc := range []struct {
name string
sid string
start, end time.Time
expectedCode int
}{
{
"with an non-existent silence ID - it returns 404",
"unknownSid",
now.AsTime().Add(time.Hour),
now.AsTime().Add(time.Hour * 2),
404,
},
{
"with no silence ID - it creates the silence",
"",
now.AsTime().Add(time.Hour),
now.AsTime().Add(time.Hour * 2),
200,
},
{
"with an active silence ID - it extends the silence",
unexpiredSil.Id,
now.AsTime().Add(time.Hour),
now.AsTime().Add(time.Hour * 2),
200,
},
{
"with an expired silence ID - it re-creates the silence",
expiredSil.Id,
now.AsTime().Add(time.Hour),
now.AsTime().Add(time.Hour * 2),
200,
},
} {
t.Run(tc.name, func(t *testing.T) {
api := API{
uptime: time.Now(),
silences: silences,
logger: promslog.NewNopLogger(),
}
sil := createSilence(t, tc.sid, "silenceCreator", tc.start, tc.end)
w := httptest.NewRecorder()
postSilences(t, w, api.postSilencesHandler, sil)
body, _ := io.ReadAll(w.Result().Body)
require.Equal(t, tc.expectedCode, w.Code, "test case: %d, response: %s", i, string(body))
})
}
})
}
func TestPostSilencesHandlerMissingIdCreatesSilence(t *testing.T) {
now := time.Now()
silences := newSilences(t)
api := API{
uptime: time.Now(),
silences: silences,
logger: promslog.NewNopLogger(),
}
// Create a new silence. It should be assigned a random UUID.
sil := createSilence(t, "", "silenceCreator", now.Add(tim
gitextract_cu_vryvw/
├── .dockerignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── config.yml
│ │ └── feature_request.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── ci.yml
│ ├── container_description.yml
│ ├── mixin.yml
│ ├── publish.yml
│ ├── release.yml
│ ├── stale.yml
│ └── ui-ci.yml
├── .gitignore
├── .golangci.yml
├── .promu.yml
├── .yamllint
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── COPYRIGHT.txt
├── Dockerfile
├── LICENSE
├── MAINTAINERS.md
├── Makefile
├── Makefile.common
├── NOTICE
├── Procfile
├── README.md
├── RELEASE.md
├── SECURITY.md
├── VERSION
├── alert/
│ ├── alert.go
│ ├── alert_test.go
│ ├── state.go
│ ├── status.go
│ ├── validate.go
│ └── validate_test.go
├── api/
│ ├── api.go
│ ├── metrics/
│ │ └── metrics.go
│ ├── v1_deprecation_router.go
│ └── v2/
│ ├── api.go
│ ├── api_test.go
│ ├── client/
│ │ ├── alert/
│ │ │ ├── alert_client.go
│ │ │ ├── get_alerts_parameters.go
│ │ │ ├── get_alerts_responses.go
│ │ │ ├── post_alerts_parameters.go
│ │ │ └── post_alerts_responses.go
│ │ ├── alertgroup/
│ │ │ ├── alertgroup_client.go
│ │ │ ├── get_alert_groups_parameters.go
│ │ │ └── get_alert_groups_responses.go
│ │ ├── alertmanager_api_client.go
│ │ ├── general/
│ │ │ ├── general_client.go
│ │ │ ├── get_status_parameters.go
│ │ │ └── get_status_responses.go
│ │ ├── receiver/
│ │ │ ├── get_receivers_parameters.go
│ │ │ ├── get_receivers_responses.go
│ │ │ └── receiver_client.go
│ │ └── silence/
│ │ ├── delete_silence_parameters.go
│ │ ├── delete_silence_responses.go
│ │ ├── get_silence_parameters.go
│ │ ├── get_silence_responses.go
│ │ ├── get_silences_parameters.go
│ │ ├── get_silences_responses.go
│ │ ├── post_silences_parameters.go
│ │ ├── post_silences_responses.go
│ │ └── silence_client.go
│ ├── compat.go
│ ├── models/
│ │ ├── alert.go
│ │ ├── alert_group.go
│ │ ├── alert_groups.go
│ │ ├── alert_status.go
│ │ ├── alertmanager_config.go
│ │ ├── alertmanager_status.go
│ │ ├── cluster_status.go
│ │ ├── gettable_alert.go
│ │ ├── gettable_alerts.go
│ │ ├── gettable_silence.go
│ │ ├── gettable_silences.go
│ │ ├── label_set.go
│ │ ├── matcher.go
│ │ ├── matchers.go
│ │ ├── peer_status.go
│ │ ├── postable_alert.go
│ │ ├── postable_alerts.go
│ │ ├── postable_silence.go
│ │ ├── receiver.go
│ │ ├── silence.go
│ │ ├── silence_status.go
│ │ └── version_info.go
│ ├── openapi.yaml
│ ├── restapi/
│ │ ├── configure_alertmanager.go
│ │ ├── doc.go
│ │ ├── embedded_spec.go
│ │ ├── operations/
│ │ │ ├── alert/
│ │ │ │ ├── get_alerts.go
│ │ │ │ ├── get_alerts_parameters.go
│ │ │ │ ├── get_alerts_responses.go
│ │ │ │ ├── get_alerts_urlbuilder.go
│ │ │ │ ├── post_alerts.go
│ │ │ │ ├── post_alerts_parameters.go
│ │ │ │ ├── post_alerts_responses.go
│ │ │ │ └── post_alerts_urlbuilder.go
│ │ │ ├── alertgroup/
│ │ │ │ ├── get_alert_groups.go
│ │ │ │ ├── get_alert_groups_parameters.go
│ │ │ │ ├── get_alert_groups_responses.go
│ │ │ │ └── get_alert_groups_urlbuilder.go
│ │ │ ├── alertmanager_api.go
│ │ │ ├── general/
│ │ │ │ ├── get_status.go
│ │ │ │ ├── get_status_parameters.go
│ │ │ │ ├── get_status_responses.go
│ │ │ │ └── get_status_urlbuilder.go
│ │ │ ├── receiver/
│ │ │ │ ├── get_receivers.go
│ │ │ │ ├── get_receivers_parameters.go
│ │ │ │ ├── get_receivers_responses.go
│ │ │ │ └── get_receivers_urlbuilder.go
│ │ │ └── silence/
│ │ │ ├── delete_silence.go
│ │ │ ├── delete_silence_parameters.go
│ │ │ ├── delete_silence_responses.go
│ │ │ ├── delete_silence_urlbuilder.go
│ │ │ ├── get_silence.go
│ │ │ ├── get_silence_parameters.go
│ │ │ ├── get_silence_responses.go
│ │ │ ├── get_silence_urlbuilder.go
│ │ │ ├── get_silences.go
│ │ │ ├── get_silences_parameters.go
│ │ │ ├── get_silences_responses.go
│ │ │ ├── get_silences_urlbuilder.go
│ │ │ ├── post_silences.go
│ │ │ ├── post_silences_parameters.go
│ │ │ ├── post_silences_responses.go
│ │ │ └── post_silences_urlbuilder.go
│ │ └── server.go
│ └── testing.go
├── buf.gen.yaml
├── buf.yaml
├── cli/
│ ├── alert.go
│ ├── alert_add.go
│ ├── alert_query.go
│ ├── check_config.go
│ ├── check_config_test.go
│ ├── cluster.go
│ ├── config/
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── http_config.go
│ │ └── testdata/
│ │ ├── amtool.bad.yml
│ │ ├── amtool.good1.yml
│ │ ├── amtool.good2.yml
│ │ ├── http_config.bad.yml
│ │ ├── http_config.basic_auth.good.yml
│ │ └── http_config.good.yml
│ ├── config.go
│ ├── format/
│ │ ├── format.go
│ │ ├── format_extended.go
│ │ ├── format_json.go
│ │ ├── format_simple.go
│ │ └── sort.go
│ ├── root.go
│ ├── routing.go
│ ├── silence.go
│ ├── silence_add.go
│ ├── silence_expire.go
│ ├── silence_import.go
│ ├── silence_query.go
│ ├── silence_update.go
│ ├── template.go
│ ├── template_render.go
│ ├── test_routing.go
│ ├── test_routing_test.go
│ ├── testdata/
│ │ ├── conf.bad.yml
│ │ ├── conf.good.yml
│ │ ├── conf.routing-reverted.yml
│ │ └── conf.routing.yml
│ └── utils.go
├── cluster/
│ ├── advertise.go
│ ├── advertise_test.go
│ ├── channel.go
│ ├── channel_test.go
│ ├── cluster.go
│ ├── cluster_test.go
│ ├── clusterpb/
│ │ ├── cluster.pb.go
│ │ └── cluster.proto
│ ├── connection_pool.go
│ ├── delegate.go
│ ├── testdata/
│ │ ├── certs/
│ │ │ ├── ca-config.json
│ │ │ ├── ca-csr.json
│ │ │ ├── ca-key.pem
│ │ │ ├── ca.csr
│ │ │ ├── ca.pem
│ │ │ ├── node1-csr.json
│ │ │ ├── node1-key.pem
│ │ │ ├── node1.csr
│ │ │ ├── node1.pem
│ │ │ ├── node2-csr.json
│ │ │ ├── node2-key.pem
│ │ │ ├── node2.csr
│ │ │ └── node2.pem
│ │ ├── empty_tls_config.yml
│ │ ├── tls_config_node1.yml
│ │ ├── tls_config_node2.yml
│ │ ├── tls_config_with_missing_client.yml
│ │ └── tls_config_with_missing_server.yml
│ ├── tls_config.go
│ ├── tls_connection.go
│ ├── tls_connection_test.go
│ ├── tls_transport.go
│ └── tls_transport_test.go
├── cmd/
│ ├── alertmanager/
│ │ ├── main.go
│ │ └── main_test.go
│ └── amtool/
│ ├── README.md
│ └── main.go
├── config/
│ ├── common/
│ │ ├── inhibitrule.go
│ │ ├── inhibitrule_test.go
│ │ ├── matchers.go
│ │ ├── matchers_test.go
│ │ ├── notifierconfig.go
│ │ ├── url.go
│ │ └── url_test.go
│ ├── config.go
│ ├── config_fuzz_test.go
│ ├── config_test.go
│ ├── coordinator.go
│ ├── coordinator_test.go
│ ├── notifiers.go
│ ├── notifiers_test.go
│ ├── receiver/
│ │ ├── receiver.go
│ │ └── receiver_test.go
│ └── testdata/
│ ├── conf.empty-fields.yml
│ ├── conf.good.yml
│ ├── conf.group-by-all.yml
│ ├── conf.http-config.good.yml
│ ├── conf.mattermost-both-webhook-url-and-file.yml
│ ├── conf.mattermost-default-webhook-url-file.yml
│ ├── conf.mattermost-default-webhook-url.yml
│ ├── conf.mattermost-no-webhook-url.yml
│ ├── conf.mattermost-valid-receiver-both-webhook-url-and-file.yml
│ ├── conf.nil-match_re-route.yml
│ ├── conf.nil-source_match_re-inhibition.yml
│ ├── conf.nil-target_match_re-inhibition.yml
│ ├── conf.opsgenie-both-file-and-apikey.yml
│ ├── conf.opsgenie-default-apikey-file.yml
│ ├── conf.opsgenie-default-apikey-old-team.yml
│ ├── conf.opsgenie-default-apikey.yml
│ ├── conf.opsgenie-no-apikey.yml
│ ├── conf.rocketchat-both-token-and-tokenfile.yml
│ ├── conf.rocketchat-both-tokenid-and-tokenidfile.yml
│ ├── conf.rocketchat-default-token-file.yml
│ ├── conf.rocketchat-default-token.yml
│ ├── conf.rocketchat-no-token.yml
│ ├── conf.slack-both-file-and-token.yml
│ ├── conf.slack-both-file-and-url.yml
│ ├── conf.slack-both-url-and-token.yml
│ ├── conf.slack-default-api-url-file.yml
│ ├── conf.slack-default-app-token.yml
│ ├── conf.slack-no-api-url-or-token.yml
│ ├── conf.slack-update-message-and-webhook.yml
│ ├── conf.smtp-both-password-and-file.yml
│ ├── conf.smtp-no-username-or-password.yml
│ ├── conf.smtp-password-global-and-local.yml
│ ├── conf.sns-invalid.yml
│ ├── conf.sns-topic-arn.yml
│ ├── conf.telegram-both-bot-token-and-file.yml
│ ├── conf.telegram-default-bot-token-file.yml
│ ├── conf.telegram-default-bot-token.yml
│ ├── conf.telegram-no-bot-token.yml
│ ├── conf.telegram-valid-receiver-both-bot-token-and-file.yml
│ ├── conf.victorops-both-file-and-apikey.yml
│ ├── conf.victorops-default-apikey-file.yml
│ ├── conf.victorops-default-apikey.yml
│ ├── conf.victorops-no-apikey.yml
│ ├── conf.wechat-both-file-and-secret.yml
│ ├── conf.wechat-default-api-secret-file.yml
│ └── conf.wechat-no-api-secret.yml
├── dispatch/
│ ├── dispatch.go
│ ├── dispatch_bench_test.go
│ ├── dispatch_test.go
│ ├── route.go
│ └── route_test.go
├── doc/
│ ├── alertmanager-mixin/
│ │ ├── .gitignore
│ │ ├── .lint
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── alerts.jsonnet
│ │ ├── alerts.libsonnet
│ │ ├── config.libsonnet
│ │ ├── dashboards/
│ │ │ └── overview.libsonnet
│ │ ├── dashboards.jsonnet
│ │ ├── dashboards.libsonnet
│ │ ├── jsonnetfile.json
│ │ ├── jsonnetfile.lock.json
│ │ └── mixin.libsonnet
│ ├── arch.xml
│ ├── design/
│ │ └── secure-cluster-traffic.md
│ └── examples/
│ └── simple.yml
├── docs/
│ ├── alertmanager.md
│ ├── alerts_api.md
│ ├── configuration.md
│ ├── high_availability.md
│ ├── https.md
│ ├── index.md
│ ├── integrations.md
│ ├── management_api.md
│ ├── notification_examples.md
│ ├── notifications.md
│ └── overview.md
├── examples/
│ ├── ha/
│ │ ├── send_alerts.sh
│ │ └── tls/
│ │ ├── Makefile
│ │ ├── Procfile
│ │ ├── README.md
│ │ ├── certs/
│ │ │ ├── ca-config.json
│ │ │ ├── ca-csr.json
│ │ │ ├── ca-key.pem
│ │ │ ├── ca.csr
│ │ │ ├── ca.pem
│ │ │ ├── node1-csr.json
│ │ │ ├── node1-key.pem
│ │ │ ├── node1.csr
│ │ │ ├── node1.pem
│ │ │ ├── node2-csr.json
│ │ │ ├── node2-key.pem
│ │ │ ├── node2.csr
│ │ │ └── node2.pem
│ │ ├── tls_config_node1.yml
│ │ └── tls_config_node2.yml
│ └── webhook/
│ ├── echo.go
│ └── teams.tmpl
├── featurecontrol/
│ ├── featurecontrol.go
│ └── featurecontrol_test.go
├── go.mod
├── go.sum
├── inhibit/
│ ├── index.go
│ ├── inhibit.go
│ ├── inhibit_bench_test.go
│ └── inhibit_test.go
├── internal/
│ └── tools/
│ ├── go.mod
│ └── go.sum
├── limit/
│ ├── bucket.go
│ └── bucket_test.go
├── matcher/
│ ├── compat/
│ │ ├── parse.go
│ │ └── parse_test.go
│ ├── compliance/
│ │ └── compliance_test.go
│ └── parse/
│ ├── bench_test.go
│ ├── fuzz_test.go
│ ├── lexer.go
│ ├── lexer_test.go
│ ├── parse.go
│ ├── parse_test.go
│ └── token.go
├── nflog/
│ ├── nflog.go
│ ├── nflog_test.go
│ └── nflogpb/
│ ├── nflog.pb.go
│ ├── nflog.proto
│ ├── set.go
│ └── set_test.go
├── notify/
│ ├── discord/
│ │ ├── discord.go
│ │ └── discord_test.go
│ ├── email/
│ │ ├── email.go
│ │ ├── email_test.go
│ │ └── testdata/
│ │ ├── auth-local.yml
│ │ ├── auth.yml
│ │ ├── noauth-local.yml
│ │ └── noauth.yml
│ ├── incidentio/
│ │ ├── incidentio.go
│ │ └── incidentio_test.go
│ ├── jira/
│ │ ├── jira.go
│ │ ├── jira_test.go
│ │ └── types.go
│ ├── mattermost/
│ │ ├── mattermost.go
│ │ └── mattermost_test.go
│ ├── msteams/
│ │ ├── msteams.go
│ │ └── msteams_test.go
│ ├── msteamsv2/
│ │ ├── msteamsv2.go
│ │ └── msteamsv2_test.go
│ ├── mute.go
│ ├── mute_test.go
│ ├── notify.go
│ ├── notify_test.go
│ ├── opsgenie/
│ │ ├── api_key_file
│ │ ├── opsgenie.go
│ │ └── opsgenie_test.go
│ ├── pagerduty/
│ │ ├── pagerduty.go
│ │ └── pagerduty_test.go
│ ├── pushover/
│ │ ├── pushover.go
│ │ └── pushover_test.go
│ ├── rocketchat/
│ │ ├── rocketchat.go
│ │ └── rocketchat_test.go
│ ├── slack/
│ │ ├── slack.go
│ │ └── slack_test.go
│ ├── sns/
│ │ ├── sns.go
│ │ └── sns_test.go
│ ├── telegram/
│ │ ├── telegram.go
│ │ └── telegram_test.go
│ ├── test/
│ │ └── test.go
│ ├── util.go
│ ├── util_test.go
│ ├── victorops/
│ │ ├── victorops.go
│ │ └── victorops_test.go
│ ├── webex/
│ │ ├── webex.go
│ │ └── webex_test.go
│ ├── webhook/
│ │ ├── webhook.go
│ │ └── webhook_test.go
│ └── wechat/
│ ├── wechat.go
│ └── wechat_test.go
├── pkg/
│ ├── README.md
│ ├── labels/
│ │ ├── matcher.go
│ │ ├── matcher_test.go
│ │ ├── parse.go
│ │ └── parse_test.go
│ └── modtimevfs/
│ └── modtimevfs.go
├── provider/
│ ├── mem/
│ │ ├── mem.go
│ │ └── mem_test.go
│ └── provider.go
├── scripts/
│ ├── genproto.sh
│ └── swagger.sh
├── silence/
│ ├── cache.go
│ ├── cache_test.go
│ ├── silence.go
│ ├── silence_bench_test.go
│ ├── silence_test.go
│ ├── silencepb/
│ │ ├── silence.pb.go
│ │ └── silence.proto
│ ├── state.go
│ └── state_test.go
├── store/
│ ├── store.go
│ └── store_test.go
├── template/
│ ├── Dockerfile
│ ├── Makefile
│ ├── default.tmpl
│ ├── email.html
│ ├── email.tmpl
│ ├── inline-css.js
│ ├── template.go
│ └── template_test.go
├── test/
│ ├── cli/
│ │ ├── acceptance/
│ │ │ └── cli_test.go
│ │ ├── acceptance.go
│ │ └── mock.go
│ ├── testutils/
│ │ ├── acceptance.go
│ │ ├── collector.go
│ │ └── mock.go
│ └── with_api_v2/
│ ├── acceptance/
│ │ ├── api_test.go
│ │ ├── cluster_test.go
│ │ ├── inhibit_test.go
│ │ ├── send_test.go
│ │ ├── silence_test.go
│ │ ├── utf8_test.go
│ │ └── web_test.go
│ ├── acceptance.go
│ └── mock.go
├── timeinterval/
│ ├── timeinterval.go
│ └── timeinterval_test.go
├── tracing/
│ ├── config.go
│ ├── http.go
│ ├── testdata/
│ │ └── ca.cer
│ ├── tracing.go
│ └── tracing_test.go
├── types/
│ ├── types.go
│ └── types_test.go
└── ui/
├── Dockerfile
├── app/
│ ├── .gitignore
│ ├── CONTRIBUTING.md
│ ├── Makefile
│ ├── README.md
│ ├── elm.json
│ ├── index.html
│ ├── lib/
│ │ ├── elm-datepicker/
│ │ │ └── css/
│ │ │ └── elm-datepicker.css
│ │ └── font-awesome-4.7.0/
│ │ ├── css/
│ │ │ └── font-awesome.css
│ │ └── fonts/
│ │ └── FontAwesome.otf
│ ├── review/
│ │ ├── elm.json
│ │ └── src/
│ │ └── ReviewConfig.elm
│ ├── script.js
│ ├── src/
│ │ ├── Alerts/
│ │ │ └── Api.elm
│ │ ├── Data/
│ │ │ ├── Alert.elm
│ │ │ ├── AlertGroup.elm
│ │ │ ├── AlertStatus.elm
│ │ │ ├── AlertmanagerConfig.elm
│ │ │ ├── AlertmanagerStatus.elm
│ │ │ ├── ClusterStatus.elm
│ │ │ ├── GettableAlert.elm
│ │ │ ├── GettableSilence.elm
│ │ │ ├── InlineResponse200.elm
│ │ │ ├── Matcher.elm
│ │ │ ├── PeerStatus.elm
│ │ │ ├── PostableAlert.elm
│ │ │ ├── PostableSilence.elm
│ │ │ ├── Receiver.elm
│ │ │ ├── Silence.elm
│ │ │ ├── SilenceStatus.elm
│ │ │ └── VersionInfo.elm
│ │ ├── DateTime.elm
│ │ ├── Main.elm
│ │ ├── Parsing.elm
│ │ ├── Silences/
│ │ │ ├── Api.elm
│ │ │ ├── Decoders.elm
│ │ │ └── Types.elm
│ │ ├── Status/
│ │ │ ├── Api.elm
│ │ │ └── Types.elm
│ │ ├── Types.elm
│ │ ├── Updates.elm
│ │ ├── Utils/
│ │ │ ├── Api.elm
│ │ │ ├── Date.elm
│ │ │ ├── DateTimePicker/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ ├── Utils.elm
│ │ │ │ └── Views.elm
│ │ │ ├── Filter.elm
│ │ │ ├── FormValidation.elm
│ │ │ ├── Keyboard.elm
│ │ │ ├── List.elm
│ │ │ ├── Match.elm
│ │ │ ├── String.elm
│ │ │ ├── Types.elm
│ │ │ └── Views.elm
│ │ ├── Views/
│ │ │ ├── AlertList/
│ │ │ │ ├── AlertView.elm
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── FilterBar/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── GroupBar/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── NavBar/
│ │ │ │ ├── Types.elm
│ │ │ │ └── Views.elm
│ │ │ ├── NotFound/
│ │ │ │ └── Views.elm
│ │ │ ├── ReceiverBar/
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── Settings/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── Shared/
│ │ │ │ ├── Alert.elm
│ │ │ │ ├── AlertCompact.elm
│ │ │ │ ├── AlertListCompact.elm
│ │ │ │ ├── Dialog.elm
│ │ │ │ ├── SilencePreview.elm
│ │ │ │ └── Types.elm
│ │ │ ├── SilenceForm/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── SilenceList/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── SilenceView.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ ├── SilenceView/
│ │ │ │ ├── Parsing.elm
│ │ │ │ ├── Types.elm
│ │ │ │ ├── Updates.elm
│ │ │ │ └── Views.elm
│ │ │ └── Status/
│ │ │ ├── Parsing.elm
│ │ │ ├── Types.elm
│ │ │ ├── Updates.elm
│ │ │ └── Views.elm
│ │ └── Views.elm
│ └── tests/
│ ├── Filter.elm
│ ├── Helpers.elm
│ ├── Match.elm
│ └── StringUtils.elm
├── mantine-ui/
│ ├── .gitignore
│ ├── .nvmrc
│ ├── .prettierrc.mjs
│ ├── .stylelintignore
│ ├── .stylelintrc.json
│ ├── eslint.config.js
│ ├── index.html
│ ├── package.json
│ ├── postcss.config.cjs
│ ├── src/
│ │ ├── App.tsx
│ │ ├── components/
│ │ │ ├── ErrorBoundary.tsx
│ │ │ ├── Header.module.css
│ │ │ ├── Header.tsx
│ │ │ ├── InfoPageCard.tsx
│ │ │ └── InfoPageStack.tsx
│ │ ├── data/
│ │ │ ├── api.ts
│ │ │ ├── groups.ts
│ │ │ ├── silences.ts
│ │ │ └── status.ts
│ │ ├── highlightjs.css
│ │ ├── main.tsx
│ │ ├── pages/
│ │ │ ├── Alerts.page.test.tsx
│ │ │ ├── Alerts.page.tsx
│ │ │ ├── Config.page.tsx
│ │ │ ├── Silences.page.tsx
│ │ │ └── Status.page.tsx
│ │ ├── theme.ts
│ │ └── vite-env.d.ts
│ ├── test-utils/
│ │ ├── index.ts
│ │ └── render.tsx
│ ├── tsconfig.json
│ ├── vite.config.mjs
│ └── vitest.setup.mjs
├── web.go
└── web_test.go
Showing preview only (321K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3564 symbols across 291 files)
FILE: alert/alert.go
type Alert (line 27) | type Alert struct
method Merge (line 38) | func (a *Alert) Merge(o *Alert) *Alert {
method Validate (line 68) | func (a *Alert) Validate() error {
type AlertSlice (line 88) | type AlertSlice
method Less (line 90) | func (as AlertSlice) Less(i, j int) bool {
method Swap (line 110) | func (as AlertSlice) Swap(i, j int) { as[i], as[j] = as[j], as[i] }
method Len (line 111) | func (as AlertSlice) Len() int { return len(as) }
function Alerts (line 115) | func Alerts(alerts ...*Alert) model.Alerts {
FILE: alert/alert_test.go
function TestAlertMerge (line 26) | func TestAlertMerge(t *testing.T) {
function TestAlertSliceSort (line 261) | func TestAlertSliceSort(t *testing.T) {
FILE: alert/state.go
type AlertState (line 17) | type AlertState
constant AlertStateUnprocessed (line 21) | AlertStateUnprocessed AlertState = "unprocessed"
constant AlertStateActive (line 22) | AlertStateActive AlertState = "active"
constant AlertStateSuppressed (line 23) | AlertStateSuppressed AlertState = "suppressed"
FILE: alert/status.go
type AlertStatus (line 22) | type AlertStatus struct
FILE: alert/validate.go
function validateLs (line 24) | func validateLs(ls model.LabelSet) error {
FILE: alert/validate_test.go
function TestValidateUTF8Ls (line 27) | func TestValidateUTF8Ls(t *testing.T) {
FILE: api/api.go
type API (line 43) | type API struct
method Register (line 176) | func (api *API) Register(r *route.Router, routePrefix string) *http.Se...
method Update (line 205) | func (api *API) Update(cfg *config.Config, setAlertStatus func(ctx con...
method limitHandler (line 209) | func (api *API) limitHandler(h http.Handler) http.Handler {
method instrumentHandler (line 237) | func (api *API) instrumentHandler(prefix string, h http.Handler) http....
type Options (line 57) | type Options struct
method validate (line 91) | func (o Options) validate() error {
function New (line 112) | func New(opts Options) (*API, error) {
FILE: api/metrics/metrics.go
type Alerts (line 22) | type Alerts struct
method Firing (line 52) | func (a *Alerts) Firing() prometheus.Counter { return a.firing }
method Resolved (line 55) | func (a *Alerts) Resolved() prometheus.Counter { return a.resolved }
method Invalid (line 58) | func (a *Alerts) Invalid() prometheus.Counter { return a.invalid }
function NewAlerts (line 30) | func NewAlerts(r prometheus.Registerer) *Alerts {
FILE: api/v1_deprecation_router.go
type V1DeprecationRouter (line 23) | type V1DeprecationRouter struct
method Register (line 35) | func (dr *V1DeprecationRouter) Register(r *route.Router) {
method deprecationHandler (line 48) | func (dr *V1DeprecationRouter) deprecationHandler(w http.ResponseWrite...
function NewV1DeprecationRouter (line 28) | func NewV1DeprecationRouter(l *slog.Logger) *V1DeprecationRouter {
FILE: api/v2/api.go
type API (line 62) | type API struct
method requestLogger (line 162) | func (api *API) requestLogger(req *http.Request) *slog.Logger {
method Update (line 167) | func (api *API) Update(cfg *config.Config, setAlertStatus setAlertStat...
method getStatusHandler (line 176) | func (api *API) getStatusHandler(params general_ops.GetStatusParams) m...
method getReceiversHandler (line 235) | func (api *API) getReceiversHandler(params receiver_ops.GetReceiversPa...
method getAlertsHandler (line 250) | func (api *API) getAlertsHandler(params alert_ops.GetAlertsParams) mid...
method postAlertsHandler (line 328) | func (api *API) postAlertsHandler(params alert_ops.PostAlertsParams) m...
method getAlertGroupsHandler (line 400) | func (api *API) getAlertGroupsHandler(params alertgroup_ops.GetAlertGr...
method alertFilter (line 472) | func (api *API) alertFilter(matchers []*labels.Matcher, silenced, inhi...
method getSilencesHandler (line 543) | func (api *API) getSilencesHandler(params silence_ops.GetSilencesParam...
method getSilenceHandler (line 652) | func (api *API) getSilenceHandler(params silence_ops.GetSilenceParams)...
method deleteSilenceHandler (line 678) | func (api *API) deleteSilenceHandler(params silence_ops.DeleteSilenceP...
method postSilencesHandler (line 695) | func (api *API) postSilencesHandler(params silence_ops.PostSilencesPar...
type groupsFn (line 86) | type groupsFn
type groupMutedFunc (line 87) | type groupMutedFunc
type getAlertStatusFn (line 88) | type getAlertStatusFn
type setAlertStatusFn (line 89) | type setAlertStatusFn
function NewAPI (line 93) | func NewAPI(
function setResponseHeaders (line 153) | func setResponseHeaders(h http.Handler) http.Handler {
function removeEmptyLabels (line 503) | func removeEmptyLabels(ls prometheus_model.LabelSet) {
function alertMatchesFilterLabels (line 511) | func alertMatchesFilterLabels(a *prometheus_model.Alert, matchers []*lab...
function matchFilterLabels (line 519) | func matchFilterLabels(matchers []*labels.Matcher, sms map[string]string...
function SortSilences (line 590) | func SortSilences(sils open_api_models.GettableSilences) {
function CheckSilenceMatchesFilterLabels (line 620) | func CheckSilenceMatchesFilterLabels(s *silencepb.Silence, matchers []*l...
function checkMatcherSetMatchesFilterLabels (line 630) | func checkMatcherSetMatchesFilterLabels(ms *silencepb.MatcherSet, matche...
function parseFilter (line 734) | func parseFilter(filter []string) ([]*labels.Matcher, error) {
function getSwaggerSpec (line 757) | func getSwaggerSpec() (*loads.Document, *analysis.Spec, error) {
FILE: api/v2/api_test.go
function TestGetStatusHandlerWithNilPeer (line 50) | func TestGetStatusHandlerWithNilPeer(t *testing.T) {
function assertEqualStrings (line 86) | func assertEqualStrings(t *testing.T, expected, actual string) {
function newSilences (line 97) | func newSilences(t *testing.T) *silence.Silences {
function gettableSilence (line 104) | func gettableSilence(id, state string,
function TestGetSilencesHandler (line 134) | func TestGetSilencesHandler(t *testing.T) {
function TestDeleteSilenceHandler (line 161) | func TestDeleteSilenceHandler(t *testing.T) {
function TestPostSilencesHandler (line 227) | func TestPostSilencesHandler(t *testing.T) {
function TestPostSilencesHandlerMissingIdCreatesSilence (line 307) | func TestPostSilencesHandlerMissingIdCreatesSilence(t *testing.T) {
function getSilences (line 357) | func getSilences(
function postSilences (line 373) | func postSilences(
function TestCheckSilenceMatchesFilterLabels (line 393) | func TestCheckSilenceMatchesFilterLabels(t *testing.T) {
function convertDateTime (line 485) | func convertDateTime(ts time.Time) *strfmt.DateTime {
function TestAlertToOpenAPIAlert (line 490) | func TestAlertToOpenAPIAlert(t *testing.T) {
function TestMatchFilterLabels (line 529) | func TestMatchFilterLabels(t *testing.T) {
function TestGetReceiversHandler (line 567) | func TestGetReceiversHandler(t *testing.T) {
function BenchmarkOpenAPIAlertsToAlerts (line 608) | func BenchmarkOpenAPIAlertsToAlerts(b *testing.B) {
function TestPostSilences_QuotedMatchers (line 647) | func TestPostSilences_QuotedMatchers(t *testing.T) {
FILE: api/v2/client/alert/alert_client.go
function New (line 31) | func New(transport runtime.ClientTransport, formats strfmt.Registry) Cli...
function NewClientWithBasicAuth (line 42) | func NewClientWithBasicAuth(host, basePath, scheme, user, password strin...
function NewClientWithBearerToken (line 54) | func NewClientWithBearerToken(host, basePath, scheme, bearerToken string...
type Client (line 63) | type Client struct
method GetAlerts (line 83) | func (a *Client) GetAlerts(params *GetAlertsParams, opts ...ClientOpti...
method PostAlerts (line 126) | func (a *Client) PostAlerts(params *PostAlertsParams, opts ...ClientOp...
method SetTransport (line 167) | func (a *Client) SetTransport(transport runtime.ClientTransport) {
type ClientOption (line 69) | type ClientOption
type ClientService (line 72) | type ClientService interface
FILE: api/v2/client/alert/get_alerts_parameters.go
function NewGetAlertsParams (line 40) | func NewGetAlertsParams() *GetAlertsParams {
function NewGetAlertsParamsWithTimeout (line 48) | func NewGetAlertsParamsWithTimeout(timeout time.Duration) *GetAlertsPara...
function NewGetAlertsParamsWithContext (line 56) | func NewGetAlertsParamsWithContext(ctx context.Context) *GetAlertsParams {
function NewGetAlertsParamsWithHTTPClient (line 64) | func NewGetAlertsParamsWithHTTPClient(client *http.Client) *GetAlertsPar...
type GetAlertsParams (line 77) | type GetAlertsParams struct
method WithDefaults (line 131) | func (o *GetAlertsParams) WithDefaults() *GetAlertsParams {
method SetDefaults (line 139) | func (o *GetAlertsParams) SetDefaults() {
method WithTimeout (line 164) | func (o *GetAlertsParams) WithTimeout(timeout time.Duration) *GetAlert...
method SetTimeout (line 170) | func (o *GetAlertsParams) SetTimeout(timeout time.Duration) {
method WithContext (line 175) | func (o *GetAlertsParams) WithContext(ctx context.Context) *GetAlertsP...
method SetContext (line 181) | func (o *GetAlertsParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 186) | func (o *GetAlertsParams) WithHTTPClient(client *http.Client) *GetAler...
method SetHTTPClient (line 192) | func (o *GetAlertsParams) SetHTTPClient(client *http.Client) {
method WithActive (line 197) | func (o *GetAlertsParams) WithActive(active *bool) *GetAlertsParams {
method SetActive (line 203) | func (o *GetAlertsParams) SetActive(active *bool) {
method WithFilter (line 208) | func (o *GetAlertsParams) WithFilter(filter []string) *GetAlertsParams {
method SetFilter (line 214) | func (o *GetAlertsParams) SetFilter(filter []string) {
method WithInhibited (line 219) | func (o *GetAlertsParams) WithInhibited(inhibited *bool) *GetAlertsPar...
method SetInhibited (line 225) | func (o *GetAlertsParams) SetInhibited(inhibited *bool) {
method WithReceiver (line 230) | func (o *GetAlertsParams) WithReceiver(receiver *string) *GetAlertsPar...
method SetReceiver (line 236) | func (o *GetAlertsParams) SetReceiver(receiver *string) {
method WithSilenced (line 241) | func (o *GetAlertsParams) WithSilenced(silenced *bool) *GetAlertsParams {
method SetSilenced (line 247) | func (o *GetAlertsParams) SetSilenced(silenced *bool) {
method WithUnprocessed (line 252) | func (o *GetAlertsParams) WithUnprocessed(unprocessed *bool) *GetAlert...
method SetUnprocessed (line 258) | func (o *GetAlertsParams) SetUnprocessed(unprocessed *bool) {
method WriteToRequest (line 263) | func (o *GetAlertsParams) WriteToRequest(r runtime.ClientRequest, reg ...
method bindParamFilter (line 373) | func (o *GetAlertsParams) bindParamFilter(formats strfmt.Registry) []s...
FILE: api/v2/client/alert/get_alerts_responses.go
type GetAlertsReader (line 35) | type GetAlertsReader struct
method ReadResponse (line 40) | func (o *GetAlertsReader) ReadResponse(response runtime.ClientResponse...
function NewGetAlertsOK (line 66) | func NewGetAlertsOK() *GetAlertsOK {
type GetAlertsOK (line 75) | type GetAlertsOK struct
method IsSuccess (line 80) | func (o *GetAlertsOK) IsSuccess() bool {
method IsRedirect (line 85) | func (o *GetAlertsOK) IsRedirect() bool {
method IsClientError (line 90) | func (o *GetAlertsOK) IsClientError() bool {
method IsServerError (line 95) | func (o *GetAlertsOK) IsServerError() bool {
method IsCode (line 100) | func (o *GetAlertsOK) IsCode(code int) bool {
method Code (line 105) | func (o *GetAlertsOK) Code() int {
method Error (line 109) | func (o *GetAlertsOK) Error() string {
method String (line 114) | func (o *GetAlertsOK) String() string {
method GetPayload (line 119) | func (o *GetAlertsOK) GetPayload() models.GettableAlerts {
method readResponse (line 123) | func (o *GetAlertsOK) readResponse(response runtime.ClientResponse, co...
function NewGetAlertsBadRequest (line 134) | func NewGetAlertsBadRequest() *GetAlertsBadRequest {
type GetAlertsBadRequest (line 143) | type GetAlertsBadRequest struct
method IsSuccess (line 148) | func (o *GetAlertsBadRequest) IsSuccess() bool {
method IsRedirect (line 153) | func (o *GetAlertsBadRequest) IsRedirect() bool {
method IsClientError (line 158) | func (o *GetAlertsBadRequest) IsClientError() bool {
method IsServerError (line 163) | func (o *GetAlertsBadRequest) IsServerError() bool {
method IsCode (line 168) | func (o *GetAlertsBadRequest) IsCode(code int) bool {
method Code (line 173) | func (o *GetAlertsBadRequest) Code() int {
method Error (line 177) | func (o *GetAlertsBadRequest) Error() string {
method String (line 182) | func (o *GetAlertsBadRequest) String() string {
method GetPayload (line 187) | func (o *GetAlertsBadRequest) GetPayload() string {
method readResponse (line 191) | func (o *GetAlertsBadRequest) readResponse(response runtime.ClientResp...
function NewGetAlertsInternalServerError (line 202) | func NewGetAlertsInternalServerError() *GetAlertsInternalServerError {
type GetAlertsInternalServerError (line 211) | type GetAlertsInternalServerError struct
method IsSuccess (line 216) | func (o *GetAlertsInternalServerError) IsSuccess() bool {
method IsRedirect (line 221) | func (o *GetAlertsInternalServerError) IsRedirect() bool {
method IsClientError (line 226) | func (o *GetAlertsInternalServerError) IsClientError() bool {
method IsServerError (line 231) | func (o *GetAlertsInternalServerError) IsServerError() bool {
method IsCode (line 236) | func (o *GetAlertsInternalServerError) IsCode(code int) bool {
method Code (line 241) | func (o *GetAlertsInternalServerError) Code() int {
method Error (line 245) | func (o *GetAlertsInternalServerError) Error() string {
method String (line 250) | func (o *GetAlertsInternalServerError) String() string {
method GetPayload (line 255) | func (o *GetAlertsInternalServerError) GetPayload() string {
method readResponse (line 259) | func (o *GetAlertsInternalServerError) readResponse(response runtime.C...
FILE: api/v2/client/alert/post_alerts_parameters.go
function NewPostAlertsParams (line 41) | func NewPostAlertsParams() *PostAlertsParams {
function NewPostAlertsParamsWithTimeout (line 49) | func NewPostAlertsParamsWithTimeout(timeout time.Duration) *PostAlertsPa...
function NewPostAlertsParamsWithContext (line 57) | func NewPostAlertsParamsWithContext(ctx context.Context) *PostAlertsPara...
function NewPostAlertsParamsWithHTTPClient (line 65) | func NewPostAlertsParamsWithHTTPClient(client *http.Client) *PostAlertsP...
type PostAlertsParams (line 78) | type PostAlertsParams struct
method WithDefaults (line 94) | func (o *PostAlertsParams) WithDefaults() *PostAlertsParams {
method SetDefaults (line 102) | func (o *PostAlertsParams) SetDefaults() {
method WithTimeout (line 107) | func (o *PostAlertsParams) WithTimeout(timeout time.Duration) *PostAle...
method SetTimeout (line 113) | func (o *PostAlertsParams) SetTimeout(timeout time.Duration) {
method WithContext (line 118) | func (o *PostAlertsParams) WithContext(ctx context.Context) *PostAlert...
method SetContext (line 124) | func (o *PostAlertsParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 129) | func (o *PostAlertsParams) WithHTTPClient(client *http.Client) *PostAl...
method SetHTTPClient (line 135) | func (o *PostAlertsParams) SetHTTPClient(client *http.Client) {
method WithAlerts (line 140) | func (o *PostAlertsParams) WithAlerts(alerts models.PostableAlerts) *P...
method SetAlerts (line 146) | func (o *PostAlertsParams) SetAlerts(alerts models.PostableAlerts) {
method WriteToRequest (line 151) | func (o *PostAlertsParams) WriteToRequest(r runtime.ClientRequest, reg...
FILE: api/v2/client/alert/post_alerts_responses.go
type PostAlertsReader (line 33) | type PostAlertsReader struct
method ReadResponse (line 38) | func (o *PostAlertsReader) ReadResponse(response runtime.ClientRespons...
function NewPostAlertsOK (line 64) | func NewPostAlertsOK() *PostAlertsOK {
type PostAlertsOK (line 73) | type PostAlertsOK struct
method IsSuccess (line 77) | func (o *PostAlertsOK) IsSuccess() bool {
method IsRedirect (line 82) | func (o *PostAlertsOK) IsRedirect() bool {
method IsClientError (line 87) | func (o *PostAlertsOK) IsClientError() bool {
method IsServerError (line 92) | func (o *PostAlertsOK) IsServerError() bool {
method IsCode (line 97) | func (o *PostAlertsOK) IsCode(code int) bool {
method Code (line 102) | func (o *PostAlertsOK) Code() int {
method Error (line 106) | func (o *PostAlertsOK) Error() string {
method String (line 110) | func (o *PostAlertsOK) String() string {
method readResponse (line 114) | func (o *PostAlertsOK) readResponse(response runtime.ClientResponse, c...
function NewPostAlertsBadRequest (line 120) | func NewPostAlertsBadRequest() *PostAlertsBadRequest {
type PostAlertsBadRequest (line 129) | type PostAlertsBadRequest struct
method IsSuccess (line 134) | func (o *PostAlertsBadRequest) IsSuccess() bool {
method IsRedirect (line 139) | func (o *PostAlertsBadRequest) IsRedirect() bool {
method IsClientError (line 144) | func (o *PostAlertsBadRequest) IsClientError() bool {
method IsServerError (line 149) | func (o *PostAlertsBadRequest) IsServerError() bool {
method IsCode (line 154) | func (o *PostAlertsBadRequest) IsCode(code int) bool {
method Code (line 159) | func (o *PostAlertsBadRequest) Code() int {
method Error (line 163) | func (o *PostAlertsBadRequest) Error() string {
method String (line 168) | func (o *PostAlertsBadRequest) String() string {
method GetPayload (line 173) | func (o *PostAlertsBadRequest) GetPayload() string {
method readResponse (line 177) | func (o *PostAlertsBadRequest) readResponse(response runtime.ClientRes...
function NewPostAlertsInternalServerError (line 188) | func NewPostAlertsInternalServerError() *PostAlertsInternalServerError {
type PostAlertsInternalServerError (line 197) | type PostAlertsInternalServerError struct
method IsSuccess (line 202) | func (o *PostAlertsInternalServerError) IsSuccess() bool {
method IsRedirect (line 207) | func (o *PostAlertsInternalServerError) IsRedirect() bool {
method IsClientError (line 212) | func (o *PostAlertsInternalServerError) IsClientError() bool {
method IsServerError (line 217) | func (o *PostAlertsInternalServerError) IsServerError() bool {
method IsCode (line 222) | func (o *PostAlertsInternalServerError) IsCode(code int) bool {
method Code (line 227) | func (o *PostAlertsInternalServerError) Code() int {
method Error (line 231) | func (o *PostAlertsInternalServerError) Error() string {
method String (line 236) | func (o *PostAlertsInternalServerError) String() string {
method GetPayload (line 241) | func (o *PostAlertsInternalServerError) GetPayload() string {
method readResponse (line 245) | func (o *PostAlertsInternalServerError) readResponse(response runtime....
FILE: api/v2/client/alertgroup/alertgroup_client.go
function New (line 31) | func New(transport runtime.ClientTransport, formats strfmt.Registry) Cli...
function NewClientWithBasicAuth (line 42) | func NewClientWithBasicAuth(host, basePath, scheme, user, password strin...
function NewClientWithBearerToken (line 54) | func NewClientWithBearerToken(host, basePath, scheme, bearerToken string...
type Client (line 63) | type Client struct
method GetAlertGroups (line 81) | func (a *Client) GetAlertGroups(params *GetAlertGroupsParams, opts ......
method SetTransport (line 122) | func (a *Client) SetTransport(transport runtime.ClientTransport) {
type ClientOption (line 69) | type ClientOption
type ClientService (line 72) | type ClientService interface
FILE: api/v2/client/alertgroup/get_alert_groups_parameters.go
function NewGetAlertGroupsParams (line 40) | func NewGetAlertGroupsParams() *GetAlertGroupsParams {
function NewGetAlertGroupsParamsWithTimeout (line 48) | func NewGetAlertGroupsParamsWithTimeout(timeout time.Duration) *GetAlert...
function NewGetAlertGroupsParamsWithContext (line 56) | func NewGetAlertGroupsParamsWithContext(ctx context.Context) *GetAlertGr...
function NewGetAlertGroupsParamsWithHTTPClient (line 64) | func NewGetAlertGroupsParamsWithHTTPClient(client *http.Client) *GetAler...
type GetAlertGroupsParams (line 77) | type GetAlertGroupsParams struct
method WithDefaults (line 131) | func (o *GetAlertGroupsParams) WithDefaults() *GetAlertGroupsParams {
method SetDefaults (line 139) | func (o *GetAlertGroupsParams) SetDefaults() {
method WithTimeout (line 164) | func (o *GetAlertGroupsParams) WithTimeout(timeout time.Duration) *Get...
method SetTimeout (line 170) | func (o *GetAlertGroupsParams) SetTimeout(timeout time.Duration) {
method WithContext (line 175) | func (o *GetAlertGroupsParams) WithContext(ctx context.Context) *GetAl...
method SetContext (line 181) | func (o *GetAlertGroupsParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 186) | func (o *GetAlertGroupsParams) WithHTTPClient(client *http.Client) *Ge...
method SetHTTPClient (line 192) | func (o *GetAlertGroupsParams) SetHTTPClient(client *http.Client) {
method WithActive (line 197) | func (o *GetAlertGroupsParams) WithActive(active *bool) *GetAlertGroup...
method SetActive (line 203) | func (o *GetAlertGroupsParams) SetActive(active *bool) {
method WithFilter (line 208) | func (o *GetAlertGroupsParams) WithFilter(filter []string) *GetAlertGr...
method SetFilter (line 214) | func (o *GetAlertGroupsParams) SetFilter(filter []string) {
method WithInhibited (line 219) | func (o *GetAlertGroupsParams) WithInhibited(inhibited *bool) *GetAler...
method SetInhibited (line 225) | func (o *GetAlertGroupsParams) SetInhibited(inhibited *bool) {
method WithMuted (line 230) | func (o *GetAlertGroupsParams) WithMuted(muted *bool) *GetAlertGroupsP...
method SetMuted (line 236) | func (o *GetAlertGroupsParams) SetMuted(muted *bool) {
method WithReceiver (line 241) | func (o *GetAlertGroupsParams) WithReceiver(receiver *string) *GetAler...
method SetReceiver (line 247) | func (o *GetAlertGroupsParams) SetReceiver(receiver *string) {
method WithSilenced (line 252) | func (o *GetAlertGroupsParams) WithSilenced(silenced *bool) *GetAlertG...
method SetSilenced (line 258) | func (o *GetAlertGroupsParams) SetSilenced(silenced *bool) {
method WriteToRequest (line 263) | func (o *GetAlertGroupsParams) WriteToRequest(r runtime.ClientRequest,...
method bindParamFilter (line 373) | func (o *GetAlertGroupsParams) bindParamFilter(formats strfmt.Registry...
FILE: api/v2/client/alertgroup/get_alert_groups_responses.go
type GetAlertGroupsReader (line 35) | type GetAlertGroupsReader struct
method ReadResponse (line 40) | func (o *GetAlertGroupsReader) ReadResponse(response runtime.ClientRes...
function NewGetAlertGroupsOK (line 66) | func NewGetAlertGroupsOK() *GetAlertGroupsOK {
type GetAlertGroupsOK (line 75) | type GetAlertGroupsOK struct
method IsSuccess (line 80) | func (o *GetAlertGroupsOK) IsSuccess() bool {
method IsRedirect (line 85) | func (o *GetAlertGroupsOK) IsRedirect() bool {
method IsClientError (line 90) | func (o *GetAlertGroupsOK) IsClientError() bool {
method IsServerError (line 95) | func (o *GetAlertGroupsOK) IsServerError() bool {
method IsCode (line 100) | func (o *GetAlertGroupsOK) IsCode(code int) bool {
method Code (line 105) | func (o *GetAlertGroupsOK) Code() int {
method Error (line 109) | func (o *GetAlertGroupsOK) Error() string {
method String (line 114) | func (o *GetAlertGroupsOK) String() string {
method GetPayload (line 119) | func (o *GetAlertGroupsOK) GetPayload() models.AlertGroups {
method readResponse (line 123) | func (o *GetAlertGroupsOK) readResponse(response runtime.ClientRespons...
function NewGetAlertGroupsBadRequest (line 134) | func NewGetAlertGroupsBadRequest() *GetAlertGroupsBadRequest {
type GetAlertGroupsBadRequest (line 143) | type GetAlertGroupsBadRequest struct
method IsSuccess (line 148) | func (o *GetAlertGroupsBadRequest) IsSuccess() bool {
method IsRedirect (line 153) | func (o *GetAlertGroupsBadRequest) IsRedirect() bool {
method IsClientError (line 158) | func (o *GetAlertGroupsBadRequest) IsClientError() bool {
method IsServerError (line 163) | func (o *GetAlertGroupsBadRequest) IsServerError() bool {
method IsCode (line 168) | func (o *GetAlertGroupsBadRequest) IsCode(code int) bool {
method Code (line 173) | func (o *GetAlertGroupsBadRequest) Code() int {
method Error (line 177) | func (o *GetAlertGroupsBadRequest) Error() string {
method String (line 182) | func (o *GetAlertGroupsBadRequest) String() string {
method GetPayload (line 187) | func (o *GetAlertGroupsBadRequest) GetPayload() string {
method readResponse (line 191) | func (o *GetAlertGroupsBadRequest) readResponse(response runtime.Clien...
function NewGetAlertGroupsInternalServerError (line 202) | func NewGetAlertGroupsInternalServerError() *GetAlertGroupsInternalServe...
type GetAlertGroupsInternalServerError (line 211) | type GetAlertGroupsInternalServerError struct
method IsSuccess (line 216) | func (o *GetAlertGroupsInternalServerError) IsSuccess() bool {
method IsRedirect (line 221) | func (o *GetAlertGroupsInternalServerError) IsRedirect() bool {
method IsClientError (line 226) | func (o *GetAlertGroupsInternalServerError) IsClientError() bool {
method IsServerError (line 231) | func (o *GetAlertGroupsInternalServerError) IsServerError() bool {
method IsCode (line 236) | func (o *GetAlertGroupsInternalServerError) IsCode(code int) bool {
method Code (line 241) | func (o *GetAlertGroupsInternalServerError) Code() int {
method Error (line 245) | func (o *GetAlertGroupsInternalServerError) Error() string {
method String (line 250) | func (o *GetAlertGroupsInternalServerError) String() string {
method GetPayload (line 255) | func (o *GetAlertGroupsInternalServerError) GetPayload() string {
method readResponse (line 259) | func (o *GetAlertGroupsInternalServerError) readResponse(response runt...
FILE: api/v2/client/alertmanager_api_client.go
constant DefaultHost (line 40) | DefaultHost string = "localhost"
constant DefaultBasePath (line 43) | DefaultBasePath string = "/api/v2/"
function NewHTTPClient (line 50) | func NewHTTPClient(formats strfmt.Registry) *AlertmanagerAPI {
function NewHTTPClientWithConfig (line 56) | func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConf...
function New (line 68) | func New(transport runtime.ClientTransport, formats strfmt.Registry) *Al...
function DefaultTransportConfig (line 86) | func DefaultTransportConfig() *TransportConfig {
type TransportConfig (line 96) | type TransportConfig struct
method WithHost (line 104) | func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
method WithBasePath (line 111) | func (cfg *TransportConfig) WithBasePath(basePath string) *TransportCo...
method WithSchemes (line 118) | func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportCo...
type AlertmanagerAPI (line 124) | type AlertmanagerAPI struct
method SetTransport (line 139) | func (c *AlertmanagerAPI) SetTransport(transport runtime.ClientTranspo...
FILE: api/v2/client/general/general_client.go
function New (line 31) | func New(transport runtime.ClientTransport, formats strfmt.Registry) Cli...
function NewClientWithBasicAuth (line 42) | func NewClientWithBasicAuth(host, basePath, scheme, user, password strin...
function NewClientWithBearerToken (line 54) | func NewClientWithBearerToken(host, basePath, scheme, bearerToken string...
type Client (line 63) | type Client struct
method GetStatus (line 81) | func (a *Client) GetStatus(params *GetStatusParams, opts ...ClientOpti...
method SetTransport (line 122) | func (a *Client) SetTransport(transport runtime.ClientTransport) {
type ClientOption (line 69) | type ClientOption
type ClientService (line 72) | type ClientService interface
FILE: api/v2/client/general/get_status_parameters.go
function NewGetStatusParams (line 39) | func NewGetStatusParams() *GetStatusParams {
function NewGetStatusParamsWithTimeout (line 47) | func NewGetStatusParamsWithTimeout(timeout time.Duration) *GetStatusPara...
function NewGetStatusParamsWithContext (line 55) | func NewGetStatusParamsWithContext(ctx context.Context) *GetStatusParams {
function NewGetStatusParamsWithHTTPClient (line 63) | func NewGetStatusParamsWithHTTPClient(client *http.Client) *GetStatusPar...
type GetStatusParams (line 76) | type GetStatusParams struct
method WithDefaults (line 85) | func (o *GetStatusParams) WithDefaults() *GetStatusParams {
method SetDefaults (line 93) | func (o *GetStatusParams) SetDefaults() {
method WithTimeout (line 98) | func (o *GetStatusParams) WithTimeout(timeout time.Duration) *GetStatu...
method SetTimeout (line 104) | func (o *GetStatusParams) SetTimeout(timeout time.Duration) {
method WithContext (line 109) | func (o *GetStatusParams) WithContext(ctx context.Context) *GetStatusP...
method SetContext (line 115) | func (o *GetStatusParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 120) | func (o *GetStatusParams) WithHTTPClient(client *http.Client) *GetStat...
method SetHTTPClient (line 126) | func (o *GetStatusParams) SetHTTPClient(client *http.Client) {
method WriteToRequest (line 131) | func (o *GetStatusParams) WriteToRequest(r runtime.ClientRequest, reg ...
FILE: api/v2/client/general/get_status_responses.go
type GetStatusReader (line 35) | type GetStatusReader struct
method ReadResponse (line 40) | func (o *GetStatusReader) ReadResponse(response runtime.ClientResponse...
function NewGetStatusOK (line 54) | func NewGetStatusOK() *GetStatusOK {
type GetStatusOK (line 63) | type GetStatusOK struct
method IsSuccess (line 68) | func (o *GetStatusOK) IsSuccess() bool {
method IsRedirect (line 73) | func (o *GetStatusOK) IsRedirect() bool {
method IsClientError (line 78) | func (o *GetStatusOK) IsClientError() bool {
method IsServerError (line 83) | func (o *GetStatusOK) IsServerError() bool {
method IsCode (line 88) | func (o *GetStatusOK) IsCode(code int) bool {
method Code (line 93) | func (o *GetStatusOK) Code() int {
method Error (line 97) | func (o *GetStatusOK) Error() string {
method String (line 102) | func (o *GetStatusOK) String() string {
method GetPayload (line 107) | func (o *GetStatusOK) GetPayload() *models.AlertmanagerStatus {
method readResponse (line 111) | func (o *GetStatusOK) readResponse(response runtime.ClientResponse, co...
FILE: api/v2/client/receiver/get_receivers_parameters.go
function NewGetReceiversParams (line 39) | func NewGetReceiversParams() *GetReceiversParams {
function NewGetReceiversParamsWithTimeout (line 47) | func NewGetReceiversParamsWithTimeout(timeout time.Duration) *GetReceive...
function NewGetReceiversParamsWithContext (line 55) | func NewGetReceiversParamsWithContext(ctx context.Context) *GetReceivers...
function NewGetReceiversParamsWithHTTPClient (line 63) | func NewGetReceiversParamsWithHTTPClient(client *http.Client) *GetReceiv...
type GetReceiversParams (line 76) | type GetReceiversParams struct
method WithDefaults (line 85) | func (o *GetReceiversParams) WithDefaults() *GetReceiversParams {
method SetDefaults (line 93) | func (o *GetReceiversParams) SetDefaults() {
method WithTimeout (line 98) | func (o *GetReceiversParams) WithTimeout(timeout time.Duration) *GetRe...
method SetTimeout (line 104) | func (o *GetReceiversParams) SetTimeout(timeout time.Duration) {
method WithContext (line 109) | func (o *GetReceiversParams) WithContext(ctx context.Context) *GetRece...
method SetContext (line 115) | func (o *GetReceiversParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 120) | func (o *GetReceiversParams) WithHTTPClient(client *http.Client) *GetR...
method SetHTTPClient (line 126) | func (o *GetReceiversParams) SetHTTPClient(client *http.Client) {
method WriteToRequest (line 131) | func (o *GetReceiversParams) WriteToRequest(r runtime.ClientRequest, r...
FILE: api/v2/client/receiver/get_receivers_responses.go
type GetReceiversReader (line 35) | type GetReceiversReader struct
method ReadResponse (line 40) | func (o *GetReceiversReader) ReadResponse(response runtime.ClientRespo...
function NewGetReceiversOK (line 54) | func NewGetReceiversOK() *GetReceiversOK {
type GetReceiversOK (line 63) | type GetReceiversOK struct
method IsSuccess (line 68) | func (o *GetReceiversOK) IsSuccess() bool {
method IsRedirect (line 73) | func (o *GetReceiversOK) IsRedirect() bool {
method IsClientError (line 78) | func (o *GetReceiversOK) IsClientError() bool {
method IsServerError (line 83) | func (o *GetReceiversOK) IsServerError() bool {
method IsCode (line 88) | func (o *GetReceiversOK) IsCode(code int) bool {
method Code (line 93) | func (o *GetReceiversOK) Code() int {
method Error (line 97) | func (o *GetReceiversOK) Error() string {
method String (line 102) | func (o *GetReceiversOK) String() string {
method GetPayload (line 107) | func (o *GetReceiversOK) GetPayload() []*models.Receiver {
method readResponse (line 111) | func (o *GetReceiversOK) readResponse(response runtime.ClientResponse,...
FILE: api/v2/client/receiver/receiver_client.go
function New (line 31) | func New(transport runtime.ClientTransport, formats strfmt.Registry) Cli...
function NewClientWithBasicAuth (line 42) | func NewClientWithBasicAuth(host, basePath, scheme, user, password strin...
function NewClientWithBearerToken (line 54) | func NewClientWithBearerToken(host, basePath, scheme, bearerToken string...
type Client (line 63) | type Client struct
method GetReceivers (line 81) | func (a *Client) GetReceivers(params *GetReceiversParams, opts ...Clie...
method SetTransport (line 122) | func (a *Client) SetTransport(transport runtime.ClientTransport) {
type ClientOption (line 69) | type ClientOption
type ClientService (line 72) | type ClientService interface
FILE: api/v2/client/silence/delete_silence_parameters.go
function NewDeleteSilenceParams (line 39) | func NewDeleteSilenceParams() *DeleteSilenceParams {
function NewDeleteSilenceParamsWithTimeout (line 47) | func NewDeleteSilenceParamsWithTimeout(timeout time.Duration) *DeleteSil...
function NewDeleteSilenceParamsWithContext (line 55) | func NewDeleteSilenceParamsWithContext(ctx context.Context) *DeleteSilen...
function NewDeleteSilenceParamsWithHTTPClient (line 63) | func NewDeleteSilenceParamsWithHTTPClient(client *http.Client) *DeleteSi...
type DeleteSilenceParams (line 76) | type DeleteSilenceParams struct
method WithDefaults (line 94) | func (o *DeleteSilenceParams) WithDefaults() *DeleteSilenceParams {
method SetDefaults (line 102) | func (o *DeleteSilenceParams) SetDefaults() {
method WithTimeout (line 107) | func (o *DeleteSilenceParams) WithTimeout(timeout time.Duration) *Dele...
method SetTimeout (line 113) | func (o *DeleteSilenceParams) SetTimeout(timeout time.Duration) {
method WithContext (line 118) | func (o *DeleteSilenceParams) WithContext(ctx context.Context) *Delete...
method SetContext (line 124) | func (o *DeleteSilenceParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 129) | func (o *DeleteSilenceParams) WithHTTPClient(client *http.Client) *Del...
method SetHTTPClient (line 135) | func (o *DeleteSilenceParams) SetHTTPClient(client *http.Client) {
method WithSilenceID (line 140) | func (o *DeleteSilenceParams) WithSilenceID(silenceID strfmt.UUID) *De...
method SetSilenceID (line 146) | func (o *DeleteSilenceParams) SetSilenceID(silenceID strfmt.UUID) {
method WriteToRequest (line 151) | func (o *DeleteSilenceParams) WriteToRequest(r runtime.ClientRequest, ...
FILE: api/v2/client/silence/delete_silence_responses.go
type DeleteSilenceReader (line 33) | type DeleteSilenceReader struct
method ReadResponse (line 38) | func (o *DeleteSilenceReader) ReadResponse(response runtime.ClientResp...
function NewDeleteSilenceOK (line 64) | func NewDeleteSilenceOK() *DeleteSilenceOK {
type DeleteSilenceOK (line 73) | type DeleteSilenceOK struct
method IsSuccess (line 77) | func (o *DeleteSilenceOK) IsSuccess() bool {
method IsRedirect (line 82) | func (o *DeleteSilenceOK) IsRedirect() bool {
method IsClientError (line 87) | func (o *DeleteSilenceOK) IsClientError() bool {
method IsServerError (line 92) | func (o *DeleteSilenceOK) IsServerError() bool {
method IsCode (line 97) | func (o *DeleteSilenceOK) IsCode(code int) bool {
method Code (line 102) | func (o *DeleteSilenceOK) Code() int {
method Error (line 106) | func (o *DeleteSilenceOK) Error() string {
method String (line 110) | func (o *DeleteSilenceOK) String() string {
method readResponse (line 114) | func (o *DeleteSilenceOK) readResponse(response runtime.ClientResponse...
function NewDeleteSilenceNotFound (line 120) | func NewDeleteSilenceNotFound() *DeleteSilenceNotFound {
type DeleteSilenceNotFound (line 129) | type DeleteSilenceNotFound struct
method IsSuccess (line 133) | func (o *DeleteSilenceNotFound) IsSuccess() bool {
method IsRedirect (line 138) | func (o *DeleteSilenceNotFound) IsRedirect() bool {
method IsClientError (line 143) | func (o *DeleteSilenceNotFound) IsClientError() bool {
method IsServerError (line 148) | func (o *DeleteSilenceNotFound) IsServerError() bool {
method IsCode (line 153) | func (o *DeleteSilenceNotFound) IsCode(code int) bool {
method Code (line 158) | func (o *DeleteSilenceNotFound) Code() int {
method Error (line 162) | func (o *DeleteSilenceNotFound) Error() string {
method String (line 166) | func (o *DeleteSilenceNotFound) String() string {
method readResponse (line 170) | func (o *DeleteSilenceNotFound) readResponse(response runtime.ClientRe...
function NewDeleteSilenceInternalServerError (line 176) | func NewDeleteSilenceInternalServerError() *DeleteSilenceInternalServerE...
type DeleteSilenceInternalServerError (line 185) | type DeleteSilenceInternalServerError struct
method IsSuccess (line 190) | func (o *DeleteSilenceInternalServerError) IsSuccess() bool {
method IsRedirect (line 195) | func (o *DeleteSilenceInternalServerError) IsRedirect() bool {
method IsClientError (line 200) | func (o *DeleteSilenceInternalServerError) IsClientError() bool {
method IsServerError (line 205) | func (o *DeleteSilenceInternalServerError) IsServerError() bool {
method IsCode (line 210) | func (o *DeleteSilenceInternalServerError) IsCode(code int) bool {
method Code (line 215) | func (o *DeleteSilenceInternalServerError) Code() int {
method Error (line 219) | func (o *DeleteSilenceInternalServerError) Error() string {
method String (line 224) | func (o *DeleteSilenceInternalServerError) String() string {
method GetPayload (line 229) | func (o *DeleteSilenceInternalServerError) GetPayload() string {
method readResponse (line 233) | func (o *DeleteSilenceInternalServerError) readResponse(response runti...
FILE: api/v2/client/silence/get_silence_parameters.go
function NewGetSilenceParams (line 39) | func NewGetSilenceParams() *GetSilenceParams {
function NewGetSilenceParamsWithTimeout (line 47) | func NewGetSilenceParamsWithTimeout(timeout time.Duration) *GetSilencePa...
function NewGetSilenceParamsWithContext (line 55) | func NewGetSilenceParamsWithContext(ctx context.Context) *GetSilencePara...
function NewGetSilenceParamsWithHTTPClient (line 63) | func NewGetSilenceParamsWithHTTPClient(client *http.Client) *GetSilenceP...
type GetSilenceParams (line 76) | type GetSilenceParams struct
method WithDefaults (line 94) | func (o *GetSilenceParams) WithDefaults() *GetSilenceParams {
method SetDefaults (line 102) | func (o *GetSilenceParams) SetDefaults() {
method WithTimeout (line 107) | func (o *GetSilenceParams) WithTimeout(timeout time.Duration) *GetSile...
method SetTimeout (line 113) | func (o *GetSilenceParams) SetTimeout(timeout time.Duration) {
method WithContext (line 118) | func (o *GetSilenceParams) WithContext(ctx context.Context) *GetSilenc...
method SetContext (line 124) | func (o *GetSilenceParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 129) | func (o *GetSilenceParams) WithHTTPClient(client *http.Client) *GetSil...
method SetHTTPClient (line 135) | func (o *GetSilenceParams) SetHTTPClient(client *http.Client) {
method WithSilenceID (line 140) | func (o *GetSilenceParams) WithSilenceID(silenceID strfmt.UUID) *GetSi...
method SetSilenceID (line 146) | func (o *GetSilenceParams) SetSilenceID(silenceID strfmt.UUID) {
method WriteToRequest (line 151) | func (o *GetSilenceParams) WriteToRequest(r runtime.ClientRequest, reg...
FILE: api/v2/client/silence/get_silence_responses.go
type GetSilenceReader (line 35) | type GetSilenceReader struct
method ReadResponse (line 40) | func (o *GetSilenceReader) ReadResponse(response runtime.ClientRespons...
function NewGetSilenceOK (line 66) | func NewGetSilenceOK() *GetSilenceOK {
type GetSilenceOK (line 75) | type GetSilenceOK struct
method IsSuccess (line 80) | func (o *GetSilenceOK) IsSuccess() bool {
method IsRedirect (line 85) | func (o *GetSilenceOK) IsRedirect() bool {
method IsClientError (line 90) | func (o *GetSilenceOK) IsClientError() bool {
method IsServerError (line 95) | func (o *GetSilenceOK) IsServerError() bool {
method IsCode (line 100) | func (o *GetSilenceOK) IsCode(code int) bool {
method Code (line 105) | func (o *GetSilenceOK) Code() int {
method Error (line 109) | func (o *GetSilenceOK) Error() string {
method String (line 114) | func (o *GetSilenceOK) String() string {
method GetPayload (line 119) | func (o *GetSilenceOK) GetPayload() *models.GettableSilence {
method readResponse (line 123) | func (o *GetSilenceOK) readResponse(response runtime.ClientResponse, c...
function NewGetSilenceNotFound (line 136) | func NewGetSilenceNotFound() *GetSilenceNotFound {
type GetSilenceNotFound (line 145) | type GetSilenceNotFound struct
method IsSuccess (line 149) | func (o *GetSilenceNotFound) IsSuccess() bool {
method IsRedirect (line 154) | func (o *GetSilenceNotFound) IsRedirect() bool {
method IsClientError (line 159) | func (o *GetSilenceNotFound) IsClientError() bool {
method IsServerError (line 164) | func (o *GetSilenceNotFound) IsServerError() bool {
method IsCode (line 169) | func (o *GetSilenceNotFound) IsCode(code int) bool {
method Code (line 174) | func (o *GetSilenceNotFound) Code() int {
method Error (line 178) | func (o *GetSilenceNotFound) Error() string {
method String (line 182) | func (o *GetSilenceNotFound) String() string {
method readResponse (line 186) | func (o *GetSilenceNotFound) readResponse(response runtime.ClientRespo...
function NewGetSilenceInternalServerError (line 192) | func NewGetSilenceInternalServerError() *GetSilenceInternalServerError {
type GetSilenceInternalServerError (line 201) | type GetSilenceInternalServerError struct
method IsSuccess (line 206) | func (o *GetSilenceInternalServerError) IsSuccess() bool {
method IsRedirect (line 211) | func (o *GetSilenceInternalServerError) IsRedirect() bool {
method IsClientError (line 216) | func (o *GetSilenceInternalServerError) IsClientError() bool {
method IsServerError (line 221) | func (o *GetSilenceInternalServerError) IsServerError() bool {
method IsCode (line 226) | func (o *GetSilenceInternalServerError) IsCode(code int) bool {
method Code (line 231) | func (o *GetSilenceInternalServerError) Code() int {
method Error (line 235) | func (o *GetSilenceInternalServerError) Error() string {
method String (line 240) | func (o *GetSilenceInternalServerError) String() string {
method GetPayload (line 245) | func (o *GetSilenceInternalServerError) GetPayload() string {
method readResponse (line 249) | func (o *GetSilenceInternalServerError) readResponse(response runtime....
FILE: api/v2/client/silence/get_silences_parameters.go
function NewGetSilencesParams (line 40) | func NewGetSilencesParams() *GetSilencesParams {
function NewGetSilencesParamsWithTimeout (line 48) | func NewGetSilencesParamsWithTimeout(timeout time.Duration) *GetSilences...
function NewGetSilencesParamsWithContext (line 56) | func NewGetSilencesParamsWithContext(ctx context.Context) *GetSilencesPa...
function NewGetSilencesParamsWithHTTPClient (line 64) | func NewGetSilencesParamsWithHTTPClient(client *http.Client) *GetSilence...
type GetSilencesParams (line 77) | type GetSilencesParams struct
method WithDefaults (line 93) | func (o *GetSilencesParams) WithDefaults() *GetSilencesParams {
method SetDefaults (line 101) | func (o *GetSilencesParams) SetDefaults() {
method WithTimeout (line 106) | func (o *GetSilencesParams) WithTimeout(timeout time.Duration) *GetSil...
method SetTimeout (line 112) | func (o *GetSilencesParams) SetTimeout(timeout time.Duration) {
method WithContext (line 117) | func (o *GetSilencesParams) WithContext(ctx context.Context) *GetSilen...
method SetContext (line 123) | func (o *GetSilencesParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 128) | func (o *GetSilencesParams) WithHTTPClient(client *http.Client) *GetSi...
method SetHTTPClient (line 134) | func (o *GetSilencesParams) SetHTTPClient(client *http.Client) {
method WithFilter (line 139) | func (o *GetSilencesParams) WithFilter(filter []string) *GetSilencesPa...
method SetFilter (line 145) | func (o *GetSilencesParams) SetFilter(filter []string) {
method WriteToRequest (line 150) | func (o *GetSilencesParams) WriteToRequest(r runtime.ClientRequest, re...
method bindParamFilter (line 175) | func (o *GetSilencesParams) bindParamFilter(formats strfmt.Registry) [...
FILE: api/v2/client/silence/get_silences_responses.go
type GetSilencesReader (line 35) | type GetSilencesReader struct
method ReadResponse (line 40) | func (o *GetSilencesReader) ReadResponse(response runtime.ClientRespon...
function NewGetSilencesOK (line 66) | func NewGetSilencesOK() *GetSilencesOK {
type GetSilencesOK (line 75) | type GetSilencesOK struct
method IsSuccess (line 80) | func (o *GetSilencesOK) IsSuccess() bool {
method IsRedirect (line 85) | func (o *GetSilencesOK) IsRedirect() bool {
method IsClientError (line 90) | func (o *GetSilencesOK) IsClientError() bool {
method IsServerError (line 95) | func (o *GetSilencesOK) IsServerError() bool {
method IsCode (line 100) | func (o *GetSilencesOK) IsCode(code int) bool {
method Code (line 105) | func (o *GetSilencesOK) Code() int {
method Error (line 109) | func (o *GetSilencesOK) Error() string {
method String (line 114) | func (o *GetSilencesOK) String() string {
method GetPayload (line 119) | func (o *GetSilencesOK) GetPayload() models.GettableSilences {
method readResponse (line 123) | func (o *GetSilencesOK) readResponse(response runtime.ClientResponse, ...
function NewGetSilencesBadRequest (line 134) | func NewGetSilencesBadRequest() *GetSilencesBadRequest {
type GetSilencesBadRequest (line 143) | type GetSilencesBadRequest struct
method IsSuccess (line 148) | func (o *GetSilencesBadRequest) IsSuccess() bool {
method IsRedirect (line 153) | func (o *GetSilencesBadRequest) IsRedirect() bool {
method IsClientError (line 158) | func (o *GetSilencesBadRequest) IsClientError() bool {
method IsServerError (line 163) | func (o *GetSilencesBadRequest) IsServerError() bool {
method IsCode (line 168) | func (o *GetSilencesBadRequest) IsCode(code int) bool {
method Code (line 173) | func (o *GetSilencesBadRequest) Code() int {
method Error (line 177) | func (o *GetSilencesBadRequest) Error() string {
method String (line 182) | func (o *GetSilencesBadRequest) String() string {
method GetPayload (line 187) | func (o *GetSilencesBadRequest) GetPayload() string {
method readResponse (line 191) | func (o *GetSilencesBadRequest) readResponse(response runtime.ClientRe...
function NewGetSilencesInternalServerError (line 202) | func NewGetSilencesInternalServerError() *GetSilencesInternalServerError {
type GetSilencesInternalServerError (line 211) | type GetSilencesInternalServerError struct
method IsSuccess (line 216) | func (o *GetSilencesInternalServerError) IsSuccess() bool {
method IsRedirect (line 221) | func (o *GetSilencesInternalServerError) IsRedirect() bool {
method IsClientError (line 226) | func (o *GetSilencesInternalServerError) IsClientError() bool {
method IsServerError (line 231) | func (o *GetSilencesInternalServerError) IsServerError() bool {
method IsCode (line 236) | func (o *GetSilencesInternalServerError) IsCode(code int) bool {
method Code (line 241) | func (o *GetSilencesInternalServerError) Code() int {
method Error (line 245) | func (o *GetSilencesInternalServerError) Error() string {
method String (line 250) | func (o *GetSilencesInternalServerError) String() string {
method GetPayload (line 255) | func (o *GetSilencesInternalServerError) GetPayload() string {
method readResponse (line 259) | func (o *GetSilencesInternalServerError) readResponse(response runtime...
FILE: api/v2/client/silence/post_silences_parameters.go
function NewPostSilencesParams (line 41) | func NewPostSilencesParams() *PostSilencesParams {
function NewPostSilencesParamsWithTimeout (line 49) | func NewPostSilencesParamsWithTimeout(timeout time.Duration) *PostSilenc...
function NewPostSilencesParamsWithContext (line 57) | func NewPostSilencesParamsWithContext(ctx context.Context) *PostSilences...
function NewPostSilencesParamsWithHTTPClient (line 65) | func NewPostSilencesParamsWithHTTPClient(client *http.Client) *PostSilen...
type PostSilencesParams (line 78) | type PostSilencesParams struct
method WithDefaults (line 94) | func (o *PostSilencesParams) WithDefaults() *PostSilencesParams {
method SetDefaults (line 102) | func (o *PostSilencesParams) SetDefaults() {
method WithTimeout (line 107) | func (o *PostSilencesParams) WithTimeout(timeout time.Duration) *PostS...
method SetTimeout (line 113) | func (o *PostSilencesParams) SetTimeout(timeout time.Duration) {
method WithContext (line 118) | func (o *PostSilencesParams) WithContext(ctx context.Context) *PostSil...
method SetContext (line 124) | func (o *PostSilencesParams) SetContext(ctx context.Context) {
method WithHTTPClient (line 129) | func (o *PostSilencesParams) WithHTTPClient(client *http.Client) *Post...
method SetHTTPClient (line 135) | func (o *PostSilencesParams) SetHTTPClient(client *http.Client) {
method WithSilence (line 140) | func (o *PostSilencesParams) WithSilence(silence *models.PostableSilen...
method SetSilence (line 146) | func (o *PostSilencesParams) SetSilence(silence *models.PostableSilenc...
method WriteToRequest (line 151) | func (o *PostSilencesParams) WriteToRequest(r runtime.ClientRequest, r...
FILE: api/v2/client/silence/post_silences_responses.go
type PostSilencesReader (line 35) | type PostSilencesReader struct
method ReadResponse (line 40) | func (o *PostSilencesReader) ReadResponse(response runtime.ClientRespo...
function NewPostSilencesOK (line 66) | func NewPostSilencesOK() *PostSilencesOK {
type PostSilencesOK (line 75) | type PostSilencesOK struct
method IsSuccess (line 80) | func (o *PostSilencesOK) IsSuccess() bool {
method IsRedirect (line 85) | func (o *PostSilencesOK) IsRedirect() bool {
method IsClientError (line 90) | func (o *PostSilencesOK) IsClientError() bool {
method IsServerError (line 95) | func (o *PostSilencesOK) IsServerError() bool {
method IsCode (line 100) | func (o *PostSilencesOK) IsCode(code int) bool {
method Code (line 105) | func (o *PostSilencesOK) Code() int {
method Error (line 109) | func (o *PostSilencesOK) Error() string {
method String (line 114) | func (o *PostSilencesOK) String() string {
method GetPayload (line 119) | func (o *PostSilencesOK) GetPayload() *PostSilencesOKBody {
method readResponse (line 123) | func (o *PostSilencesOK) readResponse(response runtime.ClientResponse,...
function NewPostSilencesBadRequest (line 136) | func NewPostSilencesBadRequest() *PostSilencesBadRequest {
type PostSilencesBadRequest (line 145) | type PostSilencesBadRequest struct
method IsSuccess (line 150) | func (o *PostSilencesBadRequest) IsSuccess() bool {
method IsRedirect (line 155) | func (o *PostSilencesBadRequest) IsRedirect() bool {
method IsClientError (line 160) | func (o *PostSilencesBadRequest) IsClientError() bool {
method IsServerError (line 165) | func (o *PostSilencesBadRequest) IsServerError() bool {
method IsCode (line 170) | func (o *PostSilencesBadRequest) IsCode(code int) bool {
method Code (line 175) | func (o *PostSilencesBadRequest) Code() int {
method Error (line 179) | func (o *PostSilencesBadRequest) Error() string {
method String (line 184) | func (o *PostSilencesBadRequest) String() string {
method GetPayload (line 189) | func (o *PostSilencesBadRequest) GetPayload() string {
method readResponse (line 193) | func (o *PostSilencesBadRequest) readResponse(response runtime.ClientR...
function NewPostSilencesNotFound (line 204) | func NewPostSilencesNotFound() *PostSilencesNotFound {
type PostSilencesNotFound (line 213) | type PostSilencesNotFound struct
method IsSuccess (line 218) | func (o *PostSilencesNotFound) IsSuccess() bool {
method IsRedirect (line 223) | func (o *PostSilencesNotFound) IsRedirect() bool {
method IsClientError (line 228) | func (o *PostSilencesNotFound) IsClientError() bool {
method IsServerError (line 233) | func (o *PostSilencesNotFound) IsServerError() bool {
method IsCode (line 238) | func (o *PostSilencesNotFound) IsCode(code int) bool {
method Code (line 243) | func (o *PostSilencesNotFound) Code() int {
method Error (line 247) | func (o *PostSilencesNotFound) Error() string {
method String (line 252) | func (o *PostSilencesNotFound) String() string {
method GetPayload (line 257) | func (o *PostSilencesNotFound) GetPayload() string {
method readResponse (line 261) | func (o *PostSilencesNotFound) readResponse(response runtime.ClientRes...
type PostSilencesOKBody (line 275) | type PostSilencesOKBody struct
method Validate (line 282) | func (o *PostSilencesOKBody) Validate(formats strfmt.Registry) error {
method ContextValidate (line 287) | func (o *PostSilencesOKBody) ContextValidate(ctx context.Context, form...
method MarshalBinary (line 292) | func (o *PostSilencesOKBody) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 300) | func (o *PostSilencesOKBody) UnmarshalBinary(b []byte) error {
FILE: api/v2/client/silence/silence_client.go
function New (line 31) | func New(transport runtime.ClientTransport, formats strfmt.Registry) Cli...
function NewClientWithBasicAuth (line 42) | func NewClientWithBasicAuth(host, basePath, scheme, user, password strin...
function NewClientWithBearerToken (line 54) | func NewClientWithBearerToken(host, basePath, scheme, bearerToken string...
type Client (line 63) | type Client struct
method DeleteSilence (line 87) | func (a *Client) DeleteSilence(params *DeleteSilenceParams, opts ...Cl...
method GetSilence (line 130) | func (a *Client) GetSilence(params *GetSilenceParams, opts ...ClientOp...
method GetSilences (line 173) | func (a *Client) GetSilences(params *GetSilencesParams, opts ...Client...
method PostSilences (line 216) | func (a *Client) PostSilences(params *PostSilencesParams, opts ...Clie...
method SetTransport (line 257) | func (a *Client) SetTransport(transport runtime.ClientTransport) {
type ClientOption (line 69) | type ClientOption
type ClientService (line 72) | type ClientService interface
FILE: api/v2/compat.go
function GettableSilenceFromProto (line 32) | func GettableSilenceFromProto(s *silencepb.Silence) (open_api_models.Get...
function PostableSilenceToProto (line 95) | func PostableSilenceToProto(s *open_api_models.PostableSilence) (*silenc...
function AlertToOpenAPIAlert (line 142) | func AlertToOpenAPIAlert(alert *types.Alert, status types.AlertStatus, r...
function OpenAPIAlertsToAlerts (line 195) | func OpenAPIAlertsToAlerts(ctx context.Context, apiAlerts open_api_model...
function ModelLabelSetToAPILabelSet (line 216) | func ModelLabelSetToAPILabelSet(modelLabelSet prometheus_model.LabelSet)...
function APILabelSetToModelLabelSet (line 226) | func APILabelSetToModelLabelSet(apiLabelSet open_api_models.LabelSet) pr...
FILE: api/v2/models/alert.go
type Alert (line 35) | type Alert struct
method Validate (line 47) | func (m *Alert) Validate(formats strfmt.Registry) error {
method validateGeneratorURL (line 64) | func (m *Alert) validateGeneratorURL(formats strfmt.Registry) error {
method validateLabels (line 76) | func (m *Alert) validateLabels(formats strfmt.Registry) error {
method ContextValidate (line 101) | func (m *Alert) ContextValidate(ctx context.Context, formats strfmt.Re...
method contextValidateLabels (line 114) | func (m *Alert) contextValidateLabels(ctx context.Context, formats str...
method MarshalBinary (line 133) | func (m *Alert) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 141) | func (m *Alert) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/alert_group.go
type AlertGroup (line 36) | type AlertGroup struct
method Validate (line 52) | func (m *AlertGroup) Validate(formats strfmt.Registry) error {
method validateAlerts (line 73) | func (m *AlertGroup) validateAlerts(formats strfmt.Registry) error {
method validateLabels (line 104) | func (m *AlertGroup) validateLabels(formats strfmt.Registry) error {
method validateReceiver (line 128) | func (m *AlertGroup) validateReceiver(formats strfmt.Registry) error {
method ContextValidate (line 153) | func (m *AlertGroup) ContextValidate(ctx context.Context, formats strf...
method contextValidateAlerts (line 174) | func (m *AlertGroup) contextValidateAlerts(ctx context.Context, format...
method contextValidateLabels (line 203) | func (m *AlertGroup) contextValidateLabels(ctx context.Context, format...
method contextValidateReceiver (line 221) | func (m *AlertGroup) contextValidateReceiver(ctx context.Context, form...
method MarshalBinary (line 243) | func (m *AlertGroup) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 251) | func (m *AlertGroup) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/alert_groups.go
type AlertGroups (line 35) | type AlertGroups
method Validate (line 38) | func (m AlertGroups) Validate(formats strfmt.Registry) error {
method ContextValidate (line 70) | func (m AlertGroups) ContextValidate(ctx context.Context, formats strf...
FILE: api/v2/models/alert_status.go
type AlertStatus (line 35) | type AlertStatus struct
method Validate (line 56) | func (m *AlertStatus) Validate(formats strfmt.Registry) error {
method validateInhibitedBy (line 81) | func (m *AlertStatus) validateInhibitedBy(formats strfmt.Registry) err...
method validateMutedBy (line 90) | func (m *AlertStatus) validateMutedBy(formats strfmt.Registry) error {
method validateSilencedBy (line 99) | func (m *AlertStatus) validateSilencedBy(formats strfmt.Registry) error {
method validateStateEnum (line 133) | func (m *AlertStatus) validateStateEnum(path, location string, value s...
method validateState (line 140) | func (m *AlertStatus) validateState(formats strfmt.Registry) error {
method ContextValidate (line 155) | func (m *AlertStatus) ContextValidate(ctx context.Context, formats str...
method MarshalBinary (line 160) | func (m *AlertStatus) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 168) | func (m *AlertStatus) UnmarshalBinary(b []byte) error {
function init (line 110) | func init() {
constant AlertStatusStateUnprocessed (line 123) | AlertStatusStateUnprocessed string = "unprocessed"
constant AlertStatusStateActive (line 126) | AlertStatusStateActive string = "active"
constant AlertStatusStateSuppressed (line 129) | AlertStatusStateSuppressed string = "suppressed"
FILE: api/v2/models/alertmanager_config.go
type AlertmanagerConfig (line 34) | type AlertmanagerConfig struct
method Validate (line 42) | func (m *AlertmanagerConfig) Validate(formats strfmt.Registry) error {
method validateOriginal (line 55) | func (m *AlertmanagerConfig) validateOriginal(formats strfmt.Registry)...
method ContextValidate (line 65) | func (m *AlertmanagerConfig) ContextValidate(ctx context.Context, form...
method MarshalBinary (line 70) | func (m *AlertmanagerConfig) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 78) | func (m *AlertmanagerConfig) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/alertmanager_status.go
type AlertmanagerStatus (line 35) | type AlertmanagerStatus struct
method Validate (line 56) | func (m *AlertmanagerStatus) Validate(formats strfmt.Registry) error {
method validateCluster (line 81) | func (m *AlertmanagerStatus) validateCluster(formats strfmt.Registry) ...
method validateConfig (line 105) | func (m *AlertmanagerStatus) validateConfig(formats strfmt.Registry) e...
method validateUptime (line 129) | func (m *AlertmanagerStatus) validateUptime(formats strfmt.Registry) e...
method validateVersionInfo (line 142) | func (m *AlertmanagerStatus) validateVersionInfo(formats strfmt.Regist...
method ContextValidate (line 167) | func (m *AlertmanagerStatus) ContextValidate(ctx context.Context, form...
method contextValidateCluster (line 188) | func (m *AlertmanagerStatus) contextValidateCluster(ctx context.Contex...
method contextValidateConfig (line 209) | func (m *AlertmanagerStatus) contextValidateConfig(ctx context.Context...
method contextValidateVersionInfo (line 230) | func (m *AlertmanagerStatus) contextValidateVersionInfo(ctx context.Co...
method MarshalBinary (line 252) | func (m *AlertmanagerStatus) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 260) | func (m *AlertmanagerStatus) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/cluster_status.go
type ClusterStatus (line 37) | type ClusterStatus struct
method Validate (line 52) | func (m *ClusterStatus) Validate(formats strfmt.Registry) error {
method validatePeers (line 69) | func (m *ClusterStatus) validatePeers(formats strfmt.Registry) error {
method validateStatusEnum (line 124) | func (m *ClusterStatus) validateStatusEnum(path, location string, valu...
method validateStatus (line 131) | func (m *ClusterStatus) validateStatus(formats strfmt.Registry) error {
method ContextValidate (line 146) | func (m *ClusterStatus) ContextValidate(ctx context.Context, formats s...
method contextValidatePeers (line 159) | func (m *ClusterStatus) contextValidatePeers(ctx context.Context, form...
method MarshalBinary (line 189) | func (m *ClusterStatus) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 197) | func (m *ClusterStatus) UnmarshalBinary(b []byte) error {
function init (line 101) | func init() {
constant ClusterStatusStatusReady (line 114) | ClusterStatusStatusReady string = "ready"
constant ClusterStatusStatusSettling (line 117) | ClusterStatusStatusSettling string = "settling"
constant ClusterStatusStatusDisabled (line 120) | ClusterStatusStatusDisabled string = "disabled"
FILE: api/v2/models/gettable_alert.go
type GettableAlert (line 36) | type GettableAlert struct
method UnmarshalJSON (line 73) | func (m *GettableAlert) UnmarshalJSON(raw []byte) error {
method MarshalJSON (line 119) | func (m GettableAlert) MarshalJSON() ([]byte, error) {
method Validate (line 167) | func (m *GettableAlert) Validate(formats strfmt.Registry) error {
method validateAnnotations (line 209) | func (m *GettableAlert) validateAnnotations(formats strfmt.Registry) e...
method validateEndsAt (line 233) | func (m *GettableAlert) validateEndsAt(formats strfmt.Registry) error {
method validateFingerprint (line 246) | func (m *GettableAlert) validateFingerprint(formats strfmt.Registry) e...
method validateReceivers (line 255) | func (m *GettableAlert) validateReceivers(formats strfmt.Registry) err...
method validateStartsAt (line 286) | func (m *GettableAlert) validateStartsAt(formats strfmt.Registry) error {
method validateStatus (line 299) | func (m *GettableAlert) validateStatus(formats strfmt.Registry) error {
method validateUpdatedAt (line 323) | func (m *GettableAlert) validateUpdatedAt(formats strfmt.Registry) err...
method ContextValidate (line 337) | func (m *GettableAlert) ContextValidate(ctx context.Context, formats s...
method contextValidateAnnotations (line 363) | func (m *GettableAlert) contextValidateAnnotations(ctx context.Context...
method contextValidateReceivers (line 381) | func (m *GettableAlert) contextValidateReceivers(ctx context.Context, ...
method contextValidateStatus (line 410) | func (m *GettableAlert) contextValidateStatus(ctx context.Context, for...
method MarshalBinary (line 432) | func (m *GettableAlert) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 440) | func (m *GettableAlert) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/gettable_alerts.go
type GettableAlerts (line 35) | type GettableAlerts
method Validate (line 38) | func (m GettableAlerts) Validate(formats strfmt.Registry) error {
method ContextValidate (line 70) | func (m GettableAlerts) ContextValidate(ctx context.Context, formats s...
FILE: api/v2/models/gettable_silence.go
type GettableSilence (line 35) | type GettableSilence struct
method UnmarshalJSON (line 54) | func (m *GettableSilence) UnmarshalJSON(raw []byte) error {
method MarshalJSON (line 84) | func (m GettableSilence) MarshalJSON() ([]byte, error) {
method Validate (line 116) | func (m *GettableSilence) Validate(formats strfmt.Registry) error {
method validateID (line 142) | func (m *GettableSilence) validateID(formats strfmt.Registry) error {
method validateStatus (line 151) | func (m *GettableSilence) validateStatus(formats strfmt.Registry) error {
method validateUpdatedAt (line 175) | func (m *GettableSilence) validateUpdatedAt(formats strfmt.Registry) e...
method ContextValidate (line 189) | func (m *GettableSilence) ContextValidate(ctx context.Context, formats...
method contextValidateStatus (line 207) | func (m *GettableSilence) contextValidateStatus(ctx context.Context, f...
method MarshalBinary (line 229) | func (m *GettableSilence) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 237) | func (m *GettableSilence) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/gettable_silences.go
type GettableSilences (line 35) | type GettableSilences
method Validate (line 38) | func (m GettableSilences) Validate(formats strfmt.Registry) error {
method ContextValidate (line 70) | func (m GettableSilences) ContextValidate(ctx context.Context, formats...
FILE: api/v2/models/label_set.go
type LabelSet (line 31) | type LabelSet
method Validate (line 34) | func (m LabelSet) Validate(formats strfmt.Registry) error {
method ContextValidate (line 39) | func (m LabelSet) ContextValidate(ctx context.Context, formats strfmt....
FILE: api/v2/models/matcher.go
type Matcher (line 34) | type Matcher struct
method Validate (line 53) | func (m *Matcher) Validate(formats strfmt.Registry) error {
method validateIsRegex (line 74) | func (m *Matcher) validateIsRegex(formats strfmt.Registry) error {
method validateName (line 83) | func (m *Matcher) validateName(formats strfmt.Registry) error {
method validateValue (line 92) | func (m *Matcher) validateValue(formats strfmt.Registry) error {
method ContextValidate (line 102) | func (m *Matcher) ContextValidate(ctx context.Context, formats strfmt....
method MarshalBinary (line 107) | func (m *Matcher) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 115) | func (m *Matcher) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/matchers.go
type Matchers (line 36) | type Matchers
method Validate (line 39) | func (m Matchers) Validate(formats strfmt.Registry) error {
method ContextValidate (line 77) | func (m Matchers) ContextValidate(ctx context.Context, formats strfmt....
FILE: api/v2/models/peer_status.go
type PeerStatus (line 34) | type PeerStatus struct
method Validate (line 46) | func (m *PeerStatus) Validate(formats strfmt.Registry) error {
method validateAddress (line 63) | func (m *PeerStatus) validateAddress(formats strfmt.Registry) error {
method validateName (line 72) | func (m *PeerStatus) validateName(formats strfmt.Registry) error {
method ContextValidate (line 82) | func (m *PeerStatus) ContextValidate(ctx context.Context, formats strf...
method MarshalBinary (line 87) | func (m *PeerStatus) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 95) | func (m *PeerStatus) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/postable_alert.go
type PostableAlert (line 35) | type PostableAlert struct
method UnmarshalJSON (line 52) | func (m *PostableAlert) UnmarshalJSON(raw []byte) error {
method MarshalJSON (line 82) | func (m PostableAlert) MarshalJSON() ([]byte, error) {
method Validate (line 114) | func (m *PostableAlert) Validate(formats strfmt.Registry) error {
method validateAnnotations (line 140) | func (m *PostableAlert) validateAnnotations(formats strfmt.Registry) e...
method validateEndsAt (line 164) | func (m *PostableAlert) validateEndsAt(formats strfmt.Registry) error {
method validateStartsAt (line 177) | func (m *PostableAlert) validateStartsAt(formats strfmt.Registry) error {
method ContextValidate (line 191) | func (m *PostableAlert) ContextValidate(ctx context.Context, formats s...
method contextValidateAnnotations (line 209) | func (m *PostableAlert) contextValidateAnnotations(ctx context.Context...
method MarshalBinary (line 232) | func (m *PostableAlert) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 240) | func (m *PostableAlert) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/postable_alerts.go
type PostableAlerts (line 35) | type PostableAlerts
method Validate (line 38) | func (m PostableAlerts) Validate(formats strfmt.Registry) error {
method ContextValidate (line 70) | func (m PostableAlerts) ContextValidate(ctx context.Context, formats s...
FILE: api/v2/models/postable_silence.go
type PostableSilence (line 33) | type PostableSilence struct
method UnmarshalJSON (line 42) | func (m *PostableSilence) UnmarshalJSON(raw []byte) error {
method MarshalJSON (line 64) | func (m PostableSilence) MarshalJSON() ([]byte, error) {
method Validate (line 88) | func (m *PostableSilence) Validate(formats strfmt.Registry) error {
method ContextValidate (line 103) | func (m *PostableSilence) ContextValidate(ctx context.Context, formats...
method MarshalBinary (line 118) | func (m *PostableSilence) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 126) | func (m *PostableSilence) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/receiver.go
type Receiver (line 34) | type Receiver struct
method Validate (line 42) | func (m *Receiver) Validate(formats strfmt.Registry) error {
method validateName (line 55) | func (m *Receiver) validateName(formats strfmt.Registry) error {
method ContextValidate (line 65) | func (m *Receiver) ContextValidate(ctx context.Context, formats strfmt...
method MarshalBinary (line 70) | func (m *Receiver) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 78) | func (m *Receiver) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/silence.go
type Silence (line 35) | type Silence struct
method Validate (line 64) | func (m *Silence) Validate(formats strfmt.Registry) error {
method validateAnnotations (line 97) | func (m *Silence) validateAnnotations(formats strfmt.Registry) error {
method validateComment (line 120) | func (m *Silence) validateComment(formats strfmt.Registry) error {
method validateCreatedBy (line 129) | func (m *Silence) validateCreatedBy(formats strfmt.Registry) error {
method validateEndsAt (line 138) | func (m *Silence) validateEndsAt(formats strfmt.Registry) error {
method validateMatchers (line 151) | func (m *Silence) validateMatchers(formats strfmt.Registry) error {
method validateStartsAt (line 173) | func (m *Silence) validateStartsAt(formats strfmt.Registry) error {
method ContextValidate (line 187) | func (m *Silence) ContextValidate(ctx context.Context, formats strfmt....
method contextValidateAnnotations (line 204) | func (m *Silence) contextValidateAnnotations(ctx context.Context, form...
method contextValidateMatchers (line 226) | func (m *Silence) contextValidateMatchers(ctx context.Context, formats...
method MarshalBinary (line 245) | func (m *Silence) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 253) | func (m *Silence) UnmarshalBinary(b []byte) error {
FILE: api/v2/models/silence_status.go
type SilenceStatus (line 35) | type SilenceStatus struct
method Validate (line 44) | func (m *SilenceStatus) Validate(formats strfmt.Registry) error {
method validateStateEnum (line 82) | func (m *SilenceStatus) validateStateEnum(path, location string, value...
method validateState (line 89) | func (m *SilenceStatus) validateState(formats strfmt.Registry) error {
method ContextValidate (line 104) | func (m *SilenceStatus) ContextValidate(ctx context.Context, formats s...
method MarshalBinary (line 109) | func (m *SilenceStatus) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 117) | func (m *SilenceStatus) UnmarshalBinary(b []byte) error {
function init (line 59) | func init() {
constant SilenceStatusStateExpired (line 72) | SilenceStatusStateExpired string = "expired"
constant SilenceStatusStateActive (line 75) | SilenceStatusStateActive string = "active"
constant SilenceStatusStatePending (line 78) | SilenceStatusStatePending string = "pending"
FILE: api/v2/models/version_info.go
type VersionInfo (line 34) | type VersionInfo struct
method Validate (line 62) | func (m *VersionInfo) Validate(formats strfmt.Registry) error {
method validateBranch (line 95) | func (m *VersionInfo) validateBranch(formats strfmt.Registry) error {
method validateBuildDate (line 104) | func (m *VersionInfo) validateBuildDate(formats strfmt.Registry) error {
method validateBuildUser (line 113) | func (m *VersionInfo) validateBuildUser(formats strfmt.Registry) error {
method validateGoVersion (line 122) | func (m *VersionInfo) validateGoVersion(formats strfmt.Registry) error {
method validateRevision (line 131) | func (m *VersionInfo) validateRevision(formats strfmt.Registry) error {
method validateVersion (line 140) | func (m *VersionInfo) validateVersion(formats strfmt.Registry) error {
method ContextValidate (line 150) | func (m *VersionInfo) ContextValidate(ctx context.Context, formats str...
method MarshalBinary (line 155) | func (m *VersionInfo) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 163) | func (m *VersionInfo) UnmarshalBinary(b []byte) error {
FILE: api/v2/restapi/configure_alertmanager.go
function configureFlags (line 37) | func configureFlags(api *operations.AlertmanagerAPI) {
function configureAPI (line 42) | func configureAPI(api *operations.AlertmanagerAPI) http.Handler {
function configureTLS (line 132) | func configureTLS(tlsConfig *tls.Config) {
function configureServer (line 141) | func configureServer(server *http.Server, scheme, addr string) {
function setupMiddlewares (line 149) | func setupMiddlewares(handler http.Handler) http.Handler {
function setupGlobalMiddleware (line 155) | func setupGlobalMiddleware(handler http.Handler) http.Handler {
FILE: api/v2/restapi/embedded_spec.go
function init (line 33) | func init() {
FILE: api/v2/restapi/operations/alert/get_alerts.go
type GetAlertsHandlerFunc (line 29) | type GetAlertsHandlerFunc
method Handle (line 32) | func (fn GetAlertsHandlerFunc) Handle(params GetAlertsParams) middlewa...
type GetAlertsHandler (line 37) | type GetAlertsHandler interface
function NewGetAlerts (line 42) | func NewGetAlerts(ctx *middleware.Context, handler GetAlertsHandler) *Ge...
type GetAlerts (line 51) | type GetAlerts struct
method ServeHTTP (line 56) | func (o *GetAlerts) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
FILE: api/v2/restapi/operations/alert/get_alerts_parameters.go
function NewGetAlertsParams (line 34) | func NewGetAlertsParams() GetAlertsParams {
type GetAlertsParams (line 62) | type GetAlertsParams struct
method BindRequest (line 106) | func (o *GetAlertsParams) BindRequest(r *http.Request, route *middlewa...
method bindActive (line 148) | func (o *GetAlertsParams) bindActive(rawData []string, hasKey bool, fo...
method bindFilter (line 174) | func (o *GetAlertsParams) bindFilter(rawData []string, hasKey bool, fo...
method bindInhibited (line 194) | func (o *GetAlertsParams) bindInhibited(rawData []string, hasKey bool,...
method bindReceiver (line 218) | func (o *GetAlertsParams) bindReceiver(rawData []string, hasKey bool, ...
method bindSilenced (line 236) | func (o *GetAlertsParams) bindSilenced(rawData []string, hasKey bool, ...
method bindUnprocessed (line 260) | func (o *GetAlertsParams) bindUnprocessed(rawData []string, hasKey boo...
FILE: api/v2/restapi/operations/alert/get_alerts_responses.go
constant GetAlertsOKCode (line 31) | GetAlertsOKCode int = 200
type GetAlertsOK (line 38) | type GetAlertsOK struct
method WithPayload (line 53) | func (o *GetAlertsOK) WithPayload(payload models.GettableAlerts) *GetA...
method SetPayload (line 59) | func (o *GetAlertsOK) SetPayload(payload models.GettableAlerts) {
method WriteResponse (line 64) | func (o *GetAlertsOK) WriteResponse(rw http.ResponseWriter, producer r...
function NewGetAlertsOK (line 47) | func NewGetAlertsOK() *GetAlertsOK {
constant GetAlertsBadRequestCode (line 79) | GetAlertsBadRequestCode int = 400
type GetAlertsBadRequest (line 86) | type GetAlertsBadRequest struct
method WithPayload (line 101) | func (o *GetAlertsBadRequest) WithPayload(payload string) *GetAlertsBa...
method SetPayload (line 107) | func (o *GetAlertsBadRequest) SetPayload(payload string) {
method WriteResponse (line 112) | func (o *GetAlertsBadRequest) WriteResponse(rw http.ResponseWriter, pr...
function NewGetAlertsBadRequest (line 95) | func NewGetAlertsBadRequest() *GetAlertsBadRequest {
constant GetAlertsInternalServerErrorCode (line 122) | GetAlertsInternalServerErrorCode int = 500
type GetAlertsInternalServerError (line 129) | type GetAlertsInternalServerError struct
method WithPayload (line 144) | func (o *GetAlertsInternalServerError) WithPayload(payload string) *Ge...
method SetPayload (line 150) | func (o *GetAlertsInternalServerError) SetPayload(payload string) {
method WriteResponse (line 155) | func (o *GetAlertsInternalServerError) WriteResponse(rw http.ResponseW...
function NewGetAlertsInternalServerError (line 138) | func NewGetAlertsInternalServerError() *GetAlertsInternalServerError {
FILE: api/v2/restapi/operations/alert/get_alerts_urlbuilder.go
type GetAlertsURL (line 31) | type GetAlertsURL struct
method WithBasePath (line 47) | func (o *GetAlertsURL) WithBasePath(bp string) *GetAlertsURL {
method SetBasePath (line 55) | func (o *GetAlertsURL) SetBasePath(bp string) {
method Build (line 60) | func (o *GetAlertsURL) Build() (*url.URL, error) {
method Must (line 133) | func (o *GetAlertsURL) Must(u *url.URL, err error) *url.URL {
method String (line 144) | func (o *GetAlertsURL) String() string {
method BuildFull (line 149) | func (o *GetAlertsURL) BuildFull(scheme, host string) (*url.URL, error) {
method StringFull (line 168) | func (o *GetAlertsURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/alert/post_alerts.go
type PostAlertsHandlerFunc (line 29) | type PostAlertsHandlerFunc
method Handle (line 32) | func (fn PostAlertsHandlerFunc) Handle(params PostAlertsParams) middle...
type PostAlertsHandler (line 37) | type PostAlertsHandler interface
function NewPostAlerts (line 42) | func NewPostAlerts(ctx *middleware.Context, handler PostAlertsHandler) *...
type PostAlerts (line 51) | type PostAlerts struct
method ServeHTTP (line 56) | func (o *PostAlerts) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
FILE: api/v2/restapi/operations/alert/post_alerts_parameters.go
function NewPostAlertsParams (line 38) | func NewPostAlertsParams() PostAlertsParams {
type PostAlertsParams (line 47) | type PostAlertsParams struct
method BindRequest (line 62) | func (o *PostAlertsParams) BindRequest(r *http.Request, route *middlew...
FILE: api/v2/restapi/operations/alert/post_alerts_responses.go
constant PostAlertsOKCode (line 29) | PostAlertsOKCode int = 200
type PostAlertsOK (line 36) | type PostAlertsOK struct
method WriteResponse (line 46) | func (o *PostAlertsOK) WriteResponse(rw http.ResponseWriter, producer ...
function NewPostAlertsOK (line 40) | func NewPostAlertsOK() *PostAlertsOK {
constant PostAlertsBadRequestCode (line 54) | PostAlertsBadRequestCode int = 400
type PostAlertsBadRequest (line 61) | type PostAlertsBadRequest struct
method WithPayload (line 76) | func (o *PostAlertsBadRequest) WithPayload(payload string) *PostAlerts...
method SetPayload (line 82) | func (o *PostAlertsBadRequest) SetPayload(payload string) {
method WriteResponse (line 87) | func (o *PostAlertsBadRequest) WriteResponse(rw http.ResponseWriter, p...
function NewPostAlertsBadRequest (line 70) | func NewPostAlertsBadRequest() *PostAlertsBadRequest {
constant PostAlertsInternalServerErrorCode (line 97) | PostAlertsInternalServerErrorCode int = 500
type PostAlertsInternalServerError (line 104) | type PostAlertsInternalServerError struct
method WithPayload (line 119) | func (o *PostAlertsInternalServerError) WithPayload(payload string) *P...
method SetPayload (line 125) | func (o *PostAlertsInternalServerError) SetPayload(payload string) {
method WriteResponse (line 130) | func (o *PostAlertsInternalServerError) WriteResponse(rw http.Response...
function NewPostAlertsInternalServerError (line 113) | func NewPostAlertsInternalServerError() *PostAlertsInternalServerError {
FILE: api/v2/restapi/operations/alert/post_alerts_urlbuilder.go
type PostAlertsURL (line 29) | type PostAlertsURL struct
method WithBasePath (line 36) | func (o *PostAlertsURL) WithBasePath(bp string) *PostAlertsURL {
method SetBasePath (line 44) | func (o *PostAlertsURL) SetBasePath(bp string) {
method Build (line 49) | func (o *PostAlertsURL) Build() (*url.URL, error) {
method Must (line 64) | func (o *PostAlertsURL) Must(u *url.URL, err error) *url.URL {
method String (line 75) | func (o *PostAlertsURL) String() string {
method BuildFull (line 80) | func (o *PostAlertsURL) BuildFull(scheme, host string) (*url.URL, erro...
method StringFull (line 99) | func (o *PostAlertsURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/alertgroup/get_alert_groups.go
type GetAlertGroupsHandlerFunc (line 29) | type GetAlertGroupsHandlerFunc
method Handle (line 32) | func (fn GetAlertGroupsHandlerFunc) Handle(params GetAlertGroupsParams...
type GetAlertGroupsHandler (line 37) | type GetAlertGroupsHandler interface
function NewGetAlertGroups (line 42) | func NewGetAlertGroups(ctx *middleware.Context, handler GetAlertGroupsHa...
type GetAlertGroups (line 51) | type GetAlertGroups struct
method ServeHTTP (line 56) | func (o *GetAlertGroups) ServeHTTP(rw http.ResponseWriter, r *http.Req...
FILE: api/v2/restapi/operations/alertgroup/get_alert_groups_parameters.go
function NewGetAlertGroupsParams (line 34) | func NewGetAlertGroupsParams() GetAlertGroupsParams {
type GetAlertGroupsParams (line 62) | type GetAlertGroupsParams struct
method BindRequest (line 106) | func (o *GetAlertGroupsParams) BindRequest(r *http.Request, route *mid...
method bindActive (line 148) | func (o *GetAlertGroupsParams) bindActive(rawData []string, hasKey boo...
method bindFilter (line 174) | func (o *GetAlertGroupsParams) bindFilter(rawData []string, hasKey boo...
method bindInhibited (line 194) | func (o *GetAlertGroupsParams) bindInhibited(rawData []string, hasKey ...
method bindMuted (line 218) | func (o *GetAlertGroupsParams) bindMuted(rawData []string, hasKey bool...
method bindReceiver (line 242) | func (o *GetAlertGroupsParams) bindReceiver(rawData []string, hasKey b...
method bindSilenced (line 260) | func (o *GetAlertGroupsParams) bindSilenced(rawData []string, hasKey b...
FILE: api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go
constant GetAlertGroupsOKCode (line 31) | GetAlertGroupsOKCode int = 200
type GetAlertGroupsOK (line 38) | type GetAlertGroupsOK struct
method WithPayload (line 53) | func (o *GetAlertGroupsOK) WithPayload(payload models.AlertGroups) *Ge...
method SetPayload (line 59) | func (o *GetAlertGroupsOK) SetPayload(payload models.AlertGroups) {
method WriteResponse (line 64) | func (o *GetAlertGroupsOK) WriteResponse(rw http.ResponseWriter, produ...
function NewGetAlertGroupsOK (line 47) | func NewGetAlertGroupsOK() *GetAlertGroupsOK {
constant GetAlertGroupsBadRequestCode (line 79) | GetAlertGroupsBadRequestCode int = 400
type GetAlertGroupsBadRequest (line 86) | type GetAlertGroupsBadRequest struct
method WithPayload (line 101) | func (o *GetAlertGroupsBadRequest) WithPayload(payload string) *GetAle...
method SetPayload (line 107) | func (o *GetAlertGroupsBadRequest) SetPayload(payload string) {
method WriteResponse (line 112) | func (o *GetAlertGroupsBadRequest) WriteResponse(rw http.ResponseWrite...
function NewGetAlertGroupsBadRequest (line 95) | func NewGetAlertGroupsBadRequest() *GetAlertGroupsBadRequest {
constant GetAlertGroupsInternalServerErrorCode (line 122) | GetAlertGroupsInternalServerErrorCode int = 500
type GetAlertGroupsInternalServerError (line 129) | type GetAlertGroupsInternalServerError struct
method WithPayload (line 144) | func (o *GetAlertGroupsInternalServerError) WithPayload(payload string...
method SetPayload (line 150) | func (o *GetAlertGroupsInternalServerError) SetPayload(payload string) {
method WriteResponse (line 155) | func (o *GetAlertGroupsInternalServerError) WriteResponse(rw http.Resp...
function NewGetAlertGroupsInternalServerError (line 138) | func NewGetAlertGroupsInternalServerError() *GetAlertGroupsInternalServe...
FILE: api/v2/restapi/operations/alertgroup/get_alert_groups_urlbuilder.go
type GetAlertGroupsURL (line 31) | type GetAlertGroupsURL struct
method WithBasePath (line 47) | func (o *GetAlertGroupsURL) WithBasePath(bp string) *GetAlertGroupsURL {
method SetBasePath (line 55) | func (o *GetAlertGroupsURL) SetBasePath(bp string) {
method Build (line 60) | func (o *GetAlertGroupsURL) Build() (*url.URL, error) {
method Must (line 133) | func (o *GetAlertGroupsURL) Must(u *url.URL, err error) *url.URL {
method String (line 144) | func (o *GetAlertGroupsURL) String() string {
method BuildFull (line 149) | func (o *GetAlertGroupsURL) BuildFull(scheme, host string) (*url.URL, ...
method StringFull (line 168) | func (o *GetAlertGroupsURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/alertmanager_api.go
function NewAlertmanagerAPI (line 44) | func NewAlertmanagerAPI(spec *loads.Document) *AlertmanagerAPI {
type AlertmanagerAPI (line 122) | type AlertmanagerAPI struct
method UseRedoc (line 193) | func (o *AlertmanagerAPI) UseRedoc() {
method UseSwaggerUI (line 198) | func (o *AlertmanagerAPI) UseSwaggerUI() {
method SetDefaultProduces (line 203) | func (o *AlertmanagerAPI) SetDefaultProduces(mediaType string) {
method SetDefaultConsumes (line 208) | func (o *AlertmanagerAPI) SetDefaultConsumes(mediaType string) {
method SetSpec (line 213) | func (o *AlertmanagerAPI) SetSpec(spec *loads.Document) {
method DefaultProduces (line 218) | func (o *AlertmanagerAPI) DefaultProduces() string {
method DefaultConsumes (line 223) | func (o *AlertmanagerAPI) DefaultConsumes() string {
method Formats (line 228) | func (o *AlertmanagerAPI) Formats() strfmt.Registry {
method RegisterFormat (line 233) | func (o *AlertmanagerAPI) RegisterFormat(name string, format strfmt.Fo...
method Validate (line 238) | func (o *AlertmanagerAPI) Validate() error {
method ServeErrorFor (line 285) | func (o *AlertmanagerAPI) ServeErrorFor(operationID string) func(http....
method AuthenticatorsFor (line 290) | func (o *AlertmanagerAPI) AuthenticatorsFor(schemes map[string]spec.Se...
method Authorizer (line 295) | func (o *AlertmanagerAPI) Authorizer() runtime.Authorizer {
method ConsumersFor (line 302) | func (o *AlertmanagerAPI) ConsumersFor(mediaTypes []string) map[string...
method ProducersFor (line 320) | func (o *AlertmanagerAPI) ProducersFor(mediaTypes []string) map[string...
method HandlerFor (line 336) | func (o *AlertmanagerAPI) HandlerFor(method, path string) (http.Handle...
method Context (line 352) | func (o *AlertmanagerAPI) Context() *middleware.Context {
method initHandlerCache (line 360) | func (o *AlertmanagerAPI) initHandlerCache() {
method Serve (line 406) | func (o *AlertmanagerAPI) Serve(builder middleware.Builder) http.Handl...
method Init (line 419) | func (o *AlertmanagerAPI) Init() {
method RegisterConsumer (line 426) | func (o *AlertmanagerAPI) RegisterConsumer(mediaType string, consumer ...
method RegisterProducer (line 431) | func (o *AlertmanagerAPI) RegisterProducer(mediaType string, producer ...
method AddMiddlewareFor (line 436) | func (o *AlertmanagerAPI) AddMiddlewareFor(method, path string, builde...
FILE: api/v2/restapi/operations/general/get_status.go
type GetStatusHandlerFunc (line 29) | type GetStatusHandlerFunc
method Handle (line 32) | func (fn GetStatusHandlerFunc) Handle(params GetStatusParams) middlewa...
type GetStatusHandler (line 37) | type GetStatusHandler interface
function NewGetStatus (line 42) | func NewGetStatus(ctx *middleware.Context, handler GetStatusHandler) *Ge...
type GetStatus (line 51) | type GetStatus struct
method ServeHTTP (line 56) | func (o *GetStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
FILE: api/v2/restapi/operations/general/get_status_parameters.go
function NewGetStatusParams (line 32) | func NewGetStatusParams() GetStatusParams {
type GetStatusParams (line 41) | type GetStatusParams struct
method BindRequest (line 50) | func (o *GetStatusParams) BindRequest(r *http.Request, route *middlewa...
FILE: api/v2/restapi/operations/general/get_status_responses.go
constant GetStatusOKCode (line 31) | GetStatusOKCode int = 200
type GetStatusOK (line 38) | type GetStatusOK struct
method WithPayload (line 53) | func (o *GetStatusOK) WithPayload(payload *models.AlertmanagerStatus) ...
method SetPayload (line 59) | func (o *GetStatusOK) SetPayload(payload *models.AlertmanagerStatus) {
method WriteResponse (line 64) | func (o *GetStatusOK) WriteResponse(rw http.ResponseWriter, producer r...
function NewGetStatusOK (line 47) | func NewGetStatusOK() *GetStatusOK {
FILE: api/v2/restapi/operations/general/get_status_urlbuilder.go
type GetStatusURL (line 29) | type GetStatusURL struct
method WithBasePath (line 36) | func (o *GetStatusURL) WithBasePath(bp string) *GetStatusURL {
method SetBasePath (line 44) | func (o *GetStatusURL) SetBasePath(bp string) {
method Build (line 49) | func (o *GetStatusURL) Build() (*url.URL, error) {
method Must (line 64) | func (o *GetStatusURL) Must(u *url.URL, err error) *url.URL {
method String (line 75) | func (o *GetStatusURL) String() string {
method BuildFull (line 80) | func (o *GetStatusURL) BuildFull(scheme, host string) (*url.URL, error) {
method StringFull (line 99) | func (o *GetStatusURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/receiver/get_receivers.go
type GetReceiversHandlerFunc (line 29) | type GetReceiversHandlerFunc
method Handle (line 32) | func (fn GetReceiversHandlerFunc) Handle(params GetReceiversParams) mi...
type GetReceiversHandler (line 37) | type GetReceiversHandler interface
function NewGetReceivers (line 42) | func NewGetReceivers(ctx *middleware.Context, handler GetReceiversHandle...
type GetReceivers (line 51) | type GetReceivers struct
method ServeHTTP (line 56) | func (o *GetReceivers) ServeHTTP(rw http.ResponseWriter, r *http.Reque...
FILE: api/v2/restapi/operations/receiver/get_receivers_parameters.go
function NewGetReceiversParams (line 32) | func NewGetReceiversParams() GetReceiversParams {
type GetReceiversParams (line 41) | type GetReceiversParams struct
method BindRequest (line 50) | func (o *GetReceiversParams) BindRequest(r *http.Request, route *middl...
FILE: api/v2/restapi/operations/receiver/get_receivers_responses.go
constant GetReceiversOKCode (line 31) | GetReceiversOKCode int = 200
type GetReceiversOK (line 38) | type GetReceiversOK struct
method WithPayload (line 53) | func (o *GetReceiversOK) WithPayload(payload []*models.Receiver) *GetR...
method SetPayload (line 59) | func (o *GetReceiversOK) SetPayload(payload []*models.Receiver) {
method WriteResponse (line 64) | func (o *GetReceiversOK) WriteResponse(rw http.ResponseWriter, produce...
function NewGetReceiversOK (line 47) | func NewGetReceiversOK() *GetReceiversOK {
FILE: api/v2/restapi/operations/receiver/get_receivers_urlbuilder.go
type GetReceiversURL (line 29) | type GetReceiversURL struct
method WithBasePath (line 36) | func (o *GetReceiversURL) WithBasePath(bp string) *GetReceiversURL {
method SetBasePath (line 44) | func (o *GetReceiversURL) SetBasePath(bp string) {
method Build (line 49) | func (o *GetReceiversURL) Build() (*url.URL, error) {
method Must (line 64) | func (o *GetReceiversURL) Must(u *url.URL, err error) *url.URL {
method String (line 75) | func (o *GetReceiversURL) String() string {
method BuildFull (line 80) | func (o *GetReceiversURL) BuildFull(scheme, host string) (*url.URL, er...
method StringFull (line 99) | func (o *GetReceiversURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/silence/delete_silence.go
type DeleteSilenceHandlerFunc (line 29) | type DeleteSilenceHandlerFunc
method Handle (line 32) | func (fn DeleteSilenceHandlerFunc) Handle(params DeleteSilenceParams) ...
type DeleteSilenceHandler (line 37) | type DeleteSilenceHandler interface
function NewDeleteSilence (line 42) | func NewDeleteSilence(ctx *middleware.Context, handler DeleteSilenceHand...
type DeleteSilence (line 51) | type DeleteSilence struct
method ServeHTTP (line 56) | func (o *DeleteSilence) ServeHTTP(rw http.ResponseWriter, r *http.Requ...
FILE: api/v2/restapi/operations/silence/delete_silence_parameters.go
function NewDeleteSilenceParams (line 34) | func NewDeleteSilenceParams() DeleteSilenceParams {
type DeleteSilenceParams (line 43) | type DeleteSilenceParams struct
method BindRequest (line 58) | func (o *DeleteSilenceParams) BindRequest(r *http.Request, route *midd...
method bindSilenceID (line 74) | func (o *DeleteSilenceParams) bindSilenceID(rawData []string, hasKey b...
method validateSilenceID (line 98) | func (o *DeleteSilenceParams) validateSilenceID(formats strfmt.Registr...
FILE: api/v2/restapi/operations/silence/delete_silence_responses.go
constant DeleteSilenceOKCode (line 29) | DeleteSilenceOKCode int = 200
type DeleteSilenceOK (line 36) | type DeleteSilenceOK struct
method WriteResponse (line 46) | func (o *DeleteSilenceOK) WriteResponse(rw http.ResponseWriter, produc...
function NewDeleteSilenceOK (line 40) | func NewDeleteSilenceOK() *DeleteSilenceOK {
constant DeleteSilenceNotFoundCode (line 54) | DeleteSilenceNotFoundCode int = 404
type DeleteSilenceNotFound (line 61) | type DeleteSilenceNotFound struct
method WriteResponse (line 71) | func (o *DeleteSilenceNotFound) WriteResponse(rw http.ResponseWriter, ...
function NewDeleteSilenceNotFound (line 65) | func NewDeleteSilenceNotFound() *DeleteSilenceNotFound {
constant DeleteSilenceInternalServerErrorCode (line 79) | DeleteSilenceInternalServerErrorCode int = 500
type DeleteSilenceInternalServerError (line 86) | type DeleteSilenceInternalServerError struct
method WithPayload (line 101) | func (o *DeleteSilenceInternalServerError) WithPayload(payload string)...
method SetPayload (line 107) | func (o *DeleteSilenceInternalServerError) SetPayload(payload string) {
method WriteResponse (line 112) | func (o *DeleteSilenceInternalServerError) WriteResponse(rw http.Respo...
function NewDeleteSilenceInternalServerError (line 95) | func NewDeleteSilenceInternalServerError() *DeleteSilenceInternalServerE...
FILE: api/v2/restapi/operations/silence/delete_silence_urlbuilder.go
type DeleteSilenceURL (line 32) | type DeleteSilenceURL struct
method WithBasePath (line 43) | func (o *DeleteSilenceURL) WithBasePath(bp string) *DeleteSilenceURL {
method SetBasePath (line 51) | func (o *DeleteSilenceURL) SetBasePath(bp string) {
method Build (line 56) | func (o *DeleteSilenceURL) Build() (*url.URL, error) {
method Must (line 78) | func (o *DeleteSilenceURL) Must(u *url.URL, err error) *url.URL {
method String (line 89) | func (o *DeleteSilenceURL) String() string {
method BuildFull (line 94) | func (o *DeleteSilenceURL) BuildFull(scheme, host string) (*url.URL, e...
method StringFull (line 113) | func (o *DeleteSilenceURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/silence/get_silence.go
type GetSilenceHandlerFunc (line 29) | type GetSilenceHandlerFunc
method Handle (line 32) | func (fn GetSilenceHandlerFunc) Handle(params GetSilenceParams) middle...
type GetSilenceHandler (line 37) | type GetSilenceHandler interface
function NewGetSilence (line 42) | func NewGetSilence(ctx *middleware.Context, handler GetSilenceHandler) *...
type GetSilence (line 51) | type GetSilence struct
method ServeHTTP (line 56) | func (o *GetSilence) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
FILE: api/v2/restapi/operations/silence/get_silence_parameters.go
function NewGetSilenceParams (line 34) | func NewGetSilenceParams() GetSilenceParams {
type GetSilenceParams (line 43) | type GetSilenceParams struct
method BindRequest (line 58) | func (o *GetSilenceParams) BindRequest(r *http.Request, route *middlew...
method bindSilenceID (line 74) | func (o *GetSilenceParams) bindSilenceID(rawData []string, hasKey bool...
method validateSilenceID (line 98) | func (o *GetSilenceParams) validateSilenceID(formats strfmt.Registry) ...
FILE: api/v2/restapi/operations/silence/get_silence_responses.go
constant GetSilenceOKCode (line 31) | GetSilenceOKCode int = 200
type GetSilenceOK (line 38) | type GetSilenceOK struct
method WithPayload (line 53) | func (o *GetSilenceOK) WithPayload(payload *models.GettableSilence) *G...
method SetPayload (line 59) | func (o *GetSilenceOK) SetPayload(payload *models.GettableSilence) {
method WriteResponse (line 64) | func (o *GetSilenceOK) WriteResponse(rw http.ResponseWriter, producer ...
function NewGetSilenceOK (line 47) | func NewGetSilenceOK() *GetSilenceOK {
constant GetSilenceNotFoundCode (line 76) | GetSilenceNotFoundCode int = 404
type GetSilenceNotFound (line 83) | type GetSilenceNotFound struct
method WriteResponse (line 93) | func (o *GetSilenceNotFound) WriteResponse(rw http.ResponseWriter, pro...
function NewGetSilenceNotFound (line 87) | func NewGetSilenceNotFound() *GetSilenceNotFound {
constant GetSilenceInternalServerErrorCode (line 101) | GetSilenceInternalServerErrorCode int = 500
type GetSilenceInternalServerError (line 108) | type GetSilenceInternalServerError struct
method WithPayload (line 123) | func (o *GetSilenceInternalServerError) WithPayload(payload string) *G...
method SetPayload (line 129) | func (o *GetSilenceInternalServerError) SetPayload(payload string) {
method WriteResponse (line 134) | func (o *GetSilenceInternalServerError) WriteResponse(rw http.Response...
function NewGetSilenceInternalServerError (line 117) | func NewGetSilenceInternalServerError() *GetSilenceInternalServerError {
FILE: api/v2/restapi/operations/silence/get_silence_urlbuilder.go
type GetSilenceURL (line 32) | type GetSilenceURL struct
method WithBasePath (line 43) | func (o *GetSilenceURL) WithBasePath(bp string) *GetSilenceURL {
method SetBasePath (line 51) | func (o *GetSilenceURL) SetBasePath(bp string) {
method Build (line 56) | func (o *GetSilenceURL) Build() (*url.URL, error) {
method Must (line 78) | func (o *GetSilenceURL) Must(u *url.URL, err error) *url.URL {
method String (line 89) | func (o *GetSilenceURL) String() string {
method BuildFull (line 94) | func (o *GetSilenceURL) BuildFull(scheme, host string) (*url.URL, erro...
method StringFull (line 113) | func (o *GetSilenceURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/silence/get_silences.go
type GetSilencesHandlerFunc (line 29) | type GetSilencesHandlerFunc
method Handle (line 32) | func (fn GetSilencesHandlerFunc) Handle(params GetSilencesParams) midd...
type GetSilencesHandler (line 37) | type GetSilencesHandler interface
function NewGetSilences (line 42) | func NewGetSilences(ctx *middleware.Context, handler GetSilencesHandler)...
type GetSilences (line 51) | type GetSilences struct
method ServeHTTP (line 56) | func (o *GetSilences) ServeHTTP(rw http.ResponseWriter, r *http.Reques...
FILE: api/v2/restapi/operations/silence/get_silences_parameters.go
function NewGetSilencesParams (line 34) | func NewGetSilencesParams() GetSilencesParams {
type GetSilencesParams (line 43) | type GetSilencesParams struct
method BindRequest (line 58) | func (o *GetSilencesParams) BindRequest(r *http.Request, route *middle...
method bindFilter (line 77) | func (o *GetSilencesParams) bindFilter(rawData []string, hasKey bool, ...
FILE: api/v2/restapi/operations/silence/get_silences_responses.go
constant GetSilencesOKCode (line 31) | GetSilencesOKCode int = 200
type GetSilencesOK (line 38) | type GetSilencesOK struct
method WithPayload (line 53) | func (o *GetSilencesOK) WithPayload(payload models.GettableSilences) *...
method SetPayload (line 59) | func (o *GetSilencesOK) SetPayload(payload models.GettableSilences) {
method WriteResponse (line 64) | func (o *GetSilencesOK) WriteResponse(rw http.ResponseWriter, producer...
function NewGetSilencesOK (line 47) | func NewGetSilencesOK() *GetSilencesOK {
constant GetSilencesBadRequestCode (line 79) | GetSilencesBadRequestCode int = 400
type GetSilencesBadRequest (line 86) | type GetSilencesBadRequest struct
method WithPayload (line 101) | func (o *GetSilencesBadRequest) WithPayload(payload string) *GetSilenc...
method SetPayload (line 107) | func (o *GetSilencesBadRequest) SetPayload(payload string) {
method WriteResponse (line 112) | func (o *GetSilencesBadRequest) WriteResponse(rw http.ResponseWriter, ...
function NewGetSilencesBadRequest (line 95) | func NewGetSilencesBadRequest() *GetSilencesBadRequest {
constant GetSilencesInternalServerErrorCode (line 122) | GetSilencesInternalServerErrorCode int = 500
type GetSilencesInternalServerError (line 129) | type GetSilencesInternalServerError struct
method WithPayload (line 144) | func (o *GetSilencesInternalServerError) WithPayload(payload string) *...
method SetPayload (line 150) | func (o *GetSilencesInternalServerError) SetPayload(payload string) {
method WriteResponse (line 155) | func (o *GetSilencesInternalServerError) WriteResponse(rw http.Respons...
function NewGetSilencesInternalServerError (line 138) | func NewGetSilencesInternalServerError() *GetSilencesInternalServerError {
FILE: api/v2/restapi/operations/silence/get_silences_urlbuilder.go
type GetSilencesURL (line 31) | type GetSilencesURL struct
method WithBasePath (line 42) | func (o *GetSilencesURL) WithBasePath(bp string) *GetSilencesURL {
method SetBasePath (line 50) | func (o *GetSilencesURL) SetBasePath(bp string) {
method Build (line 55) | func (o *GetSilencesURL) Build() (*url.URL, error) {
method Must (line 88) | func (o *GetSilencesURL) Must(u *url.URL, err error) *url.URL {
method String (line 99) | func (o *GetSilencesURL) String() string {
method BuildFull (line 104) | func (o *GetSilencesURL) BuildFull(scheme, host string) (*url.URL, err...
method StringFull (line 123) | func (o *GetSilencesURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/operations/silence/post_silences.go
type PostSilencesHandlerFunc (line 32) | type PostSilencesHandlerFunc
method Handle (line 35) | func (fn PostSilencesHandlerFunc) Handle(params PostSilencesParams) mi...
type PostSilencesHandler (line 40) | type PostSilencesHandler interface
function NewPostSilences (line 45) | func NewPostSilences(ctx *middleware.Context, handler PostSilencesHandle...
type PostSilences (line 54) | type PostSilences struct
method ServeHTTP (line 59) | func (o *PostSilences) ServeHTTP(rw http.ResponseWriter, r *http.Reque...
type PostSilencesOKBody (line 79) | type PostSilencesOKBody struct
method Validate (line 86) | func (o *PostSilencesOKBody) Validate(formats strfmt.Registry) error {
method ContextValidate (line 91) | func (o *PostSilencesOKBody) ContextValidate(ctx context.Context, form...
method MarshalBinary (line 96) | func (o *PostSilencesOKBody) MarshalBinary() ([]byte, error) {
method UnmarshalBinary (line 104) | func (o *PostSilencesOKBody) UnmarshalBinary(b []byte) error {
FILE: api/v2/restapi/operations/silence/post_silences_parameters.go
function NewPostSilencesParams (line 38) | func NewPostSilencesParams() PostSilencesParams {
type PostSilencesParams (line 47) | type PostSilencesParams struct
method BindRequest (line 62) | func (o *PostSilencesParams) BindRequest(r *http.Request, route *middl...
FILE: api/v2/restapi/operations/silence/post_silences_responses.go
constant PostSilencesOKCode (line 29) | PostSilencesOKCode int = 200
type PostSilencesOK (line 36) | type PostSilencesOK struct
method WithPayload (line 51) | func (o *PostSilencesOK) WithPayload(payload *PostSilencesOKBody) *Pos...
method SetPayload (line 57) | func (o *PostSilencesOK) SetPayload(payload *PostSilencesOKBody) {
method WriteResponse (line 62) | func (o *PostSilencesOK) WriteResponse(rw http.ResponseWriter, produce...
function NewPostSilencesOK (line 45) | func NewPostSilencesOK() *PostSilencesOK {
constant PostSilencesBadRequestCode (line 74) | PostSilencesBadRequestCode int = 400
type PostSilencesBadRequest (line 81) | type PostSilencesBadRequest struct
method WithPayload (line 96) | func (o *PostSilencesBadRequest) WithPayload(payload string) *PostSile...
method SetPayload (line 102) | func (o *PostSilencesBadRequest) SetPayload(payload string) {
method WriteResponse (line 107) | func (o *PostSilencesBadRequest) WriteResponse(rw http.ResponseWriter,...
function NewPostSilencesBadRequest (line 90) | func NewPostSilencesBadRequest() *PostSilencesBadRequest {
constant PostSilencesNotFoundCode (line 117) | PostSilencesNotFoundCode int = 404
type PostSilencesNotFound (line 124) | type PostSilencesNotFound struct
method WithPayload (line 139) | func (o *PostSilencesNotFound) WithPayload(payload string) *PostSilenc...
method SetPayload (line 145) | func (o *PostSilencesNotFound) SetPayload(payload string) {
method WriteResponse (line 150) | func (o *PostSilencesNotFound) WriteResponse(rw http.ResponseWriter, p...
function NewPostSilencesNotFound (line 133) | func NewPostSilencesNotFound() *PostSilencesNotFound {
FILE: api/v2/restapi/operations/silence/post_silences_urlbuilder.go
type PostSilencesURL (line 29) | type PostSilencesURL struct
method WithBasePath (line 36) | func (o *PostSilencesURL) WithBasePath(bp string) *PostSilencesURL {
method SetBasePath (line 44) | func (o *PostSilencesURL) SetBasePath(bp string) {
method Build (line 49) | func (o *PostSilencesURL) Build() (*url.URL, error) {
method Must (line 64) | func (o *PostSilencesURL) Must(u *url.URL, err error) *url.URL {
method String (line 75) | func (o *PostSilencesURL) String() string {
method BuildFull (line 80) | func (o *PostSilencesURL) BuildFull(scheme, host string) (*url.URL, er...
method StringFull (line 99) | func (o *PostSilencesURL) StringFull(scheme, host string) string {
FILE: api/v2/restapi/server.go
constant schemeHTTP (line 45) | schemeHTTP = "http"
constant schemeHTTPS (line 46) | schemeHTTPS = "https"
constant schemeUnix (line 47) | schemeUnix = "unix"
function init (line 52) | func init() {
function NewServer (line 59) | func NewServer(api *operations.AlertmanagerAPI) *Server {
type Server (line 83) | type Server struct
method ConfigureAPI (line 69) | func (s *Server) ConfigureAPI() {
method ConfigureFlags (line 76) | func (s *Server) ConfigureFlags() {
method Logf (line 121) | func (s *Server) Logf(f string, args ...any) {
method Fatalf (line 131) | func (s *Server) Fatalf(f string, args ...any) {
method SetAPI (line 141) | func (s *Server) SetAPI(api *operations.AlertmanagerAPI) {
method hasScheme (line 152) | func (s *Server) hasScheme(scheme string) bool {
method Serve (line 167) | func (s *Server) Serve() (err error) {
method Listen (line 343) | func (s *Server) Listen() error {
method Shutdown (line 414) | func (s *Server) Shutdown() error {
method handleShutdown (line 421) | func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*htt...
method GetHandler (line 464) | func (s *Server) GetHandler() http.Handler {
method SetHandler (line 469) | func (s *Server) SetHandler(handler http.Handler) {
method UnixListener (line 474) | func (s *Server) UnixListener() (net.Listener, error) {
method HTTPListener (line 484) | func (s *Server) HTTPListener() (net.Listener, error) {
method TLSListener (line 494) | func (s *Server) TLSListener() (net.Listener, error) {
function handleInterrupt (line 503) | func handleInterrupt(once *sync.Once, s *Server) {
function signalNotify (line 519) | func signalNotify(interrupt chan<- os.Signal) {
FILE: api/v2/testing.go
function createSilence (line 27) | func createSilence(t *testing.T, ID, creator string, start, ends time.Ti...
function createSilenceMatcher (line 50) | func createSilenceMatcher(t *testing.T, name, pattern string, matcherTyp...
function createLabelMatcher (line 60) | func createLabelMatcher(t *testing.T, name, value string, matchType labe...
FILE: cli/alert.go
function configureAlertCmd (line 20) | func configureAlertCmd(app *kingpin.Application) {
FILE: cli/alert_add.go
type alertAddCmd (line 32) | type alertAddCmd struct
method addAlert (line 76) | func (a *alertAddCmd) addAlert(ctx context.Context, _ *kingpin.ParseCo...
constant alertAddHelp (line 40) | alertAddHelp = `Add a new alert.
function configureAddAlertCmd (line 63) | func configureAddAlertCmd(cc *kingpin.CmdClause) {
FILE: cli/alert_query.go
type alertQueryCmd (line 29) | type alertQueryCmd struct
method queryAlerts (line 77) | func (a *alertQueryCmd) queryAlerts(ctx context.Context, _ *kingpin.Pa...
constant alertQueryHelp (line 35) | alertQueryHelp = `View and search through current alerts.
function configureQueryAlertsCmd (line 63) | func configureQueryAlertsCmd(cc *kingpin.CmdClause) {
FILE: cli/check_config.go
type checkConfigCmd (line 27) | type checkConfigCmd struct
method checkConfig (line 47) | func (c *checkConfigCmd) checkConfig(ctx *kingpin.ParseContext) error {
constant checkConfigHelp (line 31) | checkConfigHelp = `Validate alertmanager config files
function configureCheckConfigCmd (line 38) | func configureCheckConfigCmd(app *kingpin.Application) {
function CheckConfig (line 51) | func CheckConfig(args []string) error {
FILE: cli/check_config_test.go
function TestCheckConfig (line 20) | func TestCheckConfig(t *testing.T) {
FILE: cli/cluster.go
constant clusterHelp (line 25) | clusterHelp = `View cluster status and peers.`
function configureClusterCmd (line 28) | func configureClusterCmd(app *kingpin.Application) {
function showStatus (line 33) | func showStatus(ctx context.Context, _ *kingpin.ParseContext) error {
FILE: cli/config.go
constant configHelp (line 25) | configHelp = `View current config.
function configureConfigCmd (line 34) | func configureConfigCmd(app *kingpin.Application) {
function queryConfig (line 40) | func queryConfig(ctx context.Context, _ *kingpin.ParseContext) error {
FILE: cli/config/config.go
type getFlagger (line 23) | type getFlagger interface
type Resolver (line 28) | type Resolver struct
method setDefault (line 68) | func (c *Resolver) setDefault(v getFlagger) {
method Bind (line 78) | func (c *Resolver) Bind(app *kingpin.Application, args []string) error {
function NewResolver (line 33) | func NewResolver(files []string, legacyFlags map[string]string) (*Resolv...
FILE: cli/config/config_test.go
function newApp (line 28) | func newApp() *kingpin.Application {
function TestNewConfigResolver (line 46) | func TestNewConfigResolver(t *testing.T) {
type expectFn (line 67) | type expectFn
function TestConfigResolverBind (line 69) | func TestConfigResolverBind(t *testing.T) {
FILE: cli/config/http_config.go
function LoadHTTPConfigFile (line 25) | func LoadHTTPConfigFile(filename string) (*promconfig.HTTPClientConfig, ...
FILE: cli/format/format.go
constant DefaultDateFormat (line 27) | DefaultDateFormat = "2006-01-02 15:04:05 MST"
function InitFormatFlags (line 31) | func InitFormatFlags(app *kingpin.Application) {
type Formatter (line 36) | type Formatter interface
function FormatDate (line 47) | func FormatDate(input strfmt.DateTime) string {
function labelsMatcher (line 51) | func labelsMatcher(m models.Matcher) *labels.Matcher {
FILE: cli/format/format_extended.go
type ExtendedFormatter (line 28) | type ExtendedFormatter struct
method SetOutput (line 36) | func (formatter *ExtendedFormatter) SetOutput(writer io.Writer) {
method FormatSilences (line 41) | func (formatter *ExtendedFormatter) FormatSilences(silences []models.G...
method FormatAlerts (line 62) | func (formatter *ExtendedFormatter) FormatAlerts(alerts []*models.Gett...
method FormatConfig (line 82) | func (formatter *ExtendedFormatter) FormatConfig(status *models.Alertm...
method FormatClusterStatus (line 95) | func (formatter *ExtendedFormatter) FormatClusterStatus(status *models...
function init (line 32) | func init() {
function extendedFormatLabels (line 115) | func extendedFormatLabels(labels models.LabelSet) string {
function extendedFormatAnnotations (line 124) | func extendedFormatAnnotations(labels models.LabelSet) string {
function extendedFormatMatchers (line 133) | func extendedFormatMatchers(matchers models.Matchers) string {
FILE: cli/format/format_json.go
type JSONFormatter (line 24) | type JSONFormatter struct
method SetOutput (line 32) | func (formatter *JSONFormatter) SetOutput(writer io.Writer) {
method FormatSilences (line 36) | func (formatter *JSONFormatter) FormatSilences(silences []models.Getta...
method FormatAlerts (line 41) | func (formatter *JSONFormatter) FormatAlerts(alerts []*models.Gettable...
method FormatConfig (line 46) | func (formatter *JSONFormatter) FormatConfig(status *models.Alertmanag...
method FormatClusterStatus (line 51) | func (formatter *JSONFormatter) FormatClusterStatus(status *models.Clu...
function init (line 28) | func init() {
FILE: cli/format/format_simple.go
type SimpleFormatter (line 27) | type SimpleFormatter struct
method SetOutput (line 35) | func (formatter *SimpleFormatter) SetOutput(writer io.Writer) {
method FormatSilences (line 39) | func (formatter *SimpleFormatter) FormatSilences(silences []models.Get...
method FormatAlerts (line 57) | func (formatter *SimpleFormatter) FormatAlerts(alerts []*models.Gettab...
method FormatConfig (line 74) | func (formatter *SimpleFormatter) FormatConfig(status *models.Alertman...
method FormatClusterStatus (line 79) | func (formatter *SimpleFormatter) FormatClusterStatus(status *models.C...
function init (line 31) | func init() {
function simpleFormatMatchers (line 89) | func simpleFormatMatchers(matchers models.Matchers) string {
function simpleFormatMatcher (line 97) | func simpleFormatMatcher(m models.Matcher) string {
FILE: cli/format/sort.go
type ByEndAt (line 25) | type ByEndAt
method Len (line 27) | func (s ByEndAt) Len() int { return len(s) }
method Swap (line 28) | func (s ByEndAt) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
method Less (line 29) | func (s ByEndAt) Less(i, j int) bool {
type ByStartsAt (line 33) | type ByStartsAt
method Len (line 35) | func (s ByStartsAt) Len() int { return len(s) }
method Swap (line 36) | func (s ByStartsAt) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
method Less (line 37) | func (s ByStartsAt) Less(i, j int) bool {
type ByAddress (line 41) | type ByAddress
method Len (line 43) | func (s ByAddress) Len() int { return len(s) }
method Swap (line 44) | func (s ByAddress) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
method Less (line 45) | func (s ByAddress) Less(i, j int) bool {
FILE: cli/root.go
function initMatchersCompat (line 52) | func initMatchersCompat(_ *kingpin.ParseContext) error {
function requireAlertManagerURL (line 67) | func requireAlertManagerURL(pc *kingpin.ParseContext) error {
constant defaultAmHost (line 86) | defaultAmHost = "localhost"
constant defaultAmPort (line 87) | defaultAmPort = "9093"
constant defaultAmApiv2path (line 88) | defaultAmApiv2path = "/api/v2"
function NewAlertmanagerClient (line 92) | func NewAlertmanagerClient(amURL *url.URL) *client.AlertmanagerAPI {
function Execute (line 148) | func Execute() {
constant helpRoot (line 191) | helpRoot = `View and modify the current Alertmanager state.
FILE: cli/routing.go
type routingShow (line 28) | type routingShow struct
method routingShowAction (line 63) | func (c *routingShow) routingShowAction(ctx context.Context, _ *kingpi...
constant routingHelp (line 36) | routingHelp = `Prints alert routing tree
constant branchSlugSeparator (line 48) | branchSlugSeparator = " "
function configureRoutingCmd (line 51) | func configureRoutingCmd(app *kingpin.CmdClause) {
function getRouteTreeSlug (line 78) | func getRouteTreeSlug(route *dispatch.Route, showContinue, showReceiver ...
function convertRouteToTree (line 97) | func convertRouteToTree(route *dispatch.Route, tree treeprint.Tree) {
function getMatchingTree (line 104) | func getMatchingTree(route *dispatch.Route, tree treeprint.Tree, lset mo...
FILE: cli/silence.go
function configureSilenceCmd (line 21) | func configureSilenceCmd(app *kingpin.Application) {
FILE: cli/silence_add.go
function username (line 34) | func username() string {
type silenceAddCmd (line 42) | type silenceAddCmd struct
method add (line 93) | func (c *silenceAddCmd) add(ctx context.Context, _ *kingpin.ParseConte...
constant silenceAddHelp (line 53) | silenceAddHelp = `Add a new alertmanager silence
function configureSilenceAddCmd (line 77) | func configureSilenceAddCmd(cc *kingpin.CmdClause) {
FILE: cli/silence_expire.go
type silenceExpireCmd (line 26) | type silenceExpireCmd struct
method expire (line 39) | func (c *silenceExpireCmd) expire(ctx context.Context, _ *kingpin.Pars...
function configureSilenceExpireCmd (line 30) | func configureSilenceExpireCmd(cc *kingpin.CmdClause) {
FILE: cli/silence_import.go
type silenceImportCmd (line 30) | type silenceImportCmd struct
method bulkImport (line 81) | func (c *silenceImportCmd) bulkImport(ctx context.Context, _ *kingpin....
constant silenceImportHelp (line 36) | silenceImportHelp = `Import alertmanager silences from JSON file or stdin
function configureSilenceImportCmd (line 48) | func configureSilenceImportCmd(cc *kingpin.CmdClause) {
function addSilenceWorker (line 60) | func addSilenceWorker(ctx context.Context, sclient silence.ClientService...
FILE: cli/silence_query.go
type silenceQueryCmd (line 31) | type silenceQueryCmd struct
method query (line 97) | func (c *silenceQueryCmd) query(ctx context.Context, _ *kingpin.ParseC...
constant querySilenceHelp (line 40) | querySilenceHelp = `Query Alertmanager silences.
function configureSilenceQueryCmd (line 82) | func configureSilenceQueryCmd(cc *kingpin.CmdClause) {
FILE: cli/silence_update.go
type silenceUpdateCmd (line 31) | type silenceUpdateCmd struct
method update (line 55) | func (c *silenceUpdateCmd) update(ctx context.Context, _ *kingpin.Pars...
function configureSilenceUpdateCmd (line 40) | func configureSilenceUpdateCmd(cc *kingpin.CmdClause) {
FILE: cli/template.go
function configureTemplateCmd (line 21) | func configureTemplateCmd(app *kingpin.Application) {
FILE: cli/template_render.go
type templateRenderCmd (line 89) | type templateRenderCmd struct
method render (line 110) | func (c *templateRenderCmd) render(ctx context.Context, _ *kingpin.Par...
function configureTemplateRenderCmd (line 96) | func configureTemplateRenderCmd(cc *kingpin.CmdClause) {
FILE: cli/test_routing.go
constant routingTestHelp (line 31) | routingTestHelp = `Test alert routing
function configureRoutingTestCmd (line 45) | func configureRoutingTestCmd(cc *kingpin.CmdClause, c *routingShow) {
function resolveAlertReceivers (line 55) | func resolveAlertReceivers(mainRoute *dispatch.Route, labels *models.Lab...
function printMatchingTree (line 67) | func printMatchingTree(mainRoute *dispatch.Route, ls models.LabelSet) {
method routingTestAction (line 75) | func (c *routingShow) routingTestAction(ctx context.Context, _ *kingpin....
FILE: cli/test_routing_test.go
type routingTestDefinition (line 27) | type routingTestDefinition struct
function checkResolvedReceivers (line 33) | func checkResolvedReceivers(mainRoute *dispatch.Route, ls models.LabelSe...
function TestRoutingTest (line 44) | func TestRoutingTest(t *testing.T) {
FILE: cli/utils.go
function getRemoteAlertmanagerConfigStatus (line 33) | func getRemoteAlertmanagerConfigStatus(ctx context.Context, alertmanager...
function checkRoutingConfigInputFlags (line 44) | func checkRoutingConfigInputFlags(alertmanagerURL *url.URL, configFile s...
function loadAlertmanagerConfig (line 53) | func loadAlertmanagerConfig(ctx context.Context, alertmanagerURL *url.UR...
function convertClientToCommonLabelSet (line 73) | func convertClientToCommonLabelSet(cls models.LabelSet) model.LabelSet {
function TypeMatchers (line 82) | func TypeMatchers(matchers []labels.Matcher) models.Matchers {
function TypeMatcher (line 91) | func TypeMatcher(matcher labels.Matcher) *models.Matcher {
function execWithTimeout (line 107) | func execWithTimeout(fn func(context.Context, *kingpin.ParseContext) err...
FILE: cluster/advertise.go
type getIPFunc (line 24) | type getIPFunc
function calculateAdvertiseAddress (line 38) | func calculateAdvertiseAddress(bindAddr, advertiseAddr string, allowInse...
function discoverAdvertiseAddress (line 65) | func discoverAdvertiseAddress(allowInsecureAdvertise bool) (net.IP, erro...
FILE: cluster/advertise_test.go
function TestCalculateAdvertiseAddress (line 24) | func TestCalculateAdvertiseAddress(t *testing.T) {
FILE: cluster/channel.go
type Channel (line 31) | type Channel struct
method handleOverSizedMessages (line 105) | func (c *Channel) handleOverSizedMessages(stopc <-chan struct{}) {
method Broadcast (line 133) | func (c *Channel) Broadcast(b []byte) {
function NewChannel (line 48) | func NewChannel(
function OversizedMessage (line 153) | func OversizedMessage(b []byte) bool {
FILE: cluster/channel_test.go
function TestNormalMessagesGossiped (line 28) | func TestNormalMessagesGossiped(t *testing.T) {
function TestOversizedMessagesGossiped (line 43) | func TestOversizedMessagesGossiped(t *testing.T) {
function newChannel (line 75) | func newChannel(
FILE: cluster/cluster.go
type ClusterPeer (line 36) | type ClusterPeer interface
type ClusterMember (line 46) | type ClusterMember interface
type ClusterChannel (line 54) | type ClusterChannel interface
type Peer (line 59) | type Peer struct
method Join (line 265) | func (p *Peer) Join(
method setInitialFailed (line 301) | func (p *Peer) setInitialFailed(peers []string, myAddr string) {
method register (line 344) | func (p *Peer) register(reg prometheus.Registerer, name string) {
method runPeriodicTask (line 395) | func (p *Peer) runPeriodicTask(d time.Duration, f func()) {
method removeFailedPeers (line 409) | func (p *Peer) removeFailedPeers(timeout time.Duration) {
method reconnect (line 428) | func (p *Peer) reconnect() {
method refresh (line 448) | func (p *Peer) refresh() {
method peerJoin (line 481) | func (p *Peer) peerJoin(n *memberlist.Node) {
method peerLeave (line 509) | func (p *Peer) peerLeave(n *memberlist.Node) {
method peerUpdate (line 529) | func (p *Peer) peerUpdate(n *memberlist.Node) {
method AddState (line 549) | func (p *Peer) AddState(key string, s State, reg prometheus.Registerer...
method Leave (line 574) | func (p *Peer) Leave(timeout time.Duration) error {
method Name (line 581) | func (p *Peer) Name() string {
method ClusterSize (line 586) | func (p *Peer) ClusterSize() int {
method Ready (line 591) | func (p *Peer) Ready() bool {
method WaitReady (line 601) | func (p *Peer) WaitReady(ctx context.Context) error {
method Status (line 611) | func (p *Peer) Status() string {
method Info (line 621) | func (p *Peer) Info() map[string]any {
method Self (line 632) | func (p *Peer) Self() *memberlist.Node {
method Peers (line 648) | func (p *Peer) Peers() []ClusterMember {
method Position (line 659) | func (p *Peer) Position() int {
method Settle (line 680) | func (p *Peer) Settle(ctx context.Context, interval time.Duration) {
type peer (line 91) | type peer struct
type PeerStatus (line 99) | type PeerStatus
method String (line 107) | func (s PeerStatus) String() string {
constant StatusNone (line 102) | StatusNone PeerStatus = iota
constant StatusAlive (line 103) | StatusAlive
constant StatusFailed (line 104) | StatusFailed
constant DefaultPushPullInterval (line 121) | DefaultPushPullInterval = 60 * time.Second
constant DefaultGossipInterval (line 122) | DefaultGossipInterval = 200 * time.Millisecond
constant DefaultTCPTimeout (line 123) | DefaultTCPTimeout = 10 * time.Second
constant DefaultProbeTimeout (line 124) | DefaultProbeTimeout = 500 * time.Millisecond
constant DefaultProbeInterval (line 125) | DefaultProbeInterval = 1 * time.Second
constant DefaultReconnectInterval (line 126) | DefaultReconnectInterval = 10 * time.Second
constant DefaultReconnectTimeout (line 127) | DefaultReconnectTimeout = 6 * time.Hour
constant DefaultRefreshInterval (line 128) | DefaultRefreshInterval = 15 * time.Second
constant DefaultResolvePeersTimeout (line 129) | DefaultResolvePeersTimeout = 15 * time.Second
constant MaxGossipPacketSize (line 130) | MaxGossipPacketSize = 1400
function Create (line 133) | func Create(
type Member (line 637) | type Member struct
method Name (line 642) | func (m Member) Name() string { return m.node.Name }
method Address (line 645) | func (m Member) Address() string { return m.node.Address() }
type State (line 717) | type State interface
type simpleBroadcast (line 726) | type simpleBroadcast
method Message (line 728) | func (b simpleBroadcast) Message() []byte { retu...
method Invalidates (line 729) | func (b simpleBroadcast) Invalidates(memberlist.Broadcast) bool { retu...
method Finished (line 730) | func (b simpleBroadcast) Finished() {}
function resolvePeers (line 732) | func resolvePeers(ctx context.Context, peers []string, myAddress string,...
function removeMyAddr (line 789) | func removeMyAddr(ips []net.IPAddr, targetPort, myAddr string) []net.IPA...
function hasNonlocal (line 802) | func hasNonlocal(clusterPeers []string) bool {
function isUnroutable (line 816) | func isUnroutable(addr string) bool {
function isAny (line 828) | func isAny(addr string) bool {
function retry (line 836) | func retry(interval time.Duration, stopc <-chan struct{}, f func() error...
function removeOldPeer (line 853) | func removeOldPeer(old []peer, addr string) []peer {
FILE: cluster/cluster_test.go
function TestClusterJoinAndReconnect (line 28) | func TestClusterJoinAndReconnect(t *testing.T) {
function testJoinLeave (line 44) | func testJoinLeave(t *testing.T) {
function testReconnect (line 119) | func testReconnect(t *testing.T) {
function testRemoveFailedPeers (line 190) | func testRemoveFailedPeers(t *testing.T) {
function testInitiallyFailingPeers (line 242) | func testInitiallyFailingPeers(t *testing.T) {
function testTLSConnection (line 292) | func testTLSConnection(t *testing.T) {
function testPeerNames (line 367) | func testPeerNames(t *testing.T, name1, name2 string) {
FILE: cluster/clusterpb/cluster.pb.go
constant _ (line 19) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 21) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type MemberlistMessage_Kind (line 24) | type MemberlistMessage_Kind
method Enum (line 43) | func (x MemberlistMessage_Kind) Enum() *MemberlistMessage_Kind {
method String (line 49) | func (x MemberlistMessage_Kind) String() string {
method Descriptor (line 53) | func (MemberlistMessage_Kind) Descriptor() protoreflect.EnumDescriptor {
method Type (line 57) | func (MemberlistMessage_Kind) Type() protoreflect.EnumType {
method Number (line 61) | func (x MemberlistMessage_Kind) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 66) | func (MemberlistMessage_Kind) EnumDescriptor() ([]byte, []int) {
constant MemberlistMessage_STREAM (line 27) | MemberlistMessage_STREAM MemberlistMessage_Kind = 0
constant MemberlistMessage_PACKET (line 28) | MemberlistMessage_PACKET MemberlistMessage_Kind = 1
type Part (line 70) | type Part struct
method Reset (line 78) | func (x *Part) Reset() {
method String (line 85) | func (x *Part) String() string {
method ProtoMessage (line 89) | func (*Part) ProtoMessage() {}
method ProtoReflect (line 91) | func (x *Part) ProtoReflect() protoreflect.Message {
method Descriptor (line 104) | func (*Part) Descriptor() ([]byte, []int) {
method GetKey (line 108) | func (x *Part) GetKey() string {
method GetData (line 115) | func (x *Part) GetData() []byte {
type FullState (line 122) | type FullState struct
method Reset (line 129) | func (x *FullState) Reset() {
method String (line 136) | func (x *FullState) String() string {
method ProtoMessage (line 140) | func (*FullState) ProtoMessage() {}
method ProtoReflect (line 142) | func (x *FullState) ProtoReflect() protoreflect.Message {
method Descriptor (line 155) | func (*FullState) Descriptor() ([]byte, []int) {
method GetParts (line 159) | func (x *FullState) GetParts() []*Part {
type MemberlistMessage (line 166) | type MemberlistMessage struct
method Reset (line 176) | func (x *MemberlistMessage) Reset() {
method String (line 183) | func (x *MemberlistMessage) String() string {
method ProtoMessage (line 187) | func (*MemberlistMessage) ProtoMessage() {}
method ProtoReflect (line 189) | func (x *MemberlistMessage) ProtoReflect() protoreflect.Message {
method Descriptor (line 202) | func (*MemberlistMessage) Descriptor() ([]byte, []int) {
method GetVersion (line 206) | func (x *MemberlistMessage) GetVersion() string {
method GetKind (line 213) | func (x *MemberlistMessage) GetKind() MemberlistMessage_Kind {
method GetFromAddr (line 220) | func (x *MemberlistMessage) GetFromAddr() string {
method GetMsg (line 227) | func (x *MemberlistMessage) GetMsg() []byte {
constant file_cluster_proto_rawDesc (line 236) | file_cluster_proto_rawDesc = "" +
function file_cluster_proto_rawDescGZIP (line 260) | func file_cluster_proto_rawDescGZIP() []byte {
function init (line 285) | func init() { file_cluster_proto_init() }
function file_cluster_proto_init (line 286) | func file_cluster_proto_init() {
FILE: cluster/connection_pool.go
constant capacity (line 26) | capacity = 1024
type connectionPool (line 28) | type connectionPool struct
method borrowConnection (line 51) | func (pool *connectionPool) borrowConnection(addr string, timeout time...
method shutdown (line 70) | func (pool *connectionPool) shutdown() {
function newConnectionPool (line 34) | func newConnectionPool(tlsClientCfg *tls.Config) (*connectionPool, error) {
FILE: cluster/delegate.go
constant maxQueueSize (line 30) | maxQueueSize = 4096
constant fullState (line 31) | fullState = "full_state"
constant update (line 32) | update = "update"
type delegate (line 37) | type delegate struct
method NodeMeta (line 150) | func (d *delegate) NodeMeta(limit int) []byte {
method NotifyMsg (line 155) | func (d *delegate) NotifyMsg(b []byte) {
method NotifyConflict (line 179) | func (d *delegate) NotifyConflict(existing, other *memberlist.Node) {
method GetBroadcasts (line 185) | func (d *delegate) GetBroadcasts(overhead, limit int) [][]byte {
method LocalState (line 195) | func (d *delegate) LocalState(_ bool) []byte {
method MergeRemoteState (line 220) | func (d *delegate) MergeRemoteState(buf []byte, _ bool) {
method NotifyJoin (line 245) | func (d *delegate) NotifyJoin(n *memberlist.Node) {
method NotifyLeave (line 251) | func (d *delegate) NotifyLeave(n *memberlist.Node) {
method NotifyUpdate (line 257) | func (d *delegate) NotifyUpdate(n *memberlist.Node) {
method NotifyAlive (line 263) | func (d *delegate) NotifyAlive(peer *memberlist.Node) error {
method AckPayload (line 269) | func (d *delegate) AckPayload() []byte {
method NotifyPingComplete (line 274) | func (d *delegate) NotifyPingComplete(peer *memberlist.Node, rtt time....
method handleQueueDepth (line 280) | func (d *delegate) handleQueueDepth() {
function newDelegate (line 53) | func newDelegate(l *slog.Logger, reg prometheus.Registerer, p *Peer, ret...
FILE: cluster/tls_config.go
type TLSTransportConfig (line 26) | type TLSTransportConfig struct
function GetTLSTransportConfig (line 31) | func GetTLSTransportConfig(configPath string) (*TLSTransportConfig, erro...
FILE: cluster/tls_connection.go
constant version (line 34) | version = "v0.1.0"
constant uint32length (line 35) | uint32length = 4
type tlsConn (line 39) | type tlsConn struct
method Write (line 66) | func (conn *tlsConn) Write(b []byte) (int, error) {
method alive (line 76) | func (conn *tlsConn) alive() bool {
method getRawConn (line 82) | func (conn *tlsConn) getRawConn() net.Conn {
method writePacket (line 93) | func (conn *tlsConn) writePacket(fromAddr string, b []byte) error {
method writeStream (line 112) | func (conn *tlsConn) writeStream() error {
method read (line 130) | func (conn *tlsConn) read() (*memberlist.Packet, error) {
method Close (line 180) | func (conn *tlsConn) Close() error {
function dialTLSConn (line 45) | func dialTLSConn(addr string, timeout time.Duration, tlsConfig *tls.Conf...
function rcvTLSConn (line 58) | func rcvTLSConn(conn net.Conn) *tlsConn {
function toPacket (line 168) | func toPacket(pb *clusterpb.MemberlistMessage) (*memberlist.Packet, erro...
FILE: cluster/tls_connection_test.go
function TestWriteStream (line 25) | func TestWriteStream(t *testing.T) {
function TestWritePacket (line 40) | func TestWritePacket(t *testing.T) {
function TestRead_Nil (line 65) | func TestRead_Nil(t *testing.T) {
function TestTLSConn_Close (line 71) | func TestTLSConn_Close(t *testing.T) {
type mockConn (line 90) | type mockConn struct
method Read (line 95) | func (m *mockConn) Read(b []byte) (n int, err error) {
method Write (line 99) | func (m *mockConn) Write(b []byte) (n int, err error) {
method Close (line 103) | func (m *mockConn) Close() error {
method LocalAddr (line 108) | func (m *mockConn) LocalAddr() net.Addr {
method RemoteAddr (line 112) | func (m *mockConn) RemoteAddr() net.Addr {
method SetDeadline (line 116) | func (m *mockConn) SetDeadline(t time.Time) error {
method SetReadDeadline (line 120) | func (m *mockConn) SetReadDeadline(t time.Time) error {
method SetWriteDeadline (line 124) | func (m *mockConn) SetWriteDeadline(t time.Time) error {
FILE: cluster/tls_transport.go
constant metricNamespace (line 39) | metricNamespace = "alertmanager"
constant metricSubsystem (line 40) | metricSubsystem = "tls_transport"
constant network (line 41) | network = "tcp"
type TLSTransport (line 46) | type TLSTransport struct
method FinalAdvertiseAddr (line 142) | func (t *TLSTransport) FinalAdvertiseAddr(ip string, port int) (net.IP...
method PacketCh (line 182) | func (t *TLSTransport) PacketCh() <-chan *memberlist.Packet {
method StreamCh (line 188) | func (t *TLSTransport) StreamCh() <-chan net.Conn {
method Shutdown (line 194) | func (t *TLSTransport) Shutdown() error {
method WriteTo (line 206) | func (t *TLSTransport) WriteTo(b []byte, addr string) (time.Time, erro...
method DialTimeout (line 224) | func (t *TLSTransport) DialTimeout(addr string, timeout time.Duration)...
method GetAutoBindPort (line 242) | func (t *TLSTransport) GetAutoBindPort() int {
method listen (line 247) | func (t *TLSTransport) listen() {
method handle (line 271) | func (t *TLSTransport) handle(conn net.Conn) {
method registerMetrics (line 296) | func (t *TLSTransport) registerMetrics(reg prometheus.Registerer) {
function NewTLSTransport (line 72) | func NewTLSTransport(
FILE: cluster/tls_transport_test.go
function freeport (line 34) | func freeport() int {
function newTLSTransport (line 41) | func newTLSTransport(file, address string, port int) (*TLSTransport, err...
function TestNewTLSTransport (line 50) | func TestNewTLSTransport(t *testing.T) {
constant localhost (line 111) | localhost = "127.0.0.1"
function TestFinalAdvertiseAddr (line 113) | func TestFinalAdvertiseAddr(t *testing.T) {
function TestWriteTo (line 154) | func TestWriteTo(t *testing.T) {
function BenchmarkWriteTo (line 173) | func BenchmarkWriteTo(b *testing.B) {
function TestDialTimeout (line 195) | func TestDialTimeout(t *testing.T) {
function TestShutdown (line 232) | func TestShutdown(t *testing.T) {
function loadTLSTransportConfig (line 249) | func loadTLSTransportConfig(tb testing.TB, filename string) *TLSTranspor...
FILE: cmd/alertmanager/main.go
function instrumentHandler (line 115) | func instrumentHandler(handlerName string, handler http.HandlerFunc) htt...
constant defaultClusterAddr (line 126) | defaultClusterAddr = "0.0.0.0:9094"
function main (line 128) | func main() {
function run (line 132) | func run() int {
function clusterWait (line 637) | func clusterWait(p *cluster.Peer, timeout time.Duration) func() time.Dur...
function extURL (line 643) | func extURL(logger *slog.Logger, hostnamef func() (string, error), liste...
FILE: cmd/alertmanager/main_test.go
function TestExternalURL (line 24) | func TestExternalURL(t *testing.T) {
FILE: cmd/amtool/main.go
function main (line 18) | func main() {
FILE: config/common/inhibitrule.go
type InhibitRule (line 27) | type InhibitRule struct
method UnmarshalYAML (line 52) | func (r *InhibitRule) UnmarshalYAML(unmarshal func(any) error) error {
FILE: config/common/inhibitrule_test.go
function mustUnmarshalInhibitRule (line 27) | func mustUnmarshalInhibitRule(t *testing.T, input string) InhibitRule {
function unmarshalInhibitRule (line 35) | func unmarshalInhibitRule(input string) (InhibitRule, error) {
constant inhibitRuleEqualYAML (line 41) | inhibitRuleEqualYAML = `
constant inhibitRuleEqualUTF8YAML (line 47) | inhibitRuleEqualUTF8YAML = `
function TestInhibitRuleEqual (line 53) | func TestInhibitRuleEqual(t *testing.T) {
FILE: config/common/matchers.go
type MatchRegexps (line 29) | type MatchRegexps
method UnmarshalYAML (line 32) | func (m *MatchRegexps) UnmarshalYAML(unmarshal func(any) error) error {
type Regexp (line 49) | type Regexp struct
method UnmarshalYAML (line 55) | func (re *Regexp) UnmarshalYAML(unmarshal func(any) error) error {
method MarshalYAML (line 70) | func (re Regexp) MarshalYAML() (any, error) {
method UnmarshalJSON (line 78) | func (re *Regexp) UnmarshalJSON(data []byte) error {
method MarshalJSON (line 93) | func (re Regexp) MarshalJSON() ([]byte, error) {
type Matchers (line 102) | type Matchers
method UnmarshalYAML (line 105) | func (m *Matchers) UnmarshalYAML(unmarshal func(any) error) error {
method MarshalYAML (line 122) | func (m Matchers) MarshalYAML() (any, error) {
method UnmarshalJSON (line 131) | func (m *Matchers) UnmarshalJSON(data []byte) error {
method MarshalJSON (line 148) | func (m Matchers) MarshalJSON() ([]byte, error) {
FILE: config/common/matchers_test.go
function TestMarshalRegexpWithNilValue (line 25) | func TestMarshalRegexpWithNilValue(t *testing.T) {
function TestUnmarshalEmptyRegexp (line 37) | func TestUnmarshalEmptyRegexp(t *testing.T) {
function TestUnmarshalNullRegexp (line 57) | func TestUnmarshalNullRegexp(t *testing.T) {
function TestMarshalEmptyMatchers (line 76) | func TestMarshalEmptyMatchers(t *testing.T) {
FILE: config/common/notifierconfig.go
type NotifierConfig (line 17) | type NotifierConfig struct
method SendResolved (line 21) | func (nc *NotifierConfig) SendResolved() bool {
FILE: config/common/url.go
constant SecretToken (line 27) | SecretToken = "<secret>"
function init (line 31) | func init() {
type URL (line 40) | type URL struct
method Copy (line 45) | func (u *URL) Copy() *URL {
method MarshalYAML (line 51) | func (u URL) MarshalYAML() (any, error) {
method UnmarshalYAML (line 59) | func (u *URL) UnmarshalYAML(unmarshal func(any) error) error {
method MarshalJSON (line 73) | func (u URL) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 81) | func (u *URL) UnmarshalJSON(data []byte) error {
type SecretURL (line 95) | type SecretURL
method MarshalYAML (line 98) | func (s SecretURL) MarshalYAML() (any, error) {
method UnmarshalYAML (line 109) | func (s *SecretURL) UnmarshalYAML(unmarshal func(any) error) error {
method MarshalJSON (line 125) | func (s SecretURL) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 136) | func (s *SecretURL) UnmarshalJSON(data []byte) error {
function containsTemplating (line 156) | func containsTemplating(s string) (bool, error) {
type SecretTemplateURL (line 171) | type SecretTemplateURL
method MarshalYAML (line 174) | func (s SecretTemplateURL) MarshalYAML() (any, error) {
method UnmarshalYAML (line 185) | func (s *SecretTemplateURL) UnmarshalYAML(unmarshal func(any) error) e...
method MarshalJSON (line 215) | func (s SecretTemplateURL) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 220) | func (s *SecretTemplateURL) UnmarshalJSON(data []byte) error {
function MustParseURL (line 234) | func MustParseURL(s string) *URL {
function ParseURL (line 242) | func ParseURL(s string) (*URL, error) {
FILE: config/common/url_test.go
function TestJSONMarshalHideSecretURL (line 26) | func TestJSONMarshalHideSecretURL(t *testing.T) {
function TestUnmarshalSecretURL (line 60) | func TestUnmarshalSecretURL(t *testing.T) {
function TestHideSecretURL (line 78) | func TestHideSecretURL(t *testing.T) {
function TestShowMarshalSecretURL (line 87) | func TestShowMarshalSecretURL(t *testing.T) {
function TestMarshalURL (line 99) | func TestMarshalURL(t *testing.T) {
function TestUnmarshalNilURL (line 135) | func TestUnmarshalNilURL(t *testing.T) {
function TestUnmarshalEmptyURL (line 151) | func TestUnmarshalEmptyURL(t *testing.T) {
function TestUnmarshalURL (line 169) | func TestUnmarshalURL(t *testing.T) {
function TestUnmarshalInvalidURL (line 186) | func TestUnmarshalInvalidURL(t *testing.T) {
function TestUnmarshalRelativeURL (line 207) | func TestUnmarshalRelativeURL(t *testing.T) {
FILE: config/config.go
function containsTemplating (line 39) | func containsTemplating(s string) (bool, error) {
type SecretTemplateURL (line 54) | type SecretTemplateURL
method MarshalYAML (line 57) | func (s SecretTemplateURL) MarshalYAML() (any, error) {
method UnmarshalYAML (line 68) | func (s *SecretTemplateURL) UnmarshalYAML(unmarshal func(any) error) e...
method MarshalJSON (line 98) | func (s SecretTemplateURL) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 103) | func (s *SecretTemplateURL) UnmarshalJSON(data []byte) error {
function Load (line 118) | func Load(s string) (*Config, error) {
function LoadFile (line 141) | func LoadFile(filename string) (*Config, error) {
function resolveFilepaths (line 157) | func resolveFilepaths(baseDir string, cfg *Config) {
type MuteTimeInterval (line 223) | type MuteTimeInterval struct
method UnmarshalYAML (line 229) | func (mt *MuteTimeInterval) UnmarshalYAML(unmarshal func(any) error) e...
type TimeInterval (line 241) | type TimeInterval struct
method UnmarshalYAML (line 247) | func (ti *TimeInterval) UnmarshalYAML(unmarshal func(any) error) error {
type Config (line 259) | type Config struct
method String (line 275) | func (c Config) String() string {
method UnmarshalYAML (line 284) | func (c *Config) UnmarshalYAML(unmarshal func(any) error) error {
function checkReceiver (line 667) | func checkReceiver(r *Route, receivers map[string]struct{}) error {
function checkTimeInterval (line 682) | func checkTimeInterval(r *Route, timeIntervals map[string]struct{}) error {
function DefaultGlobalConfig (line 704) | func DefaultGlobalConfig() GlobalConfig {
type HostPort (line 726) | type HostPort struct
method UnmarshalYAML (line 732) | func (hp *HostPort) UnmarshalYAML(unmarshal func(any) error) error {
method UnmarshalJSON (line 754) | func (hp *HostPort) UnmarshalJSON(data []byte) error {
method MarshalYAML (line 776) | func (hp HostPort) MarshalYAML() (any, error) {
method MarshalJSON (line 781) | func (hp HostPort) MarshalJSON() ([]byte, error) {
method String (line 785) | func (hp HostPort) String() string {
type GlobalConfig (line 794) | type GlobalConfig struct
method UnmarshalYAML (line 844) | func (c *GlobalConfig) UnmarshalYAML(unmarshal func(any) error) error {
type Route (line 851) | type Route struct
method UnmarshalYAML (line 873) | func (r *Route) UnmarshalYAML(unmarshal func(any) error) error {
type Receiver (line 925) | type Receiver struct
method UnmarshalYAML (line 950) | func (c *Receiver) UnmarshalYAML(unmarshal func(any) error) error {
FILE: config/config_fuzz_test.go
function FuzzLoad (line 18) | func FuzzLoad(f *testing.F) {
FILE: config/config_test.go
function TestLoadEmptyString (line 34) | func TestLoadEmptyString(t *testing.T) {
function TestDefaultReceiverExists (line 48) | func TestDefaultReceiverExists(t *testing.T) {
function TestReceiverNameIsUnique (line 65) | func TestReceiverNameIsUnique(t *testing.T) {
function TestReceiverExists (line 86) | func TestReceiverExists(t *testing.T) {
function TestReceiverExistsForDeepSubRoute (line 106) | func TestReceiverExistsForDeepSubRoute(t *testing.T) {
function TestReceiverHasName (line 133) | func TestReceiverHasName(t *testing.T) {
function TestMuteTimeExists (line 152) | func TestMuteTimeExists(t *testing.T) {
function TestActiveTimeExists (line 177) | func TestActiveTimeExists(t *testing.T) {
function TestTimeIntervalHasName (line 202) | func TestTimeIntervalHasName(t *testing.T) {
function TestMuteTimeNoDuplicates (line 234) | func TestMuteTimeNoDuplicates(t *testing.T) {
function TestGroupByHasNoDuplicatedLabels (line 271) | func TestGroupByHasNoDuplicatedLabels(t *testing.T) {
function TestWildcardGroupByWithOtherGroupByLabels (line 291) | func TestWildcardGroupByWithOtherGroupByLabels(t *testing.T) {
function TestGroupByInvalidLabel (line 311) | func TestGroupByInvalidLabel(t *testing.T) {
function TestRootRouteExists (line 331) | func TestRootRouteExists(t *testing.T) {
function TestRootRouteNoMuteTimes (line 348) | func TestRootRouteNoMuteTimes(t *testing.T) {
function TestRootRouteNoActiveTimes (line 377) | func TestRootRouteNoActiveTimes(t *testing.T) {
function TestRootRouteHasNoMatcher (line 406) | func TestRootRouteHasNoMatcher(t *testing.T) {
function TestContinueErrorInRouteRoot (line 450) | func TestContinueErrorInRouteRoot(t *testing.T) {
function TestGroupIntervalIsGreaterThanZero (line 471) | func TestGroupIntervalIsGreaterThanZero(t *testing.T) {
function TestRepeatIntervalIsGreaterThanZero (line 492) | func TestRepeatIntervalIsGreaterThanZero(t *testing.T) {
function TestHideConfigSecrets (line 513) | func TestHideConfigSecrets(t *testing.T) {
function TestJSONMarshal (line 526) | func TestJSONMarshal(t *testing.T) {
function TestJSONUnmarshal (line 538) | func TestJSONUnmarshal(t *testing.T) {
function TestMarshalIdempotency (line 550) | func TestMarshalIdempotency(t *testing.T) {
function TestGroupByAllNotMarshaled (line 567) | func TestGroupByAllNotMarshaled(t *testing.T) {
function TestEmptyFieldsAndRegex (line 591) | func TestEmptyFieldsAndRegex(t *testing.T) {
function TestEmptyConfigOfIntegration (line 693) | func TestEmptyConfigOfIntegration(t *testing.T) {
function TestGlobalAndLocalHTTPConfig (line 792) | func TestGlobalAndLocalHTTPConfig(t *testing.T) {
function TestSMTPHello (line 807) | func TestSMTPHello(t *testing.T) {
function TestSMTPBothPasswordAndFile (line 820) | func TestSMTPBothPasswordAndFile(t *testing.T) {
function TestSMTPNoUsernameOrPassword (line 830) | func TestSMTPNoUsernameOrPassword(t *testing.T) {
function TestGlobalAndLocalSMTPPassword (line 837) | func TestGlobalAndLocalSMTPPassword(t *testing.T) {
function TestGroupByAll (line 857) | func TestGroupByAll(t *testing.T) {
function TestVictorOpsDefaultAPIKey (line 868) | func TestVictorOpsDefaultAPIKey(t *testing.T) {
function TestVictorOpsDefaultAPIKeyFile (line 884) | func TestVictorOpsDefaultAPIKeyFile(t *testing.T) {
function TestVictorOpsBothAPIKeyAndFile (line 900) | func TestVictorOpsBothAPIKeyAndFile(t *testing.T) {
function TestVictorOpsNoAPIKey (line 910) | func TestVictorOpsNoAPIKey(t *testing.T) {
function TestTelegramDefaultBotToken (line 920) | func TestTelegramDefaultBotToken(t *testing.T) {
function TestTelegramDefaultBotTokenFile (line 936) | func TestTelegramDefaultBotTokenFile(t *testing.T) {
function TestTelegramBothBotTokenAndFile (line 952) | func TestTelegramBothBotTokenAndFile(t *testing.T) {
function TestTelegramValidReceiverBothBotTokenAndFile (line 962) | func TestTelegramValidReceiverBothBotTokenAndFile(t *testing.T) {
function TestTelegramNoBotToken (line 972) | func TestTelegramNoBotToken(t *testing.T) {
function TestOpsGenieDefaultAPIKey (line 982) | func TestOpsGenieDefaultAPIKey(t *testing.T) {
function TestOpsGenieDefaultAPIKeyFile (line 997) | func TestOpsGenieDefaultAPIKeyFile(t *testing.T) {
function TestOpsGenieBothAPIKeyAndFile (line 1012) | func TestOpsGenieBothAPIKeyAndFile(t *testing.T) {
function TestOpsGenieNoAPIKey (line 1022) | func TestOpsGenieNoAPIKey(t *testing.T) {
function TestOpsGenieDeprecatedTeamSpecified (line 1032) | func TestOpsGenieDeprecatedTeamSpecified(t *testing.T) {
function TestSlackBothAPIURLAndFile (line 1045) | func TestSlackBothAPIURLAndFile(t *testing.T) {
function TestSlackBothAppTokenAndFile (line 1055) | func TestSlackBothAppTokenAndFile(t *testing.T) {
function TestSlackBothAppTokenAndAPIURL (line 1065) | func TestSlackBothAppTokenAndAPIURL(t *testing.T) {
function TestSlackUpdateMessageWebhookURL (line 1075) | func TestSlackUpdateMessageWebhookURL(t *testing.T) {
function TestSlackGlobalAppToken (line 1085) | func TestSlackGlobalAppToken(t *testing.T) {
function TestSlackNoAPIURL (line 1168) | func TestSlackNoAPIURL(t *testing.T) {
function TestSlackGlobalAPIURLFile (line 1178) | func TestSlackGlobalAPIURLFile(t *testing.T) {
function TestValidSNSConfig (line 1203) | func TestValidSNSConfig(t *testing.T) {
function TestInvalidSNSConfig (line 1210) | func TestInvalidSNSConfig(t *testing.T) {
function TestRocketchatDefaultToken (line 1221) | func TestRocketchatDefaultToken(t *testing.T) {
function TestRocketchatDefaultTokenID (line 1237) | func TestRocketchatDefaultTokenID(t *testing.T) {
function TestRocketchatDefaultTokenFile (line 1253) | func TestRocketchatDefaultTokenFile(t *testing.T) {
function TestRocketchatDefaultIDTokenFile (line 1269) | func TestRocketchatDefaultIDTokenFile(t *testing.T) {
function TestRocketchatBothTokenAndTokenFile (line 1285) | func TestRocketchatBothTokenAndTokenFile(t *testing.T) {
function TestRocketchatBothTokenIDAndTokenIDFile (line 1295) | func TestRocketchatBothTokenIDAndTokenIDFile(t *testing.T) {
function TestRocketchatNoToken (line 1305) | func TestRocketchatNoToken(t *testing.T) {
function TestUnmarshalHostPort (line 1315) | func TestUnmarshalHostPort(t *testing.T) {
function TestNilRegexp (line 1382) | func TestNilRegexp(t *testing.T) {
function TestSecretTemplURL (line 1411) | func TestSecretTemplURL(t *testing.T) {
function TestSecretTemplURLMarshaling (line 1480) | func TestSecretTemplURLMarshaling(t *testing.T) {
function TestGroupByEmptyOverride (line 1521) | func TestGroupByEmptyOverride(t *testing.T) {
function TestWechatNoAPIURL (line 1539) | func TestWechatNoAPIURL(t *testing.T) {
function TestWechatBothAPIURLAndFile (line 1549) | func TestWechatBothAPIURLAndFile(t *testing.T) {
function TestWechatGlobalAPISecretFile (line 1559) | func TestWechatGlobalAPISecretFile(t *testing.T) {
function TestMattermostDefaultWebhookURL (line 1584) | func TestMattermostDefaultWebhookURL(t *testing.T) {
function TestMattermostDefaultWebhookURLFile (line 1600) | func TestMattermostDefaultWebhookURLFile(t *testing.T) {
function TestMattermostBothWebhookURLAndFile (line 1616) | func TestMattermostBothWebhookURLAndFile(t *testing.T) {
function TestMattermostValidReceiverBothWebhookURLAndFile (line 1626) | func TestMattermostValidReceiverBothWebhookURLAndFile(t *testing.T) {
function TestMattermostNoWebhookURL (line 1636) | func TestMattermostNoWebhookURL(t *testing.T) {
FILE: config/coordinator.go
type Coordinator (line 28) | type Coordinator struct
method registerMetrics (line 56) | func (c *Coordinator) registerMetrics(r prometheus.Registerer) {
method Subscribe (line 76) | func (c *Coordinator) Subscribe(ss ...func(*Config) error) {
method notifySubscribers (line 83) | func (c *Coordinator) notifySubscribers() error {
method loadFromFile (line 94) | func (c *Coordinator) loadFromFile() error {
method Reload (line 107) | func (c *Coordinator) Reload() error {
function NewCoordinator (line 45) | func NewCoordinator(configFilePath string, r prometheus.Registerer, l *s...
function md5HashAsMetricValue (line 147) | func md5HashAsMetricValue(data []byte) float64 {
FILE: config/coordinator_test.go
type fakeRegisterer (line 24) | type fakeRegisterer struct
method Register (line 28) | func (r *fakeRegisterer) Register(prometheus.Collector) error {
method MustRegister (line 32) | func (r *fakeRegisterer) MustRegister(c ...prometheus.Collector) {
method Unregister (line 36) | func (r *fakeRegisterer) Unregister(prometheus.Collector) bool {
function TestCoordinatorRegistersMetrics (line 40) | func TestCoordinatorRegistersMetrics(t *testing.T) {
function TestCoordinatorNotifiesSubscribers (line 49) | func TestCoordinatorNotifiesSubscribers(t *testing.T) {
function TestCoordinatorFailReloadWhenSubscriberFails (line 67) | func TestCoordinatorFailReloadWhenSubscriberFails(t *testing.T) {
FILE: config/notifiers.go
type WebexConfig (line 236) | type WebexConfig struct
method UnmarshalYAML (line 246) | func (c *WebexConfig) UnmarshalYAML(unmarshal func(any) error) error {
type DiscordConfig (line 265) | type DiscordConfig struct
method UnmarshalYAML (line 280) | func (c *DiscordConfig) UnmarshalYAML(unmarshal func(any) error) error {
type EmailConfig (line 299) | type EmailConfig struct
method UnmarshalYAML (line 333) | func (c *EmailConfig) UnmarshalYAML(unmarshal func(any) error) error {
type ThreadingConfig (line 327) | type ThreadingConfig struct
type PagerdutyConfig (line 369) | type PagerdutyConfig struct
method UnmarshalYAML (line 409) | func (c *PagerdutyConfig) UnmarshalYAML(unmarshal func(any) error) err...
type PagerdutyLink (line 396) | type PagerdutyLink struct
type PagerdutyImage (line 402) | type PagerdutyImage struct
type SlackAction (line 441) | type SlackAction struct
method UnmarshalYAML (line 452) | func (c *SlackAction) UnmarshalYAML(unmarshal func(any) error) error {
type SlackConfirmationField (line 479) | type SlackConfirmationField struct
method UnmarshalYAML (line 487) | func (c *SlackConfirmationField) UnmarshalYAML(unmarshal func(any) err...
type SlackField (line 502) | type SlackField struct
method UnmarshalYAML (line 509) | func (c *SlackField) UnmarshalYAML(unmarshal func(any) error) error {
type SlackConfig (line 524) | type SlackConfig struct
method UnmarshalYAML (line 568) | func (c *SlackConfig) UnmarshalYAML(unmarshal func(any) error) error {
type IncidentioConfig (line 593) | type IncidentioConfig struct
method UnmarshalYAML (line 619) | func (c *IncidentioConfig) UnmarshalYAML(unmarshal func(any) error) er...
type WebhookConfig (line 645) | type WebhookConfig struct
method UnmarshalYAML (line 666) | func (c *WebhookConfig) UnmarshalYAML(unmarshal func(any) error) error {
type WechatConfig (line 682) | type WechatConfig struct
method UnmarshalYAML (line 704) | func (c *WechatConfig) UnmarshalYAML(unmarshal func(any) error) error {
constant wechatValidTypesRe (line 699) | wechatValidTypesRe = `^(text|markdown)$`
type OpsGenieConfig (line 727) | type OpsGenieConfig struct
method UnmarshalYAML (line 753) | func (c *OpsGenieConfig) UnmarshalYAML(unmarshal func(any) error) error {
constant opsgenieValidTypesRe (line 748) | opsgenieValidTypesRe = `^(team|teams|user|escalation|schedule)$`
type OpsGenieConfigResponder (line 784) | type OpsGenieConfigResponder struct
type VictorOpsConfig (line 795) | type VictorOpsConfig struct
method UnmarshalYAML (line 812) | func (c *VictorOpsConfig) UnmarshalYAML(unmarshal func(any) error) err...
type duration (line 836) | type duration
method UnmarshalText (line 838) | func (d *duration) UnmarshalText(text []byte) error {
method MarshalText (line 846) | func (d duration) MarshalText() ([]byte, error) {
type PushoverConfig (line 850) | type PushoverConfig struct
method UnmarshalYAML (line 874) | func (c *PushoverConfig) UnmarshalYAML(unmarshal func(any) error) error {
type SNSConfig (line 898) | type SNSConfig struct
method UnmarshalYAML (line 914) | func (c *SNSConfig) UnmarshalYAML(unmarshal func(any) error) error {
type TelegramConfig (line 927) | type TelegramConfig struct
method UnmarshalYAML (line 944) | func (c *TelegramConfig) UnmarshalYAML(unmarshal func(any) error) error {
type MSTeamsConfig (line 968) | type MSTeamsConfig struct
method UnmarshalYAML (line 979) | func (c *MSTeamsConfig) UnmarshalYAML(unmarshal func(any) error) error {
type MSTeamsV2Config (line 997) | type MSTeamsV2Config struct
method UnmarshalYAML (line 1007) | func (c *MSTeamsV2Config) UnmarshalYAML(unmarshal func(any) error) err...
type JiraFieldConfig (line 1025) | type JiraFieldConfig struct
method EnableUpdateValue (line 1054) | func (f *JiraFieldConfig) EnableUpdateValue() bool {
method UnmarshalYAML (line 1062) | func (f *JiraFieldConfig) UnmarshalYAML(unmarshal func(any) error) err...
type JiraConfig (line 1032) | type JiraConfig struct
method UnmarshalYAML (line 1076) | func (c *JiraConfig) UnmarshalYAML(unmarshal func(any) error) error {
type RocketchatAttachmentField (line 1097) | type RocketchatAttachmentField struct
constant ProcessingTypeSendMessage (line 1104) | ProcessingTypeSendMessage = "sendMessage"
constant ProcessingTypeRespondWithMessage (line 1105) | ProcessingTypeRespondWithMessage = "respondWithMessage"
type RocketchatAttachmentAction (line 1108) | type RocketchatAttachmentAction struct
type RocketchatConfig (line 1121) | type RocketchatConfig struct
method UnmarshalYAML (line 1150) | func (c *RocketchatConfig) UnmarshalYAML(unmarshal func(any) error) er...
type MattermostPriority (line 1166) | type MattermostPriority struct
type MattermostProps (line 1174) | type MattermostProps struct
type MattermostField (line 1180) | type MattermostField struct
method UnmarshalYAML (line 1187) | func (c *MattermostField) UnmarshalYAML(unmarshal func(any) error) err...
type MattermostAttachment (line 1203) | type MattermostAttachment struct
type MattermostConfig (line 1222) | type MattermostConfig struct
method UnmarshalYAML (line 1255) | func (c *MattermostConfig) UnmarshalYAML(unmarshal func(any) error) er...
FILE: config/notifiers_test.go
function TestEmailToIsPresent (line 27) | func TestEmailToIsPresent(t *testing.T) {
function TestEmailHeadersCollision (line 44) | func TestEmailHeadersCollision(t *testing.T) {
function TestEmailToAllowsMultipleAdresses (line 64) | func TestEmailToAllowsMultipleAdresses(t *testing.T) {
function TestEmailDisallowMalformed (line 90) | func TestEmailDisallowMalformed(t *testing.T) {
function TestPagerdutyTestRoutingKey (line 105) | func TestPagerdutyTestRoutingKey(t *testing.T) {
function TestPagerdutyServiceKey (line 142) | func TestPagerdutyServiceKey(t *testing.T) {
function TestPagerdutyDetails (line 179) | func TestPagerdutyDetails(t *testing.T) {
function TestPagerDutySource (line 234) | func TestPagerDutySource(t *testing.T) {
function TestWebhookURLIsPresent (line 268) | func TestWebhookURLIsPresent(t *testing.T) {
function TestWebhookURLOrURLFile (line 283) | func TestWebhookURLOrURLFile(t *testing.T) {
function TestWebhookHttpConfigIsValid (line 301) | func TestWebhookHttpConfigIsValid(t *testing.T) {
function TestWebhookHttpConfigIsOptional (line 321) | func TestWebhookHttpConfigIsOptional(t *testing.T) {
function TestWebhookPasswordIsObfuscated (line 332) | func TestWebhookPasswordIsObfuscated(t *testing.T) {
function TestVictorOpsConfiguration (line 355) | func TestVictorOpsConfiguration(t *testing.T) {
function TestVictorOpsCustomFieldsValidation (line 405) | func TestVictorOpsCustomFieldsValidation(t *testing.T) {
function TestPushoverUserKeyIsPresent (line 447) | func TestPushoverUserKeyIsPresent(t *testing.T) {
function TestPushoverUserKeyOrUserKeyFile (line 464) | func TestPushoverUserKeyOrUserKeyFile(t *testing.T) {
function TestPushoverTokenIsPresent (line 482) | func TestPushoverTokenIsPresent(t *testing.T) {
function TestPushoverTokenOrTokenFile (line 500) | func TestPushoverTokenOrTokenFile(t *testing.T) {
function TestPushoverHTMLOrMonospace (line 519) | func TestPushoverHTMLOrMonospace(t *testing.T) {
function TestLoadSlackConfiguration (line 539) | func TestLoadSlackConfiguration(t *testing.T) {
function TestSlackAuthMethodConfigValidation (line 609) | func TestSlackAuthMethodConfigValidation(t *testing.T) {
function TestSlackFieldConfigValidation (line 656) | func TestSlackFieldConfigValidation(t *testing.T) {
function TestSlackFieldConfigUnmarshaling (line 713) | func TestSlackFieldConfigUnmarshaling(t *testing.T) {
function TestSlackActionsValidation (line 769) | func TestSlackActionsValidation(t *testing.T) {
function TestOpsgenieTypeMatcher (line 852) | func TestOpsgenieTypeMatcher(t *testing.T) {
function TestOpsGenieConfiguration (line 867) | func TestOpsGenieConfiguration(t *testing.T) {
function TestSNS (line 952) | func TestSNS(t *testing.T) {
function TestWeChatTypeMatcher (line 1038) | func TestWeChatTypeMatcher(t *testing.T) {
function TestWebexConfiguration (line 1053) | func TestWebexConfiguration(t *testing.T) {
function TestTelegramConfiguration (line 1088) | func TestTelegramConfiguration(t *testing.T) {
function newBoolPointer (line 1168) | func newBoolPointer(b bool) *bool {
function TestMattermostField_UnmarshalYAML (line 1172) | func TestMattermostField_UnmarshalYAML(t *testing.T) {
function TestMattermostConfig_UnmarshalYAML (line 1219) | func TestMattermostConfig_UnmarshalYAML(t *testing.T) {
function TestEmailConfig_UnmarshalYAML (line 1281) | func TestEmailConfig_UnmarshalYAML(t *testing.T) {
FILE: config/receiver/receiver.go
function BuildReceiverIntegrations (line 48) | func BuildReceiverIntegrations(nc config.Receiver, tmpl *template.Templa...
FILE: config/receiver/receiver_test.go
type sendResolved (line 28) | type sendResolved
method SendResolved (line 30) | func (s sendResolved) SendResolved() bool { return bool(s) }
function TestBuildReceiverIntegrations (line 32) | func TestBuildReceiverIntegrations(t *testing.T) {
FILE: dispatch/dispatch.go
constant DispatcherStateUnknown (line 43) | DispatcherStateUnknown = iota
constant DispatcherStateWaitingToStart (line 44) | DispatcherStateWaitingToStart
constant DispatcherStateRunning (line 45) | DispatcherStateRunning
constant DispatcherStateStopped (line 46) | DispatcherStateStopped
type DispatcherMetrics (line 52) | type DispatcherMetrics struct
function NewDispatcherMetrics (line 59) | func NewDispatcherMetrics(registerLimitMetrics bool, r prometheus.Regist...
type Dispatcher (line 89) | type Dispatcher struct
method Run (line 170) | func (d *Dispatcher) Run(dispatchStartTime time.Time) {
method run (line 199) | func (d *Dispatcher) run(it provider.AlertIterator) {
method routeAlert (line 274) | func (d *Dispatcher) routeAlert(ctx context.Context, alert *types.Aler...
method doMaintenance (line 298) | func (d *Dispatcher) doMaintenance() {
method WaitForLoading (line 317) | func (d *Dispatcher) WaitForLoading() {
method LoadingDone (line 321) | func (d *Dispatcher) LoadingDone() <-chan struct{} {
method Groups (line 346) | func (d *Dispatcher) Groups(ctx context.Context, routeFilter func(*Rou...
method Stop (line 427) | func (d *Dispatcher) Stop() {
method groupAlert (line 443) | func (d *Dispatcher) groupAlert(ctx context.Context, alert *types.Aler...
method runAG (line 570) | func (d *Dispatcher) runAG(ag *aggrGroup) {
type Limits (line 118) | type Limits interface
type routeAggrGroups (line 125) | type routeAggrGroups struct
function NewDispatcher (line 132) | func NewDispatcher(
type AlertGroup (line 326) | type AlertGroup struct
type AlertGroups (line 334) | type AlertGroups
method Swap (line 336) | func (ag AlertGroups) Swap(i, j int) { ag[i], ag[j] = ag[j], ag[i] }
method Less (line 337) | func (ag AlertGroups) Less(i, j int) bool {
method Len (line 343) | func (ag AlertGroups) Len() int { return len(ag) }
type notifyFunc (line 439) | type notifyFunc
function getGroupLabels (line 591) | func getGroupLabels(alert *types.Alert, route *Route) model.LabelSet {
type aggrGroup (line 609) | type aggrGroup struct
method fingerprint (line 659) | func (ag *aggrGroup) fingerprint() model.Fingerprint {
method GroupKey (line 663) | func (ag *aggrGroup) GroupKey() string {
method String (line 667) | func (ag *aggrGroup) String() string {
method run (line 671) | func (ag *aggrGroup) run(nf notifyFunc) {
method stop (line 725) | func (ag *aggrGroup) stop() {
method resetTimer (line 733) | func (ag *aggrGroup) resetTimer(t time.Duration) {
method insert (line 739) | func (ag *aggrGroup) insert(ctx context.Context, alert *types.Alert) b...
method empty (line 761) | func (ag *aggrGroup) empty() bool {
method destroyed (line 765) | func (ag *aggrGroup) destroyed() bool {
method flush (line 770) | func (ag *aggrGroup) flush(notify func(...*types.Alert) bool) {
function newAggrGroup (line 627) | func newAggrGroup(
type nilLimits (line 816) | type nilLimits struct
method MaxNumberOfAggregationGroups (line 818) | func (n nilLimits) MaxNumberOfAggregationGroups() int { return 0 }
FILE: dispatch/dispatch_bench_test.go
function buildDeepRouteTree (line 37) | func buildDeepRouteTree(numTeams, numClusters, numPriorities int) *Route {
function newBenchAlert (line 98) | func newBenchAlert(labels model.LabelSet) *types.Alert {
function makeBenchAlertBatch (line 116) | func makeBenchAlertBatch(size, offset, numTeams, numClusters, numPriorit...
function setupDispatcher (line 139) | func setupDispatcher(b *testing.B, route *Route) (*Dispatcher, *mem.Aler...
function populateGroups (line 160) | func populateGroups(b *testing.B, d *Dispatcher, alerts *mem.Alerts, num...
function BenchmarkGroups (line 199) | func BenchmarkGroups(b *testing.B) {
function benchmarkGroups (line 208) | func benchmarkGroups(b *testing.B, numGroups, alertsPerGroup, numTeams, ...
function BenchmarkIngestionUnderGroupsLoad (line 247) | func BenchmarkIngestionUnderGroupsLoad(b *testing.B) {
function benchmarkIngestionUnderGroupsLoad (line 265) | func benchmarkIngestionUnderGroupsLoad(b *testing.B, numGroupsCallers in...
FILE: dispatch/dispatch_test.go
constant testMaintenanceInterval (line 38) | testMaintenanceInterval = 30 * time.Second
function TestAggrGroup (line 40) | func TestAggrGroup(t *testing.T) {
function TestGroupLabels (line 292) | func TestGroupLabels(t *testing.T) {
function TestGroupByAllLabels (line 325) | func TestGroupByAllLabels(t *testing.T) {
function TestGroups (line 356) | func TestGroups(t *testing.T) {
function TestGroupsWithLimits (line 507) | func TestGroupsWithLimits(t *testing.T) {
type recordStage (line 605) | type recordStage struct
method Alerts (line 610) | func (r *recordStage) Alerts() []*types.Alert {
method Exec (line 622) | func (r *recordStage) Exec(ctx context.Context, l *slog.Logger, alerts...
function newAlert (line 645) | func newAlert(labels model.LabelSet) *types.Alert {
function TestDispatcherRace (line 659) | func TestDispatcherRace(t *testing.T) {
function TestDispatcherRaceOnFirstAlertNotDeliveredWhenGroupWaitIsZero (line 676) | func TestDispatcherRaceOnFirstAlertNotDeliveredWhenGroupWaitIsZero(t *te...
type limits (line 724) | type limits struct
method MaxNumberOfAggregationGroups (line 728) | func (l limits) MaxNumberOfAggregationGroups() int {
function TestDispatcher_DoMaintenance (line 732) | func TestDispatcher_DoMaintenance(t *testing.T) {
function TestDispatcher_DeleteResolvedAlertsFromMarker (line 803) | func TestDispatcher_DeleteResolvedAlertsFromMarker(t *testing.T) {
function TestDispatchOnStartup (line 997) | func TestDispatchOnStartup(t *testing.T) {
function TestGetGroupLabels (line 1090) | func TestGetGroupLabels(t *testing.T) {
function BenchmarkGetGroupLabels (line 1129) | func BenchmarkGetGroupLabels(b *testing.B) {
FILE: dispatch/route.go
type Route (line 42) | type Route struct
method Match (line 160) | func (r *Route) Match(lset model.LabelSet) []*Route {
method Key (line 186) | func (r *Route) Key() string {
method ID (line 198) | func (r *Route) ID() string {
method Walk (line 222) | func (r *Route) Walk(visit func(*Route)) {
function NewRoute (line 63) | func NewRoute(cr *config.Route, parent *Route) *Route {
function newRoute (line 68) | func newRoute(cr *config.Route, parent *Route, counter *int) *Route {
function newRoutes (line 150) | func newRoutes(croutes []*config.Route, parent *Route, counter *int) []*...
type RouteOpts (line 231) | type RouteOpts struct
method String (line 254) | func (ro *RouteOpts) String() string {
method MarshalJSON (line 264) | func (ro *RouteOpts) MarshalJSON() ([]byte, error) {
FILE: dispatch/route_test.go
function TestRouteMatch (line 28) | func TestRouteMatch(t *testing.T) {
function TestRouteWalk (line 271) | func TestRouteWalk(t *testing.T) {
function TestInheritParentGroupByAll (line 356) | func TestInheritParentGroupByAll(t *testing.T) {
function TestRouteMatchers (line 386) | func TestRouteMatchers(t *testing.T) {
function TestRouteMatchersAndMatch (line 621) | func TestRouteMatchersAndMatch(t *testing.T) {
function TestRouteID (line 857) | func TestRouteID(t *testing.T) {
function TestRouteIndices (line 924) | func TestRouteIndices(t *testing.T) {
FILE: examples/webhook/echo.go
function main (line 24) | func main() {
FILE: featurecontrol/featurecontrol.go
constant FeatureAlertNamesInMetrics (line 24) | FeatureAlertNamesInMetrics = "alert-names-in-metrics"
constant FeatureReceiverNameInMetrics (line 25) | FeatureReceiverNameInMetrics = "receiver-name-in-metrics"
constant FeatureClassicMode (line 26) | FeatureClassicMode = "classic-mode"
constant FeatureUTF8StrictMode (line 27) | FeatureUTF8StrictMode = "utf8-strict-mode"
constant FeatureAutoGOMEMLIMIT (line 28) | FeatureAutoGOMEMLIMIT = "auto-gomemlimit"
constant FeatureAutoGOMAXPROCS (line 29) | FeatureAutoGOMAXPROCS = "auto-gomaxprocs"
type Flagger (line 41) | type Flagger interface
type Flags (line 50) | type Flags struct
method EnableAlertNamesInMetrics (line 60) | func (f *Flags) EnableAlertNamesInMetrics() bool {
method EnableReceiverNamesInMetrics (line 64) | func (f *Flags) EnableReceiverNamesInMetrics() bool {
method ClassicMode (line 68) | func (f *Flags) ClassicMode() bool {
method UTF8StrictMode (line 72) | func (f *Flags) UTF8StrictMode() bool {
method EnableAutoGOMEMLIMIT (line 76) | func (f *Flags) EnableAutoGOMEMLIMIT() bool {
method EnableAutoGOMAXPROCS (line 80) | func (f *Flags) EnableAutoGOMAXPROCS() bool {
type flagOption (line 84) | type flagOption
function enableReceiverNameInMetrics (line 86) | func enableReceiverNameInMetrics() flagOption {
function enableClassicMode (line 92) | func enableClassicMode() flagOption {
function enableUTF8StrictMode (line 98) | func enableUTF8StrictMode() flagOption {
function enableAutoGOMEMLIMIT (line 104) | func enableAutoGOMEMLIMIT() flagOption {
function enableAutoGOMAXPROCS (line 110) | func enableAutoGOMAXPROCS() flagOption {
function enableAlertNamesInMetrics (line 116) | func enableAlertNamesInMetrics() flagOption {
function NewFlags (line 122) | func NewFlags(logger *slog.Logger, features string) (Flagger, error) {
type NoopFlags (line 166) | type NoopFlags struct
method EnableAlertNamesInMetrics (line 168) | func (n NoopFlags) EnableAlertNamesInMetrics() bool { return false }
method EnableReceiverNamesInMetrics (line 170) | func (n NoopFlags) EnableReceiverNamesInMetrics() bool { return false }
method ClassicMode (line 172) | func (n NoopFlags) ClassicMode() bool { return false }
method UTF8StrictMode (line 174) | func (n NoopFlags) UTF8StrictMode() bool { return false }
method EnableAutoGOMEMLIMIT (line 176) | func (n NoopFlags) EnableAutoGOMEMLIMIT() bool { return false }
method EnableAutoGOMAXPROCS (line 178) | func (n NoopFlags) EnableAutoGOMAXPROCS() bool { return false }
FILE: featurecontrol/featurecontrol_test.go
function TestFlags (line 25) | func TestFlags(t *testing.T) {
FILE: inhibit/index.go
type index (line 26) | type index struct
method Get (line 37) | func (c *index) Get(key model.Fingerprint) (model.Fingerprint, bool) {
method Set (line 45) | func (c *index) Set(key, value model.Fingerprint) {
method Delete (line 52) | func (c *index) Delete(key model.Fingerprint) {
method Len (line 59) | func (c *index) Len() int {
function newIndex (line 31) | func newIndex() *index {
FILE: inhibit/inhibit.go
type Inhibitor (line 42) | type Inhibitor struct
method run (line 80) | func (ih *Inhibitor) run(ctx context.Context) {
method processAlert (line 108) | func (ih *Inhibitor) processAlert(ctx context.Context, a *types.Alert) {
method WaitForLoading (line 136) | func (ih *Inhibitor) WaitForLoading() {
method Run (line 141) | func (ih *Inhibitor) Run() {
method Stop (line 169) | func (ih *Inhibitor) Stop() {
method Mutes (line 183) | func (ih *Inhibitor) Mutes(ctx context.Context, lset model.LabelSet) b...
function NewInhibitor (line 55) | func NewInhibitor(ap provider.Alerts, rs []amcommoncfg.InhibitRule, mk t...
type InhibitRule (line 226) | type InhibitRule struct
method fingerprintEquals (line 318) | func (r *InhibitRule) fingerprintEquals(lset model.LabelSet) model.Fin...
method updateIndex (line 327) | func (r *InhibitRule) updateIndex(alert *types.Alert) {
method findEqualSourceAlert (line 361) | func (r *InhibitRule) findEqualSourceAlert(lset model.LabelSet, now ti...
method gcCallback (line 380) | func (r *InhibitRule) gcCallback(alerts []*types.Alert) {
method hasEqual (line 391) | func (r *InhibitRule) hasEqual(lset model.LabelSet, excludeTwoSidedMat...
function NewInhibitRule (line 250) | func NewInhibitRule(cr amcommoncfg.InhibitRule) *InhibitRule {
FILE: inhibit/inhibit_bench_test.go
function BenchmarkMutes (line 36) | func BenchmarkMutes(b *testing.B) {
type benchmarkOptions (line 82) | type benchmarkOptions struct
function allRulesMatchBenchmark (line 107) | func allRulesMatchBenchmark(b *testing.B, numInhibitionRules, numInhibit...
function lastRuleMatchesBenchmark (line 150) | func lastRuleMatchesBenchmark(b *testing.B, n int) benchmarkOptions {
function benchmarkMutes (line 184) | func benchmarkMutes(b *testing.B, opts benchmarkOptions) {
function benchmarkFromOptions (line 213) | func benchmarkFromOptions(opts benchmarkOptions) ([]types.Alert, []amcom...
function mustNewMatcher (line 226) | func mustNewMatcher(b *testing.B, op labels.MatchType, name, value strin...
FILE: inhibit/inhibit_test.go
function TestInhibitRuleHasEqual (line 36) | func TestInhibitRuleHasEqual(t *testing.T) {
function TestInhibitRuleMatches (line 149) | func TestInhibitRuleMatches(t *testing.T) {
function TestInhibitRuleMatchers (line 250) | func TestInhibitRuleMatchers(t *testing.T) {
function TestInhibitRuleName (line 351) | func TestInhibitRuleName(t *testing.T) {
type fakeAlerts (line 381) | type fakeAlerts struct
method GetPending (line 393) | func (f *fakeAlerts) GetPending() provider.AlertIterator { re...
method Get (line 394) | func (f *fakeAlerts) Get(model.Fingerprint) (*types.Alert, error) { re...
method Put (line 395) | func (f *fakeAlerts) Put(context.Context, ...*types.Alert) error { re...
method Subscribe (line 396) | func (f *fakeAlerts) Subscribe(name string) provider.AlertIterator {
method SlurpAndSubscribe (line 423) | func (f *fakeAlerts) SlurpAndSubscribe(name string) ([]*types.Alert, p...
function newFakeAlerts (line 386) | func newFakeAlerts(alerts []*types.Alert) *fakeAlerts {
function TestInhibit (line 450) | func TestInhibit(t *testing.T) {
function TestInhibitRule_fingerprintEquals (line 562) | func TestInhibitRule_fingerprintEquals(t *testing.T) {
function BenchmarkFingerprintEquals (line 594) | func BenchmarkFingerprintEquals(b *testing.B) {
FILE: limit/bucket.go
type item (line 23) | type item struct
method expired (line 30) | func (i *item[V]) expired(at time.Time) bool {
type sortedItems (line 35) | type sortedItems
method Len (line 38) | func (s sortedItems[V]) Len() int { return len(s) }
method Less (line 41) | func (s sortedItems[V]) Less(i, j int) bool { return s[i].priority.Befor...
method Swap (line 44) | func (s sortedItems[V]) Swap(i, j int) {
method Push (line 51) | func (s *sortedItems[V]) Push(x any) {
method Pop (line 59) | func (s *sortedItems[V]) Pop() any {
method update (line 70) | func (s *sortedItems[V]) update(item *item[V], priority time.Time) {
type Bucket (line 81) | type Bucket struct
function NewBucket (line 90) | func NewBucket[V comparable](capacity int) *Bucket[V] {
method IsStale (line 101) | func (b *Bucket[V]) IsStale() (stale bool) {
method Upsert (line 117) | func (b *Bucket[V]) Upsert(value V, priority time.Time) (ok bool) {
FILE: limit/bucket_test.go
function TestBucketUpsert (line 25) | func TestBucketUpsert(t *testing.T) {
function TestBucketAddConcurrency (line 122) | func TestBucketAddConcurrency(t *testing.T) {
function TestBucketAddExpiredEviction (line 151) | func TestBucketAddExpiredEviction(t *testing.T) {
function TestBucketAddEdgeCases (line 196) | func TestBucketAddEdgeCases(t *testing.T) {
function BenchmarkBucketUpsert (line 242) | func BenchmarkBucketUpsert(b *testing.B) {
function BenchmarkBucketUpsertScaling (line 362) | func BenchmarkBucketUpsertScaling(b *testing.B) {
function TestBucketIsStale (line 391) | func TestBucketIsStale(t *testing.T) {
function BenchmarkBucketUpsertConcurrent (line 454) | func BenchmarkBucketUpsertConcurrent(b *testing.B) {
FILE: matcher/compat/parse.go
function IsValidLabelName (line 38) | func IsValidLabelName(name model.LabelName) bool {
type ParseMatcher (line 42) | type ParseMatcher
type ParseMatchers (line 44) | type ParseMatchers
function Matcher (line 48) | func Matcher(input, origin string) (*labels.Matcher, error) {
function Matchers (line 54) | func Matchers(input, origin string) (labels.Matchers, error) {
function InitFromFlags (line 59) | func InitFromFlags(l *slog.Logger, f featurecontrol.Flagger) {
function ClassicMatcherParser (line 77) | func ClassicMatcherParser(l *slog.Logger) ParseMatcher {
function ClassicMatchersParser (line 86) | func ClassicMatchersParser(l *slog.Logger) ParseMatchers {
function UTF8MatcherParser (line 95) | func UTF8MatcherParser(l *slog.Logger) ParseMatcher {
function UTF8MatchersParser (line 108) | func UTF8MatchersParser(l *slog.Logger) ParseMatchers {
function FallbackMatcherParser (line 118) | func FallbackMatcherParser(l *slog.Logger) ParseMatcher {
function FallbackMatchersParser (line 152) | func FallbackMatchersParser(l *slog.Logger) ParseMatchers {
function isValidClassicLabelName (line 191) | func isValidClassicLabelName(_ *slog.Logger) func(model.LabelName) bool {
function isValidUTF8LabelName (line 198) | func isValidUTF8LabelName(_ *slog.Logger) func(model.LabelName) bool {
FILE: matcher/compat/parse_test.go
function TestFallbackMatcherParser (line 26) | func TestFallbackMatcherParser(t *testing.T) {
function TestFallbackMatchersParser (line 71) | func TestFallbackMatchersParser(t *testing.T) {
function mustNewMatcher (line 127) | func mustNewMatcher(t *testing.T, op labels.MatchType, name, value strin...
function TestIsValidClassicLabelName (line 133) | func TestIsValidClassicLabelName(t *testing.T) {
function TestIsValidUTF8LabelName (line 168) | func TestIsValidUTF8LabelName(t *testing.T) {
FILE: matcher/compliance/compliance_test.go
function TestCompliance (line 24) | func TestCompliance(t *testing.T) {
FILE: matcher/parse/bench_test.go
constant simpleExample (line 21) | simpleExample = "{foo=\"bar\"}"
constant complexExample (line 22) | complexExample = "{foo=\"bar\",bar=~\"[a-zA-Z0-9+]\"}"
function BenchmarkParseSimple (line 25) | func BenchmarkParseSimple(b *testing.B) {
function BenchmarkParseComplex (line 33) | func BenchmarkParseComplex(b *testing.B) {
FILE: matcher/parse/fuzz_test.go
function FuzzParse (line 21) | func FuzzParse(f *testing.F) {
FILE: matcher/parse/lexer.go
constant eof (line 24) | eof rune = -1
function isReserved (line 27) | func isReserved(r rune) bool {
type expectedError (line 32) | type expectedError struct
method Error (line 38) | func (e expectedError) Error() string {
type invalidInputError (line 56) | type invalidInputError struct
method Error (line 61) | func (e invalidInputError) Error() string {
type unterminatedError (line 70) | type unterminatedError struct
method Error (line 76) | func (e unterminatedError) Error() string {
type lexer (line 91) | type lexer struct
method scan (line 104) | func (l *lexer) scan() (token, error) {
method scanOperator (line 147) | func (l *lexer) scanOperator() (token, error) {
method scanQuoted (line 178) | func (l *lexer) scanQuoted() (token, error) {
method scanUnquoted (line 203) | func (l *lexer) scanUnquoted() (token, error) {
method peek (line 216) | func (l *lexer) peek() (token, error) {
method position (line 234) | func (l *lexer) position() position {
method accept (line 245) | func (l *lexer) accept(valid string) bool {
method expect (line 256) | func (l *lexer) expect(valid string) error {
method emit (line 269) | func (l *lexer) emit(kind tokenKind) token {
method next (line 281) | func (l *lexer) next() rune {
method rewind (line 295) | func (l *lexer) rewind() {
method skip (line 306) | func (l *lexer) skip() {
FILE: matcher/parse/lexer_test.go
function TestLexer_Scan (line 22) | func TestLexer_Scan(t *testing.T) {
function TestLexer_ScanError (line 701) | func TestLexer_ScanError(t *testing.T) {
function TestLexer_Peek (line 710) | func TestLexer_Peek(t *testing.T) {
function TestLexer_PeekError (line 760) | func TestLexer_PeekError(t *testing.T) {
function TestLexer_Pos (line 769) | func TestLexer_Pos(t *testing.T) {
FILE: matcher/parse/parse.go
function Matchers (line 40) | func Matchers(input string) (matchers labels.Matchers, err error) {
function Matcher (line 53) | func Matcher(input string) (*labels.Matcher, error) {
type parseFunc (line 69) | type parseFunc
type parser (line 78) | type parser struct
method parse (line 86) | func (p *parser) parse() (labels.Matchers, error) {
method parseOpenBrace (line 102) | func (p *parser) parseOpenBrace(l *lexer) (parseFunc, error) {
method parseCloseBrace (line 131) | func (p *parser) parseCloseBrace(l *lexer) (parseFunc, error) {
method parseMatcher (line 146) | func (p *parser) parseMatcher(l *lexer) (parseFunc, error) {
method parseEndOfMatcher (line 194) | func (p *parser) parseEndOfMatcher(l *lexer) (parseFunc, error) {
method parseComma (line 214) | func (p *parser) parseComma(l *lexer) (parseFunc, error) {
method parseEOF (line 234) | func (p *parser) parseEOF(l *lexer) (parseFunc, error) {
method accept (line 250) | func (p *parser) accept(l *lexer, kinds ...tokenKind) (ok bool, err er...
method acceptPeek (line 265) | func (p *parser) acceptPeek(l *lexer, kinds ...tokenKind) (bool, error) {
method expect (line 280) | func (p *parser) expect(l *lexer, kind ...tokenKind) (token, error) {
method expectPeek (line 296) | func (p *parser) expectPeek(l *lexer, kind ...tokenKind) (token, error) {
FILE: matcher/parse/parse_test.go
function TestMatchers (line 24) | func TestMatchers(t *testing.T) {
function TestMatcher (line 237) | func TestMatcher(t *testing.T) {
function mustNewMatcher (line 381) | func mustNewMatcher(t *testing.T, op labels.MatchType, name, value strin...
FILE: matcher/parse/token.go
type tokenKind (line 24) | type tokenKind
method String (line 39) | func (k tokenKind) String() string {
constant tokenEOF (line 27) | tokenEOF tokenKind = iota
constant tokenOpenBrace (line 28) | tokenOpenBrace
constant tokenCloseBrace (line 29) | tokenCloseBrace
constant tokenComma (line 30) | tokenComma
constant tokenEquals (line 31) | tokenEquals
constant tokenNotEquals (line 32) | tokenNotEquals
constant tokenMatches (line 33) | tokenMatches
constant tokenNotMatches (line 34) | tokenNotMatches
constant tokenQuoted (line 35) | tokenQuoted
constant tokenUnquoted (line 36) | tokenUnquoted
type token (line 64) | type token struct
method isEOF (line 71) | func (t token) isEOF() bool {
method isOneOf (line 76) | func (t token) isOneOf(kinds ...tokenKind) bool {
method unquote (line 81) | func (t token) unquote() (string, error) {
method String (line 95) | func (t token) String() string {
type position (line 99) | type position struct
FILE: nflog/nflog.go
type query (line 55) | type query struct
type QueryParam (line 63) | type QueryParam
function QReceiver (line 66) | func QReceiver(r *pb.Receiver) QueryParam {
function QGroupKey (line 74) | func QGroupKey(gk string) QueryParam {
type Store (line 85) | type Store struct
method GetInt (line 105) | func (s *Store) GetInt(key string) (int64, bool) {
method GetFloat (line 118) | func (s *Store) GetFloat(key string) (float64, bool) {
method GetStr (line 131) | func (s *Store) GetStr(key string) (string, bool) {
method SetInt (line 144) | func (s *Store) SetInt(key string, v int64) {
method SetFloat (line 153) | func (s *Store) SetFloat(key string, v float64) {
method SetStr (line 162) | func (s *Store) SetStr(key, v string) {
method Delete (line 171) | func (s *Store) Delete(key string) {
function NewStore (line 91) | func NewStore(entry *pb.Entry) *Store {
type Log (line 176) | type Log struct
method now (line 383) | func (l *Log) now() time.Time {
method Maintenance (line 391) | func (l *Log) Maintenance(interval time.Duration, snapf string, stopc ...
method Log (line 468) | func (l *Log) Log(r *pb.Receiver, gkey string, firingAlerts, resolvedA...
method GC (line 517) | func (l *Log) GC() (int, error) {
method Query (line 541) | func (l *Log) Query(params ...QueryParam) ([]*pb.Entry, error) {
method loadSnapshot (line 576) | func (l *Log) loadSnapshot(r io.Reader) error {
method Snapshot (line 590) | func (l *Log) Snapshot(w io.Writer) (int64, error) {
method MarshalBinary (line 606) | func (l *Log) MarshalBinary() ([]byte, error) {
method Merge (line 614) | func (l *Log) Merge(b []byte) error {
method SetBroadcast (line 639) | func (l *Log) SetBroadcast(f func([]byte)) {
type MaintenanceFunc (line 192) | type MaintenanceFunc
type metrics (line 194) | type metrics struct
function newMetrics (line 206) | func newMetrics(r prometheus.Registerer) *metrics {
type state (line 255) | type state
method clone (line 257) | func (s state) clone() state {
method merge (line 265) | func (s state) merge(e *pb.MeshEntry, now time.Time) bool {
method MarshalBinary (line 279) | func (s state) MarshalBinary() ([]byte, error) {
function decodeState (line 290) | func decodeState(r io.Reader) (state, error) {
function marshalMeshEntry (line 311) | func marshalMeshEntry(e *pb.MeshEntry) ([]byte, error) {
type Options (line 320) | type Options struct
method validate (line 330) | func (o *Options) validate() error {
function New (line 344) | func New(o Options) (*Log, error) {
function receiverKey (line 458) | func receiverKey(r *pb.Receiver) string {
function stateKey (line 464) | func stateKey(k string, r *pb.Receiver) string {
type replaceFile (line 646) | type replaceFile struct
method Close (line 651) | func (f *replaceFile) Close() error {
function openReplace (line 662) | func openReplace(filename string) (*replaceFile, error) {
FILE: nflog/nflog_test.go
function TestLogGC (line 36) | func TestLogGC(t *testing.T) {
function TestLogSnapshot (line 65) | func TestLogSnapshot(t *testing.T) {
function TestWithMaintenance_SupportsCustomCallback (line 141) | func TestWithMaintenance_SupportsCustomCallback(t *testing.T) {
function TestReplaceFile (line 191) | func TestReplaceFile(t *testing.T) {
function TestStateMerge (line 219) | func TestStateMerge(t *testing.T) {
function TestStateDataCoding (line 280) | func TestStateDataCoding(t *testing.T) {
function TestQuery (line 342) | func TestQuery(t *testing.T) {
function TestStateDecodingError (line 377) | func TestStateDecodingError(t *testing.T) {
function gosched (line 390) | func gosched() {
FILE: nflog/nflogpb/nflog.pb.go
constant _ (line 20) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 22) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type Receiver (line 25) | type Receiver struct
method Reset (line 38) | func (x *Receiver) Reset() {
method String (line 45) | func (x *Receiver) String() string {
method ProtoMessage (line 49) | func (*Receiver) ProtoMessage() {}
method ProtoReflect (line 51) | func (x *Receiver) ProtoReflect() protoreflect.Message {
method Descriptor (line 64) | func (*Receiver) Descriptor() ([]byte, []int) {
method GetGroupName (line 68) | func (x *Receiver) GetGroupName() string {
method GetIntegration (line 75) | func (x *Receiver) GetIntegration() string {
method GetIdx (line 82) | func (x *Receiver) GetIdx() uint32 {
type Entry (line 91) | type Entry struct
method Reset (line 115) | func (x *Entry) Reset() {
method String (line 122) | func (x *Entry) String() string {
method ProtoMessage (line 126) | func (*Entry) ProtoMessage() {}
method ProtoReflect (line 128) | func (x *Entry) ProtoReflect() protoreflect.Message {
method Descriptor (line 141) | func (*Entry) Descriptor() ([]byte, []int) {
method GetGroupKey (line 145) | func (x *Entry) GetGroupKey() []byte {
method GetReceiver (line 152) | func (x *Entry) GetReceiver() *Receiver {
method GetGroupHash (line 159) | func (x *Entry) GetGroupHash() []byte {
method GetResolved (line 166) | func (x *Entry) GetResolved() bool {
method GetTimestamp (line 173) | func (x *Entry) GetTimestamp() *timestamppb.Timestamp {
method GetFiringAlerts (line 180) | func (x *Entry) GetFiringAlerts() []uint64 {
method GetResolvedAlerts (line 187) | func (x *Entry) GetResolvedAlerts() []uint64 {
method GetReceiverData (line 194) | func (x *Entry) GetReceiverData() map[string]*ReceiverDataValue {
type MeshEntry (line 203) | type MeshEntry struct
method Reset (line 214) | func (x *MeshEntry) Reset() {
method String (line 221) | func (x *MeshEntry) String() string {
method ProtoMessage (line 225) | func (*MeshEntry) ProtoMessage() {}
method ProtoReflect (line 227) | func (x *MeshEntry) ProtoReflect() protoreflect.Message {
method Descriptor (line 240) | func (*MeshEntry) Descriptor() ([]byte, []int) {
method GetEntry (line 244) | func (x *MeshEntry) GetEntry() *Entry {
method GetExpiresAt (line 251) | func (x *MeshEntry) GetExpiresAt() *timestamppb.Timestamp {
type ReceiverDataValue (line 258) | type ReceiverDataValue struct
method Reset (line 270) | func (x *ReceiverDataValue) Reset() {
method String (line 277) | func (x *ReceiverDataValue) String() string {
method ProtoMessage (line 281) | func (*ReceiverDataValue) ProtoMessage() {}
method ProtoReflect (line 283) | func (x *ReceiverDataValue) ProtoReflect() protoreflect.Message {
method Descriptor (line 296) | func (*ReceiverDataValue) Descriptor() ([]byte, []int) {
method GetValue (line 300) | func (x *ReceiverDataValue) GetValue() isReceiverDataValue_Value {
method GetStrVal (line 307) | func (x *ReceiverDataValue) GetStrVal() string {
method GetIntVal (line 316) | func (x *ReceiverDataValue) GetIntVal() int64 {
method GetDoubleVal (line 325) | func (x *ReceiverDataValue) GetDoubleVal() float64 {
type isReceiverDataValue_Value (line 334) | type isReceiverDataValue_Value interface
type ReceiverDataValue_StrVal (line 338) | type ReceiverDataValue_StrVal struct
method isReceiverDataValue_Value (line 350) | func (*ReceiverDataValue_StrVal) isReceiverDataValue_Value() {}
type ReceiverDataValue_IntVal (line 342) | type ReceiverDataValue_IntVal struct
method isReceiverDataValue_Value (line 352) | func (*ReceiverDataValue_IntVal) isReceiverDataValue_Value() {}
type ReceiverDataValue_DoubleVal (line 346) | type ReceiverDataValue_DoubleVal struct
method isReceiverDataValue_Value (line 354) | func (*ReceiverDataValue_DoubleVal) isReceiverDataValue_Value() {}
constant file_nflog_proto_rawDesc (line 358) | file_nflog_proto_rawDesc = "" +
function file_nflog_proto_rawDescGZIP (line 395) | func file_nflog_proto_rawDescGZIP() []byte {
function init (line 425) | func init() { file_nflog_proto_init() }
function file_nflog_proto_init (line 426) | func file_nflog_proto_init() {
FILE: nflog/nflogpb/set.go
method IsFiringSubset (line 18) | func (m *Entry) IsFiringSubset(subset map[uint64]struct{}) bool {
method IsResolvedSubset (line 29) | func (m *Entry) IsResolvedSubset(subset map[uint64]struct{}) bool {
function isSubset (line 38) | func isSubset(set, subset map[uint64]struct{}) bool {
FILE: nflog/nflogpb/set_test.go
function TestIsFiringSubset (line 20) | func TestIsFiringSubset(t *testing.T) {
function TestIsResolvedSubset (line 48) | func TestIsResolvedSubset(t *testing.T) {
function newSubset (line 76) | func newSubset(elements ...uint64) map[uint64]struct{} {
function elements (line 85) | func elements(m map[uint64]struct{}) []uint64 {
FILE: notify/discord/discord.go
constant maxTitleLenRunes (line 40) | maxTitleLenRunes = 256
constant maxDescriptionLenRunes (line 42) | maxDescriptionLenRunes = 4096
constant maxContentLenRunes (line 44) | maxContentLenRunes = 2000
constant colorRed (line 48) | colorRed =
Condensed preview — 593 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,395K chars).
[
{
"path": ".dockerignore",
"chars": 127,
"preview": ".build/\n.tarballs/\n\n!.build/linux-amd64/\n!.build/linux-armv7/\n!.build/linux-arm64/\n!.build/linux-ppc64le/\n!.build/linux-"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"chars": 2587,
"preview": "---\nname: Bug report\ndescription: Create a report to help us improve.\nbody:\n - type: markdown\n attributes:\n val"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 358,
"preview": "blank_issues_enabled: true\ncontact_links:\n - name: Prometheus Community Support\n url: https://prometheus.io/communit"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.yml",
"chars": 641,
"preview": "---\nname: Feature request\ndescription: Suggest an idea for this project.\nbody:\n - type: markdown\n attributes:\n "
},
{
"path": ".github/pull_request_template.md",
"chars": 3187,
"preview": "<!--\n - Please give your PR a title in the form \"area: short description\". For example \"dispatcher: improve performa"
},
{
"path": ".github/workflows/ci.yml",
"chars": 1803,
"preview": "---\nname: CI\non: # yamllint disable-line rule:truthy\n pull_request:\n workflow_call:\njobs:\n test_frontend:\n name: "
},
{
"path": ".github/workflows/container_description.yml",
"chars": 2461,
"preview": "---\nname: Push README to Docker Hub\non:\n push:\n paths:\n - \"README.md\"\n - \"README-containers.md\"\n - \"."
},
{
"path": ".github/workflows/mixin.yml",
"chars": 842,
"preview": "name: mixin\non:\n pull_request:\n paths:\n - \"doc/alertmanager-mixin/**\"\n\njobs:\n mixin:\n name: mixin-lint\n "
},
{
"path": ".github/workflows/publish.yml",
"chars": 1223,
"preview": "---\nname: Publish\non: # yamllint disable-line rule:truthy\n push:\n branches:\n - main\njobs:\n ci:\n name: Run "
},
{
"path": ".github/workflows/release.yml",
"chars": 1279,
"preview": "---\nname: Release\non: # yamllint disable-line rule:truthy\n push:\n tags:\n - v*\njobs:\n ci:\n name: Run ci\n "
},
{
"path": ".github/workflows/stale.yml",
"chars": 1212,
"preview": "name: Stale Check\non:\n workflow_dispatch: {}\n schedule:\n - cron: '16 22 * * *'\npermissions:\n issues: write\n pull-"
},
{
"path": ".github/workflows/ui-ci.yml",
"chars": 827,
"preview": "name: UI CI\n\non:\n pull_request:\n branches:\n - '**'\n paths:\n - 'ui/**'\n\nconcurrency:\n group: ${{ github"
},
{
"path": ".gitignore",
"chars": 401,
"preview": "/data/\n/alertmanager\n/amtool\n*.yml\n*.yaml\n/.build\n/.release\n/.tarballs\n/vendor\n\n!.golangci.yml\n!/cli/testdata/*.yml\n!/cl"
},
{
"path": ".golangci.yml",
"chars": 2788,
"preview": "version: \"2\"\nlinters:\n enable:\n - depguard\n - errorlint\n - godot\n - misspell\n - modernize\n - revive\n "
},
{
"path": ".promu.yml",
"chars": 1023,
"preview": "go:\n # Whenever the Go version is updated here,\n # .circle/config.yml should also be updated.\n version: 1.26\nre"
},
{
"path": ".yamllint",
"chars": 507,
"preview": "---\nextends: default\nignore: |\n **/node_modules\n web/api/v1/testdata/openapi_*_golden.yaml\n\nrules:\n braces:\n max-s"
},
{
"path": "CHANGELOG.md",
"chars": 55854,
"preview": "## main / (unreleased)\n\n* [CHANGE] ...\n* [FEATURE] ...\n* [ENHANCEMENT] ...\n* [BUGFIX] Use dispatcher tick time when eval"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 152,
"preview": "# Prometheus Community Code of Conduct\n\nPrometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation"
},
{
"path": "COPYRIGHT.txt",
"chars": 546,
"preview": "Copyright Prometheus Team\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file exce"
},
{
"path": "Dockerfile",
"chars": 833,
"preview": "ARG ARCH=\"amd64\"\nARG OS=\"linux\"\nFROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest\nLABEL maintainer=\"The Prometheus Au"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "MAINTAINERS.md",
"chars": 433,
"preview": "* Simon Pasquier <pasquier.simon@gmail.com> @simonpasquier\n* Andrey Kuzmin <unsoundscapes@gmail.com> @w0rm\n* Josue Abreu"
},
{
"path": "Makefile",
"chars": 1709,
"preview": "# Copyright 2015 The Prometheus Authors\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not "
},
{
"path": "Makefile.common",
"chars": 19997,
"preview": "# Copyright The Prometheus Authors\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use t"
},
{
"path": "NOTICE",
"chars": 311,
"preview": "Prometheus Alertmanager\nCopyright 2013-2015 The Prometheus Authors\n\nThis product includes software developed at\nSoundClo"
},
{
"path": "Procfile",
"chars": 621,
"preview": "a1: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a1 --web.listen-address=:9093 --cluster.listen-address=127."
},
{
"path": "README.md",
"chars": 17527,
"preview": "# Alertmanager [][circleci]\n\n[![D"
},
{
"path": "RELEASE.md",
"chars": 1631,
"preview": "# Releases\nThis page describes the release process and the currently planned schedule for upcoming releases as well as t"
},
{
"path": "SECURITY.md",
"chars": 172,
"preview": "# Reporting a security issue\n\nThe Prometheus security policy, including how to report vulnerabilities, can be\nfound here"
},
{
"path": "VERSION",
"chars": 7,
"preview": "0.31.1\n"
},
{
"path": "alert/alert.go",
"chars": 3479,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "alert/alert_test.go",
"chars": 7594,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "alert/state.go",
"chars": 862,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "alert/status.go",
"chars": 1175,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "alert/validate.go",
"chars": 955,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "alert/validate_test.go",
"chars": 2008,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "api/api.go",
"chars": 8539,
"preview": "// Copyright 2019 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "api/metrics/metrics.go",
"chars": 2105,
"preview": "// Copyright 2019 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "api/v1_deprecation_router.go",
"chars": 2094,
"preview": "// Copyright 2023 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "api/v2/api.go",
"chars": 24515,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "api/v2/api_test.go",
"chars": 19637,
"preview": "// Copyright 2019 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "api/v2/client/alert/alert_client.go",
"chars": 5692,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alert/get_alerts_parameters.go",
"chars": 9562,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alert/get_alerts_responses.go",
"chars": 7901,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alert/post_alerts_parameters.go",
"chars": 4735,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alert/post_alerts_responses.go",
"chars": 7588,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alertgroup/alertgroup_client.go",
"chars": 4385,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alertgroup/get_alert_groups_parameters.go",
"chars": 9867,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alertgroup/get_alert_groups_responses.go",
"chars": 8388,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/alertmanager_api_client.go",
"chars": 4558,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/general/general_client.go",
"chars": 4339,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/general/get_status_parameters.go",
"chars": 4148,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/general/get_status_responses.go",
"chars": 3415,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/receiver/get_receivers_parameters.go",
"chars": 4281,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/receiver/get_receivers_responses.go",
"chars": 3461,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/receiver/receiver_client.go",
"chars": 4382,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/delete_silence_parameters.go",
"chars": 4888,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/delete_silence_responses.go",
"chars": 7592,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/get_silence_parameters.go",
"chars": 4741,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/get_silence_responses.go",
"chars": 7776,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/get_silences_parameters.go",
"chars": 5381,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/get_silences_responses.go",
"chars": 8089,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/post_silences_parameters.go",
"chars": 4858,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/post_silences_responses.go",
"chars": 8848,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/client/silence/silence_client.go",
"chars": 8671,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/compat.go",
"chars": 6976,
"preview": "// Copyright 2021 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "api/v2/models/alert.go",
"chars": 3394,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/alert_group.go",
"chars": 5733,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/alert_groups.go",
"chars": 2368,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/alert_status.go",
"chars": 4158,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/alertmanager_config.go",
"chars": 2199,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/alertmanager_status.go",
"chars": 6096,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/cluster_status.go",
"chars": 4789,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/gettable_alert.go",
"chars": 9855,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/gettable_alerts.go",
"chars": 2395,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/gettable_silence.go",
"chars": 5392,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/gettable_silences.go",
"chars": 2413,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/label_set.go",
"chars": 1207,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/matcher.go",
"chars": 2717,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/matchers.go",
"chars": 2495,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/peer_status.go",
"chars": 2398,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/postable_alert.go",
"chars": 5624,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/postable_alerts.go",
"chars": 2395,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/postable_silence.go",
"chars": 3126,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/receiver.go",
"chars": 2048,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/silence.go",
"chars": 5780,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/silence_status.go",
"chars": 3135,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/models/version_info.go",
"chars": 3773,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/openapi.yaml",
"chars": 13888,
"preview": "---\n\nswagger: '2.0'\n\ninfo:\n version: 0.0.1\n title: Alertmanager API\n description: API of the Prometheus Alertmanager "
},
{
"path": "api/v2/restapi/configure_alertmanager.go",
"chars": 5959,
"preview": "// This file is safe to edit. Once it exists it will not be overwritten\n\n// Copyright Prometheus Team\n// Licensed under "
},
{
"path": "api/v2/restapi/doc.go",
"chars": 1019,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n// Copyright Prometheus Team\n// Licensed under the Apache License, Version"
},
{
"path": "api/v2/restapi/embedded_spec.go",
"chars": 41276,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/get_alerts.go",
"chars": 2155,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/get_alerts_parameters.go",
"chars": 7633,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/get_alerts_responses.go",
"chars": 4351,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/get_alerts_urlbuilder.go",
"chars": 4079,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/post_alerts.go",
"chars": 2175,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/post_alerts_parameters.go",
"chars": 2850,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/post_alerts_responses.go",
"chars": 3805,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alert/post_alerts_urlbuilder.go",
"chars": 2841,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alertgroup/get_alert_groups.go",
"chars": 2291,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alertgroup/get_alert_groups_parameters.go",
"chars": 7719,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go",
"chars": 4611,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alertgroup/get_alert_groups_urlbuilder.go",
"chars": 4103,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/alertmanager_api.go",
"chars": 16219,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/general/get_status.go",
"chars": 2201,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/general/get_status_parameters.go",
"chars": 1852,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/general/get_status_responses.go",
"chars": 1952,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/general/get_status_urlbuilder.go",
"chars": 2830,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/receiver/get_receivers.go",
"chars": 2271,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/receiver/get_receivers_parameters.go",
"chars": 1886,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/receiver/get_receivers_responses.go",
"chars": 2046,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/receiver/get_receivers_urlbuilder.go",
"chars": 2873,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/delete_silence.go",
"chars": 2269,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/delete_silence_parameters.go",
"chars": 3109,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/delete_silence_responses.go",
"chars": 3484,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/delete_silence_urlbuilder.go",
"chars": 3202,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silence.go",
"chars": 2197,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silence_parameters.go",
"chars": 3070,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silence_responses.go",
"chars": 3909,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silence_urlbuilder.go",
"chars": 3160,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silences.go",
"chars": 2207,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silences_parameters.go",
"chars": 2832,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silences_responses.go",
"chars": 4465,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/get_silences_urlbuilder.go",
"chars": 3260,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/post_silences.go",
"chars": 3237,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/post_silences_parameters.go",
"chars": 2884,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/post_silences_responses.go",
"chars": 4240,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/operations/silence/post_silences_urlbuilder.go",
"chars": 2871,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/restapi/server.go",
"chars": 16193,
"preview": "// Code generated by go-swagger; DO NOT EDIT.\n\n// Copyright Prometheus Team\n// Licensed under the Apache License, Versio"
},
{
"path": "api/v2/testing.go",
"chars": 1859,
"preview": "// Copyright 2022 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "buf.gen.yaml",
"chars": 168,
"preview": "version: v2\nplugins:\n - local: ['go', 'tool', '-modfile=internal/tools/go.mod', 'protoc-gen-go']\n out: .\n opt:\n "
},
{
"path": "buf.yaml",
"chars": 321,
"preview": "# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml\nversion: v2\nmodules:\n -"
},
{
"path": "cli/alert.go",
"chars": 859,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/alert_add.go",
"chars": 4229,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/alert_query.go",
"chars": 4048,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/check_config.go",
"chars": 2671,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/check_config_test.go",
"chars": 919,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/cluster.go",
"chars": 1422,
"preview": "// Copyright 2020 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/config/config.go",
"chars": 2100,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/config/config_test.go",
"chars": 4241,
"preview": "// Copyright 2015 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/config/http_config.go",
"chars": 1157,
"preview": "// Copyright 2021 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/config/testdata/amtool.bad.yml",
"chars": 4,
"preview": "BAD\n"
},
{
"path": "cli/config/testdata/amtool.good1.yml",
"chars": 18,
"preview": "id: id1\nurl: url1\n"
},
{
"path": "cli/config/testdata/amtool.good2.yml",
"chars": 22,
"preview": "old-id: id2\nurl: url2\n"
},
{
"path": "cli/config/testdata/http_config.bad.yml",
"chars": 29,
"preview": "authorization:\n type: Basic\n"
},
{
"path": "cli/config/testdata/http_config.basic_auth.good.yml",
"chars": 50,
"preview": "basic_auth:\n username: user\n password: password\n"
},
{
"path": "cli/config/testdata/http_config.good.yml",
"chars": 145,
"preview": "authorization:\n type: Bearer\n credentials: theanswertothegreatquestionoflifetheuniverseandeverythingisfortytwo\nproxy_u"
},
{
"path": "cli/config.go",
"chars": 1637,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/format/format.go",
"chars": 2097,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/format/format_extended.go",
"chars": 4273,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/format/format_json.go",
"chars": 1552,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/format/format_simple.go",
"chars": 2640,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/format/sort.go",
"chars": 1692,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/root.go",
"chars": 7053,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/routing.go",
"chars": 3415,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/silence.go",
"chars": 1110,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/silence_add.go",
"chars": 5701,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/silence_expire.go",
"chars": 1551,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/silence_import.go",
"chars": 3904,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/silence_query.go",
"chars": 5462,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/silence_update.go",
"chars": 3997,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/template.go",
"chars": 867,
"preview": "// Copyright 2021 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/template_render.go",
"chars": 4404,
"preview": "// Copyright 2021 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/test_routing.go",
"chars": 3732,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/test_routing_test.go",
"chars": 2310,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cli/testdata/conf.bad.yml",
"chars": 4,
"preview": "BAD\n"
},
{
"path": "cli/testdata/conf.good.yml",
"chars": 151,
"preview": "global:\n smtp_smarthost: 'localhost:25'\n\ntemplates:\n - '/etc/alertmanager/template/*.tmpl'\n\nroute:\n receiver: default"
},
{
"path": "cli/testdata/conf.routing-reverted.yml",
"chars": 345,
"preview": "global:\n smtp_smarthost: 'localhost:25'\n\ntemplates:\n - '/etc/alertmanager/template/*.tmpl'\n\nroute:\n receiver: default"
},
{
"path": "cli/testdata/conf.routing.yml",
"chars": 324,
"preview": "global:\n smtp_smarthost: 'localhost:25'\n\ntemplates:\n - '/etc/alertmanager/template/*.tmpl'\n\nroute:\n receiver: default"
},
{
"path": "cli/utils.go",
"chars": 3764,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cluster/advertise.go",
"chars": 2809,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cluster/advertise_test.go",
"chars": 4042,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cluster/channel.go",
"chars": 5100,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cluster/channel_test.go",
"chars": 2151,
"preview": "// Copyright 2018 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cluster/cluster.go",
"chars": 22742,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "cluster/cluster_test.go",
"chars": 10654,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "cluster/clusterpb/cluster.pb.go",
"chars": 8690,
"preview": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.11\n// \tprotoc (unknown)\n// "
},
{
"path": "cluster/clusterpb/cluster.proto",
"chars": 383,
"preview": "syntax = \"proto3\";\n\npackage clusterpb;\n\noption go_package = \"github.com/prometheus/alertmanager/cluster/clusterpb\";\n\nmes"
},
{
"path": "cluster/connection_pool.go",
"chars": 2007,
"preview": "// Copyright 2020 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use "
},
{
"path": "cluster/delegate.go",
"chars": 9843,
"preview": "// Copyright The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not us"
},
{
"path": "cluster/testdata/certs/ca-config.json",
"chars": 231,
"preview": "{\n \"signing\": {\n \"default\": {\n \"expiry\": \"876000h\"\n },\n \"profiles\": {\n \"massl\": {\n \"usages\": "
},
{
"path": "cluster/testdata/certs/ca-csr.json",
"chars": 204,
"preview": "{\n \"CN\": \"massl\",\n \"key\": {\n \"algo\": \"rsa\",\n \"size\": 2048\n },\n \"names\": [\n {\n \"C\": \"AU\",\n \"L\": \"M"
},
{
"path": "cluster/testdata/certs/ca-key.pem",
"chars": 1679,
"preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAuljDjKVGwlyiuKTSHc1QpoZPX9dbgwU/9113ctI8U/ZwMWLp\nnZ4f/zVpf4LW5foM9zSEUGP"
},
{
"path": "cluster/testdata/certs/ca.csr",
"chars": 997,
"preview": "-----BEGIN CERTIFICATE REQUEST-----\nMIICpzCCAY8CAQAwYjELMAkGA1UEBhMCQVUxETAPBgNVBAgTCFZpY3RvcmlhMRIw\nEAYDVQQHEwlNZWxib3V"
},
{
"path": "cluster/testdata/certs/ca.pem",
"chars": 4368,
"preview": "Certificate:\n Data:\n Version: 3 (0x2)\n Serial Number:\n 7a:d7:1c:f3:22:da:b1:20:31:bf:25:16:b"
},
{
"path": "cluster/testdata/certs/node1-csr.json",
"chars": 222,
"preview": "{\n \"CN\": \"system:server\",\n \"key\": {\n \"algo\": \"rsa\",\n \"size\": 2048\n },\n \"names\": [\n {\n \"C\": \"AU\",\n "
},
{
"path": "cluster/testdata/certs/node1-key.pem",
"chars": 1675,
"preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA1b9bm4rvDtpYsqgtCC52+L535d4/Q2O10fWD2i2CfRXXfYJQ\n5cr4AV2iqScFsJSs7KwyQde"
},
{
"path": "cluster/testdata/certs/node1.csr",
"chars": 1082,
"preview": "-----BEGIN CERTIFICATE REQUEST-----\nMIIC5TCCAc0CAQAwczELMAkGA1UEBhMCQVUxETAPBgNVBAgTCFZpY3RvcmlhMRIw\nEAYDVQQHEwlNZWxib3V"
},
{
"path": "cluster/testdata/certs/node1.pem",
"chars": 1452,
"preview": "-----BEGIN CERTIFICATE-----\nMIIEAjCCAuqgAwIBAgIUbYMGwSgQF8iRZ5xmhflInj8VZ0owDQYJKoZIhvcNAQEL\nBQAwYjELMAkGA1UEBhMCQVUxETA"
},
{
"path": "cluster/testdata/certs/node2-csr.json",
"chars": 222,
"preview": "{\n \"CN\": \"system:server\",\n \"key\": {\n \"algo\": \"rsa\",\n \"size\": 2048\n },\n \"names\": [\n {\n \"C\": \"AU\",\n "
},
{
"path": "cluster/testdata/certs/node2-key.pem",
"chars": 1679,
"preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAtCtzT9vhRMTbhAg/pm8eBn+4IvVQeVqnHoEon9IKIx5fyvqS\nQ6Ui3xSik9kJq5FSAa1mSca"
},
{
"path": "cluster/testdata/certs/node2.csr",
"chars": 1082,
"preview": "-----BEGIN CERTIFICATE REQUEST-----\nMIIC5TCCAc0CAQAwczELMAkGA1UEBhMCQVUxETAPBgNVBAgTCFZpY3RvcmlhMRIw\nEAYDVQQHEwlNZWxib3V"
},
{
"path": "cluster/testdata/certs/node2.pem",
"chars": 1452,
"preview": "-----BEGIN CERTIFICATE-----\nMIIEAjCCAuqgAwIBAgIUex5xEYsDJPUg8idU0Sql2ixGdTwwDQYJKoZIhvcNAQEL\nBQAwYjELMAkGA1UEBhMCQVUxETA"
},
{
"path": "cluster/testdata/empty_tls_config.yml",
"chars": 3,
"preview": "{}\n"
},
{
"path": "cluster/testdata/tls_config_node1.yml",
"chars": 273,
"preview": "tls_server_config:\n cert_file: \"certs/node1.pem\"\n key_file: \"certs/node1-key.pem\"\n client_ca_file: \"certs/ca.pem\"\n c"
},
{
"path": "cluster/testdata/tls_config_node2.yml",
"chars": 273,
"preview": "tls_server_config:\n cert_file: \"certs/node2.pem\"\n key_file: \"certs/node2-key.pem\"\n client_ca_file: \"certs/ca.pem\"\n c"
},
{
"path": "cluster/testdata/tls_config_with_missing_client.yml",
"chars": 163,
"preview": "tls_server_config:\n cert_file: \"certs/node2.pem\"\n key_file: \"certs/node2-key.pem\"\n client_ca_file: \"certs/ca.pem\"\n c"
},
{
"path": "cluster/testdata/tls_config_with_missing_server.yml",
"chars": 110,
"preview": "tls_client_config:\n cert_file: \"certs/node1.pem\"\n key_file: \"certs/node1-key.pem\"\n ca_file: \"certs/ca.pem\"\n"
},
{
"path": "cluster/tls_config.go",
"chars": 1534,
"preview": "// Copyright 2020 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may n"
}
]
// ... and 393 more files (download for full content)
About this extraction
This page contains the full source code of the prometheus/alertmanager GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 593 files (3.0 MB), approximately 808.1k tokens, and a symbol index with 3564 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.