Codebase analysis · CoreStory V3

Alertmanager

An open-source alert handling service, written in Go. It receives alerts from Prometheus and other clients, deduplicates, groups, silences and inhibits them, and routes notifications to receivers such as email, PagerDuty and Slack. Maintained by the Prometheus project.

Maintained by
the Prometheus project
License
Apache-2.0
Commit analyzed
b6c5821b9f33187955b411c976114eeaf7b18c47
Rules extracted
2026-11-13
Extracted by CoreStory V3
4879
accepted rules, each with a cited source quote
22
capabilities
930
features
01 · Rules

Business rules, traced to source lines.

These 12 rules are a sample of the 4,879 CoreStory V3 extracted from Alertmanager. Each one links to the exact lines on GitHub at commit b6c5821. The statement is CoreStory V3’s wording; the code excerpt is the source it cites.

limit
dispatch/dispatch.go

The dispatcher enforces a maximum number of aggregation groups returned by Limits.MaxNumberOfAggregationGroups(); when a new group is needed and the limit is positive and the current group count is greater than or equal to the limit, the dispatcher does not create the group, increments the aggrGroupLimitReached metric, logs 'Failed to create aggregation group' with the error 'too many aggregation groups, cannot create new group for alert', and returns. A limit of 0 or less means unlimited, and a nil Limits is replaced by nilLimits which returns 0.

  • 0 — nilLimits.MaxNumberOfAggregationGroups return value, meaning unlimited because only positive limits are enforced
limit := d.limits.MaxNumberOfAggregationGroups() current := int(d.aggrGroupsNum.Load()) if limit > 0 && current >= limit { d.metrics.aggrGroupLimitReached.Inc() err := errors.New("too many aggregation groups, cannot create new group for alert") message := "Failed to create aggregation group" d.logger.Error(message, "err", err.Error(), "groups", current, "limit", limit, "alert", alrt.Name()) tracing.RecordAggregationGroupLimit(span, err, current, limit) return }
limit
api/api.go

Concurrency limiting applies only to HTTP GET requests; non-GET methods bypass the in-flight semaphore. When the semaphore is full, the request fails with HTTP 503 and message "Limit of concurrent GET requests reached (<capacity>), try again later.\n".

  • GET — only method subject to concurrency limit
  • 503 — HTTP status returned when the concurrency limit is reached
  • Limit of concurrent GET requests reached (%d), try again later. — error response message template
func (api *API) concurrencyLimitHandler(h http.Handler) http.Handler { return 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) }) }
limit
notify/pagerduty/pagerduty.go

When an encoded PagerDuty message exceeds 512000 bytes, the notifier removes the custom details (replacing them with an error entry) and re-encodes the message. The API v1 branch puts the message in `Details`, while other branches put it in `Payload.CustomDetails`.

  • 512000 bytes — maximum encoded event size before truncation
if buf.Len() > maxEventSize { truncatedMsg := fmt.Sprintf("Custom details have been removed because the original event exceeds the maximum size of %s", units.MetricBytes(maxEventSize).String()) if n.apiV1 != "" { msg.Details = map[string]any{"error": truncatedMsg} } else { msg.Payload.CustomDetails = map[string]any{"error": truncatedMsg} }

Also cited: L38

validation
api/v2/api.go

When creating a silence, EndsAt must not be before the current time; if it is, the handler returns 400 Bad Request with "Failed to create silence: end time can't be in the past".

  • Failed to create silence: end time can't be in the past — bad request message
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) }
validation
api/v2/api.go

When an alert's EndsAt is zero, the alert is marked as a timeout alert and EndsAt is set to now plus the configured global ResolveTimeout used as a time.Duration.

// If no end time is defined, set a timeout after which an alert // is marked resolved if it is not updated. timeout := false if alrt.EndsAt.IsZero() { timeout = true alrt.EndsAt = now.Add(resolveTimeout) }

Also cited: L357–L359

model supplied classification
silence/silence.go

Creating a new or replacement silence is rejected if the configured Limits.MaxSilences limit is non-nil, the limit value is greater than 0, and the current number of silences plus one would exceed the limit; the error reports the current count and the limit.

  • 0 — limit value must be greater than this for enforcement to apply
  • 1 — increment added to current silence count when checking capacity
if s.limits.MaxSilences != nil { if m := s.limits.MaxSilences(); m > 0 && len(s.st)+1 > m { return fmt.Errorf("exceeded maximum number of silences: %d (limit: %d)", len(s.st), m) } }

Also cited: L68–L70

model supplied classification
silence/silence.go

An individual silence is rejected if the configured Limits.MaxSilenceSizeBytes limit is non-nil, the limit value is greater than 0, and the protobuf-encoded size of the MeshSilence exceeds that limit; the error reports the actual size in bytes and the limit in bytes.

  • 0 — limit value must be greater than this for enforcement to apply
if s.limits.MaxSilenceSizeBytes != nil { n := proto.Size(msil) if m := s.limits.MaxSilenceSizeBytes(); m > 0 && n > m { return fmt.Errorf("silence exceeded maximum size: %d bytes (limit: %d bytes)", n, m) } }
calculation
nflog/nflog.go

The expiration time for a log entry is now plus the log's retention, except that if the supplied expiry is greater than zero and retention is greater than expiry, the expiration time is now plus expiry.

  • 0 — expiry threshold above which the override applies
expiresAt := now.Add(l.retention) if expiry > 0 && l.retention > expiry { expiresAt = now.Add(expiry) }

Also cited: L464, L178

policy
notify/jira/jira.go

When not firing, the issue is only transitioned if its status category key is not "done", and the transition used is the configured ResolveTransition. If already done, no transition occurs.

  • done — status category key preventing resolve transition
} else { if i.Fields.Status.StatusCategory.Key == "done" { return false, notify.DefaultReason, nil } transition = n.conf.ResolveTransition }
validation
notify/email/email.go

The rendered From value must parse as an address list and contain exactly one address; otherwise an unrecoverable error is returned: "parse 'from' addresses" on parse failure or "must be exactly one 'from' address (got: %d)" with the actual count.

  • 1 — required exactly-one count of from addresses
addrs, err := mail.ParseAddressList(from) if err != nil { return notify.Unrecoverable(fmt.Errorf("parse 'from' addresses: %w", err), notify.DefaultReason) } if len(addrs) != 1 { return notify.Unrecoverable(fmt.Errorf("must be exactly one 'from' address (got: %d)", len(addrs)), notify.DefaultReason) }
limits and calculation
notify/webhook/webhook.go

If MaxAlerts is non-zero and the number of alerts exceeds MaxAlerts, the notifier truncates the alert slice to the first MaxAlerts alerts and reports the number of truncated alerts as (len(alerts) - maxAlerts); otherwise it sends all alerts and reports zero truncated.

  • 0 — boundary that disables truncation and the base truncated count when no truncation occurs
func truncateAlerts(maxAlerts uint64, alerts []*alert.Alert) ([]*alert.Alert, uint64) { if maxAlerts != 0 && uint64(len(alerts)) > maxAlerts { return alerts[:maxAlerts], uint64(len(alerts)) - maxAlerts } return alerts, 0 }

Also cited: L80

validation
notify/victorops/victorops.go

When the alerts status is firing, if the templated message type is not one of the allowed events (INFO, WARNING, CRITICAL), the message type is replaced with CRITICAL.

  • true — allowed event INFO
  • true — allowed event WARNING
  • true — allowed event CRITICAL
  • CRITICAL — replacement message type when disallowed
  • INFO — allowed event key
  • WARNING — allowed event key
  • CRITICAL — allowed event key
if alerts.Status() == model.AlertFiring && !victorOpsAllowedEvents[messageType] { messageType = victorOpsEventTrigger }

Also cited: L117–L121, L64

02 · Capabilities

What the application does

22 capabilities identified, grouping 322 of the 919 distinct features extracted. Most extracted features are not grouped under a capability, so this list is a partial view of the application. These are descriptions, not the cited rules above.

Notification Integrations

Outbound delivery to external notification channels such as Slack, PagerDuty, Opsgenie, email, chat and mobile push.

  • Discord Notification Delivery: Sends templated notifications to a Discord channel/webhook, with retry handling, URL redaction, and the ability to read the webhook reading URL from a file.
  • Email Notification: Sends email notifications to users using a templated email message.
  • Email Notifications: Sends email notifications to configured recipients through an SMTP server, with authentication and sender/recipient configuration.
  • MS Teams Notification: Sends formatted notification messages to Microsoft Teams via the msteamsv2 channel with adaptive card attachments and status coloring.
  • Mattermost Notifications: Sending notifications to Mattermost channels via webhook URLs, including retry and message templating support.
  • Mobile and Messaging Push Notifications: Send alerts through push and messaging channels such as Pushover, SNS, Telegram, WeChat, and Webex.
  • OpsGenie Alert Notification: Sends alert notifications to OpsGenie with configurable message, priority, responders, tags, and details.
  • Opsgenie Notification Integration: Forward alerts to Opsgenie by configuring Opsgenie API keys, responders, and service details.
  • PagerDuty Alert Notification: Send alert notifications to PagerDuty using routing/service keys with severity, source, and detail fields.
  • Push Notifications: Sends push notifications through the Pushover service, supporting title, message, and URL content within length limits.
  • RocketChat Notification Delivery: Sends alerts to RocketChat channels using configured token credentials and channel/receiver settings.
  • SNS Notification Publishing: Publishes messages to Amazon SNS topics, including building publish input, message attributes, and dispatching notifications.
  • Slack Notification Delivery: Sends alert notifications to Slack channels by resolving configured Slack API URLs and message receivers.
  • Slack Notifications: Sends alerts to Slack using configured API URLs, app tokens, and channels.
  • Telegram Notification Delivery: Sends notifications to configured Telegram chats via bot tokens, allowing users to receive alerts through Telegram.
  • VictorOps Alert Notification: Sends alert trigger and resolve events to VictorOps with a formatted payload honoring a maximum message length.
  • WeChat Message Sending: Composes and dispatches messages to specified users, parties, or tags via the WeChat API using configured credentials.
  • Webex Message Delivery: Sending messages to Webex with templating, size handling, and retry behavior on failure.
  • Webhook Alert Delivery: Delivers alert notifications to a webhook endpoint with configurable default payloads and retry behaviour.
  • Webhook Notification: Send structured notifications to an external webhook channel with configurable message content.

Alert Processing and Routing

Ingestion, grouping, routing, deduplication, inhibition, silencing, muting and dispatch of alerts through the notification pipeline.

  • Alert Batch Ingestion: Ingests batches of alerts for processing by the dispatcher.
  • Alert Deduplication: Suppresses duplicate alerts by tracking a hash and determining whether an incoming alert needs updating, partitioning alerts by their state.
  • Alert Dispatch: Dispatches alerts to peers on a scheduled interval with connection handling.
  • Alert Grouping: Alerts are collected into aggregation groups with limits applied before being routed to receivers.
  • Alert Grouping and Routing: Groups incoming alerts and routes them to the appropriate receivers according to the loaded route configuration.
  • Alert Ingestion: Alerts are pushed into Alertmanager for processing and routing.
  • Alert Inhibition: Capability to inhibit an alert based on external conditions or dependencies.
  • Alert Mute Suppression: Determines whether incoming alerts should be silenced based on configured mute time intervals.
  • Alert Muting: Suppresses muted alerts and applies mute time intervals so silenced alerts are not notified.
  • Alert Notification Dispatch: Deliver alert notifications to integrations with an associated notify reason.
  • Alert Notification Pipeline: Alerts flow through a multi-stage pipeline that fires and flushes notifications for firing and resolved alerts.
  • Alert Notification Routing: Routes alerts to configured receivers according to matching rules, grouping, and repeat/interval settings.
  • Alert Routing: Routes alerts to receivers according to configured route matching, grouping, and repeat timing.
  • Alert Routing Configuration: Loading and validating alerting route trees including root/sub-routes, matchers, receiver references, grouping, and mute/active time windows.
  • Alert Routing and Dispatch: Incoming alerts are matched against routing rules and dispatched to the appropriate receivers.
  • Alert Silencing: Capability to silence an alert so it is suppressed from notification or display.
  • Alert Submission: Receive and ingest alerts posted to the API from external alert producers.
  • Alert Suppression: Enables users to silence or inhibit alerts so that notifications are temporarily or persistently suppressed.

Build, Test and CI Tooling

Building, testing, linting, containerizing and releasing the project through the CI pipeline.

  • API Client Generation: Generates client code from an OpenAPI description using the generator container image.
  • API Route Testing: End-to-end verification that configured API routes respond with the expected status under optional TLS.
  • Acceptance Testing: Run acceptance tests against an Alertmanager instance.
  • Automated Dependency Updates: Capability to configure automated dependency updates across ecosystems with schedules, pull request limits, and path exclusions.
  • Browser Automation Testing: Runs the application's test suite against real browsers using the Playwright test runner.
  • Build and Test: Capability to build the project and run its test suite, including frontend tests.
  • CI Pipeline Execution: Automated continuous-integration pipeline that defines jobs, steps, and service dependencies executed in response to code changes.
  • Code Formatting: Applies a consistent code style across the codebase via the project's formatter.
  • Container Image Build: Builds container binaries and images, including cross-platform builds, from a repository.
  • Container Image Tagging: Assigns names and tags to built container images.
  • Docker Image Build: Building Docker images with configurable architectures and image names.
  • End-to-End Test Runner: Launches a test instance of the application, waits for it to become healthy, and drives it through an end-to-end scenario via a client using configured feature flags.
  • Formatting and Linting: Formats and lints project source files as a user-triggered task.
  • Linting: Running lint checks across the codebase and the Mantine UI.
  • Release Publishing: Builds and publishes a software release artifact through a build and CI flow.
  • Test Report Export: Produces machine-readable JUnit test reports for consumption by CI systems.
  • Testing: Running the test suites including the Mantine UI tests.

Silence Management

Creating, querying, updating, expiring, importing and exporting alert silences with their lifecycle states.

  • Silence Creation: Clients can create a new silence by posting a silence payload to the silences endpoint.
  • Silence Deletion: Deletes a silence by identifier via the alertmanager API, with configurable context, HTTP client, and timeout.
  • Silence Expiration: Expires or clears configured silences, optionally scoped to specific IDs, via a command.
  • Silence Import: Users can bulk import silences via a command with configurable file, force, and worker options.
  • Silence Import and Export: Import and export silences as structured data.
  • Silence Maintenance: Background processing that keeps active silences up to date, including periodic garbage collection of expired silences after their duration elapses.
  • Silence Management: Create, retrieve, update, and delete alert silences through the API, including filtering and sorting of silence lists.
  • Silence Management API: Allows listing existing silences and creating new ones through the OpenAPI by converting between proto and API forms.
  • Silence Merge: Merges silences from multiple sources so that duplicated or updated silence definitions are reconciled into a single set.
  • Silence Payload Validation: Submitted silences are validated for correctness before being accepted, with structured error responses on failure.
  • Silence Query: Retrieves silence data from a remote endpoint and decodes it into typed response results.
  • Silence Querying: Retrieving silences filtered by matchers, identifiers, state, and time window.
  • Silence Retrieval: Clients can construct and issue a request to fetch a specific silence by its identifier, with configurable HTTP client, context, and timeout.
  • Silence State Management: Track and transition silences through pending, active, and expired lifecycle states over time.
  • Silence Status Lifecycle: Tracks and transitions a silence through pending, active, and expired states, validating state and enum values.
  • Silence Update: Allows a user to update an existing silence, specifying the affected alert IDs and a new quiet time window via start, end, or duration.
  • Silence Validation: Validate a silence's fields and context before it is accepted.

Alert and Silence User Interface

Browser-based views for listing, filtering, grouping, viewing and managing alerts and silences.

  • Alert Display: Rendering alerts as human-readable strings for users and clients.
  • Alert Filtering: Tab-based filtering of the alert list through a filter bar and tab selection.
  • Alert Grouping Display: Retrieve aggregated alert groups for display to users.
  • Alert List Display: Users can view a list of active alerts at the alerts route, with filtering and expand/collapse controls.
  • Alert State Toggling: User controls to toggle inhibited, muted, and silenced alert display states.
  • Alert Status Indicators: Displays status icons indicating whether alerts are inhibited or muted.
  • Expand All Alerts: A control to expand or collapse all alert entries at once.
  • Filter Bar: Users can filter the displayed information through a filter bar interface.
  • Navigation Bar: A user-facing navigation bar that presents a set of tabs, allowing users to switch between application views such as alerts, silences, status, help, and settings.
  • Receiver Bar Dropdown: A receiver bar UI component that presents a dropdown list of receivers for the user to view and select.
  • Receiver Selection: Allows a user to view, search, and select a receiver from a receiver bar dropdown.
  • Silence Form Creation: Users create and preview a silence with date/time, matchers, annotations, and action buttons in a form view.
  • Silence Form Editing: Users can create and edit silences through a form that initializes, validates, and converts between form state and silence objects.
  • Silence List Display: Users can view a list of configured silences.
  • Silence View: Displays silence editing and expiry controls to the user.
  • Tab Navigation: Renders tabbed navigation for switching between views.

Command-Line Interface

CLI entrypoint, commands and inspection tools for operating Alertmanager and amtool.

  • Alert Creation: Users can add a new alert by supplying an alert definition through a dedicated command.
  • Alert Formatting: Formats alertmanager alert data into a human-readable or machine-readable output representation.
  • Alert Management: Defines, stores, and manipulates alerts including their timeout and update metadata as a slice.
  • Alert Marker Management: Users can create new alert markers and remove them to flag or clear specific points of interest.
  • Alert Querying: Query alerts from Alertmanager and display parsed results.
  • Alertmanager CLI Execution: Command-line entrypoint that loads configuration and dispatches alertmanager commands.
  • Check Configuration: Allows users to define and manage the configuration that controls how checks are performed via a CLI command.
  • Config Formatting: Formats alertmanager configuration into a displayable output.
  • Configuration Inspection: Users can query current configuration settings and access configuration help through the CLI.
  • Route Inspection and Testing: Show and test Alertmanager routing configuration for labels.
  • Routing Show: Display the configured routing tree in a tree form so operators can inspect how routes resolve.
  • Routing Test: A command that lets an operator test and visualize how alerts are routed to receivers by printing the matching routing tree.
  • Silence Command Configuration: A CLI capability that lets users configure a silence command, enabling them to manage silencing behavior through the command-line interface.
  • Silence Management: Create, retrieve, update, and delete alert silences through the API, including filtering and sorting of silence lists.
  • Silences Formatting: Formats alertmanager silences into a displayable output.
  • Version Reporting: Capability to report the tool version to the user.

Matchers, Labels and Filtering

Parsing, serializing and evaluating label matchers, filters and selectors used to target alerts and silences.

  • API Filter Conversion: A capability to translate filters between the internal representation and the API matcher format.
  • Alert Matcher: A matcher capability for defining and evaluating alert matching conditions, with JSON serialization and string representation for persistence and display.
  • Filter Definition: A capability to define and represent a filter as a structured set of matchers and groups that can be constructed, examined, and manipulated programmatically.
  • Filter Parsing: Parse a textual filter expression into a structured Filter representation.
  • Filter Serialization: Convert a structured Filter back into its textual representation.
  • Label Matcher Configuration: Define label matching criteria (equality, inequality, regexp, non-regexp) that can be parsed from and serialized to configuration and representation formats.
  • Label Matcher Parsing: Parses label matchers expressed in multiple syntaxes (classic, UTF-8, fallback) into structured matcher objects.
  • Label Matching: Matches labels such as format or field names against user-supplied input patterns.
  • Label Name Validation: Validates whether a label name is well-formed, including classic and UTF-8 label name rules.
  • Label Validation: Validates labels on the receiver, including per-label checks and context-aware label validation.
  • Matcher Expression Parsing: Parses matcher expressions consisting of matchers grouped in brace-delimited, comma-separated lists, rejecting malformed input with specific errors.
  • Matcher Filtering: Filter silences using label matchers.
  • Matcher Set Management: Manage an ordered collection of matchers supporting comparison, equality checks, ordering, matching, and serialization as a unit.
  • Matcher-Based Query Filtering: Filtering queries by label and prototype matchers to select which alerts or silences are returned.
  • Matcher-Based Routing: Routing of alerts to receivers based on equal/not-equal/regexp matcher sets.
  • Regexp Matcher Types: Express matchers as equal, not-equal, regexp, or not-regexp comparisons over alert labels.

Observability, Metrics and Tracing

Exporting operational metrics and distributed traces for the system and its processing pipelines.

  • Alert Processing Tracing: Emits tracing spans across alert processing so operators can observe the end-to-end handling of alerts.
  • Alertmanager Cluster Health Alerting: Prometheus alerting rules that detect Alertmanager cluster availability, peer, and configuration problems and emit categorized alerts.
  • Alertmanager Notification Delivery Alerting: Alerting rules that flag when Alertmanager fails to send alerts, ensuring notification delivery problems are surfaced.
  • Distributed Tracing: Emits tracing spans for alert-processing operations to external observability backends.
  • HTTP Request Instrumentation: Instrument HTTP handlers to record request duration and response size per request via a shared metrics structure.
  • Metrics Collection: Provides metrics structures and initialization for observing notification activity.
  • Metrics Initialization: Construct and initialize the metrics container used for observability and instrumentation.
  • Metrics Registration: The server registers runtime metrics with external monitoring systems through a registerer and flagger.
  • Observability Metrics and Tracing: Exposes operational metrics and distributed tracing for monitoring.
  • Query Metrics: Tracks query execution volume, duration, errors, and scanned/skipped message counts for the matcher.
  • Request Instrumentation and Metrics: Records per-request duration and in-flight activity to provide observability of served requests.
  • Silence Metrics: Tracks and exposes metrics about matcher silences in their active, pending, and expired states.
  • Span Recording: Records span lifecycle events and their errors so execution spans can be captured and correlated with error records.
  • Tracer Provider Lifecycle Management: Install, reinstall, and uninstall tracer providers at runtime, including TLS configuration and clean shutdown.
  • Tracing Configuration: Users can configure tracing clients including gRPC/HTTP clients, endpoints, headers, TLS, timeouts, and sampling, loaded from YAML.
  • Tracing Lifecycle Management: Enables starting, stopping, and gracefully shutting down the tracing subsystem.

Alert and Silence Data Model

Structured alert, group, receiver and silence entities with their serialization, encoding and validation.

  • Alert Data Model: A structured alert entity carrying labels, a generator/source URL, and other identifying metadata that users and downstream systems observe or trigger.
  • Alert Decoding: Deserialize an incoming PostableAlert payload back into a PostableAlert data structure.
  • Alert Encoding: Serialize a PostableAlert into the wire format, using its labels, annotations, start/end times, and generator URL.
  • Alert Encoding/Decoding: Serialization and deserialization of alert data to and from its wire representation.
  • Alert Group Decoding: Decodes serialized data back into alert group structures for consumption by the system.
  • Alert Group Encoding: Encodes alert group data into a serialized representation for transport or storage.
  • Alert Group Model: A protobuf-defined data model describing an alert grouping entry with group identity, receiver, and a set of firing, resolved, and muted alerts.
  • Alert Serialization: Encodes and decodes alert data structures to and from their binary wire representation for transport or storage.
  • Alert State Serialization: Encodes and decodes alert state values to and from a serialized representation so alert status can be stored or transmitted and restored.
  • Mesh Entry Model: A protobuf-defined mesh entry carrying an index, timestamp, value, and optional expiration time.
  • Receiver Model: A protobuf-defined receiver entity exposing its data payload and resolution state.
  • Silence Binary Serialization: Encodes and decodes a Silence to and from its binary wire representation for transport or persistence.
  • Silence Conversion: Convert silences between internal and mesh representations.
  • Silence Payload Construction: Silence objects are constructed from matchers, comments, and timing for submission.
  • Silence Serialization: Encode and decode a silence to and from JSON and binary representations.

Alert and Silence HTTP API

HTTP endpoints and typed clients for retrieving and posting alerts, alert groups, receivers and silences.

  • API v2 REST Client: A generated API client and models for interacting with the v2 REST API.
  • Alert Groups Retrieval: Capability to request and retrieve alert groups using a parameterized query object.
  • Alert Retrieval API: Exposes alerts over the OpenAPI by converting internal alerts to their API representation and back.
  • Alertmanager API Registration: Registers Alertmanager v2 API endpoints for alerts and silences into the HTTP router, including deprecation routing for legacy paths.
  • Alertmanager Client Configuration: Allows users to construct and configure an HTTP client for the Alertmanager API, including host, base path, URL schemes, and transport.
  • Alertmanager Client Connection: Constructs a client to connect to an Alertmanager server using its URL and timeout.
  • Get Alerts: Retrieve alerts through a client that decodes typed success and error responses.
  • Get Receivers: A capability to query receivers from an API, with configurable parameters such as receiver matchers.
  • Get Silences API: An HTTP endpoint capability that retrieves silences and returns typed success or error responses with payloads.
  • HTTP API Client: Provides outbound HTTP request capability with convenience methods for GET and POST calls to a remote backend.
  • Post Alerts: Exposes an HTTP endpoint that serves post alerts to clients via a dedicated handler.
  • Post Silences: Create and register silences via an HTTP handler that validates and stores silence definitions.
  • Receivers Listing: A capability to fetch and serve a list of receivers over HTTP.
  • Receivers Retrieval: Exposes an API capability to fetch receivers, returning a typed success payload or a bad-request response that clients can read.
  • Silences Retrieval: Fetches silences from the API and returns a typed response that exposes the response payload and status classification.

Alertmanager Clustering and High Availability

Cluster membership, gossip, peer messaging and state synchronization across Alertmanager instances.

  • Advertise Address Discovery: Determines and exposes the node's advertise address (private or public) for cluster communication by probing available IP lookup functions.
  • Alertmanager Clustering: Multiple Alertmanager instances form a cluster to provide high availability.
  • Cluster Join: Allows a node to join a cluster and register itself with peers.
  • Cluster Leave: Allows a node to leave a cluster and notify peers of its departure.
  • Cluster Membership Discovery: Discovering and reporting the membership and address of a cluster for clients.
  • Cluster Membership Notifications: Notifies peers when nodes join, leave, or are detected alive in the cluster.
  • Cluster Readiness: Reports when the cluster is ready and settled for use by callers.
  • Cluster State Synchronization: Represents and shares the full cluster state composed of member parts for nodes to observe and sync on.
  • Clustering and Peer Gossip: Nodes form a cluster, advertise and bind cluster addresses, and maintain peer connectivity through gossip and push/pull intervals.
  • Failure Recovery and Reconnect: Detects failed peers and reconnects the node to the cluster.
  • Memberlist Message Transport: Encodes and exchanges memberlist cluster messages (packets and streams) with a kind, key, version, address, and payload parts.
  • Message Gossip Propagation: A capability that lets clients broadcast messages through a cluster via channel-based gossip, including handling of oversized messages.
  • Peer Discovery: Resolves and tracks the set of peer addresses belonging to the cluster.
  • Peer Messaging and Broadcast: Sends messages and gossip broadcasts between cluster peers.
  • State Synchronization: Merges remote node state into local state to keep the cluster's view consistent.

Event Recording and Outputs

Recording, serializing and delivering system and alert events to configurable outputs like files, stdout, Kafka and webhooks.

  • Alert Event Recording: Records and constructs alert events with types, labels, annotations, and fingerprints for downstream consumption.
  • Batched Event Delivery: Groups events into batches flushed by size or time interval and delivers them via background workers.
  • Event Delivery: Marshal and transport queued events to a destination through a background send loop.
  • Event Recording: Capture and dispatch events through an event recorder that forwards them to configured outputs.
  • Event Recording and Retention: Records events and enforces retention for stored history.
  • Event Serialization: Serializes events for transport while tracking serialization errors.
  • File Event Logging: Write recorded events out to a file, with the ability to reopen and continue appending so event data is captured on disk across restarts.
  • File-Based Event Recording: A capability to record events to a file output, supporting configuration via YAML, sending events, and lifecycle management such as closing and reopening after rename or removal.
  • Kafka Event Output: Publishes events to a Kafka topic using configurable brokers, topic, client identity, compression, TLS, buffer size, and message format.
  • Kafka Event Recording: Records serialized events to Kafka with instrumentation of recorded, written, and dropped events.
  • Output Configuration: Configuration of named output sinks (stdout, file, Kafka, webhook) with identifiers and validation.
  • Output Identification: Identifies and names recorder outputs so each destination can be distinguished.
  • Stdout Event Output: A destination that writes recorded events to standard output for direct observation.
  • Webhook Batching: Batches queued events by count and encoded size, flushing on interval or close.
  • Webhook Event Delivery: Delivers events to a configured webhook endpoint, including batched sending and retry-on-failure behavior.

Server and Network Lifecycle

Starting, serving and gracefully shutting down HTTP/RPC/gRPC servers and network listeners.

  • Application Lifecycle Management: Start, stop, and reload an application instance with lifecycle notifications and cleanup error aggregation.
  • Connect/gRPC API Server: Exposes an HTTP/Connect protocol server that handles gRPC and Connect requests with configurable timeouts and body size limits.
  • Connection Acceptance: Accepts incoming connections on listeners and hands them off for handling.
  • Graceful Server Shutdown: Allows the running API server to be shut down cleanly on demand.
  • Graceful Shutdown: Drain in-flight RPCs and stop accepting new work on server shutdown.
  • HTTP API Endpoints: The server exposes HTTP APIs under a configurable route prefix with a custom CORS handler and optional TLS.
  • HTTP Server Hosting: Serve an application's API over HTTP by configuring listeners and running the server.
  • HTTP Server Lifecycle Management: Start, serve, and stop a networked HTTP server, including graceful shutdown within a configured timeout.
  • Listener Lifecycle Management: Starts, tracks readiness of, and stops listeners across their lifetime.
  • Multi-Listener Network Binding: Binds and serves multiple network listeners (TCP and vsock) concurrently, cleaning up partially bound listeners on failure and surfacing readiness errors.
  • Packet Transport: Sends and receives network packets over a transport with configurable bind address/port and advertised address, supporting TLS configuration.
  • RPC Service Serving: Serve registered RPC procedures over the wire, dispatching unary and streaming requests to handlers.
  • Service Shutdown: Enables users to stop the service or dispatcher gracefully.
  • Stream Transport: Accepts, registers, and services inbound stream connections on a listener channel.
  • Worker Wake Signaling: Wakes the background worker on demand and signals it to stop, coordinating worker activity with the service lifecycle.

Configuration Management

Loading, validating, serializing and hot-reloading Alertmanager and per-integration configuration.

  • Alert Validation: Validates alert definitions, ensuring the generator URL and label sets conform to required constraints before use.
  • Alertmanager Config Encoding/Decoding: Encode and decode Alertmanager configuration data so it can be serialized into and restored from a transportable representation.
  • Alertmanager Config Validation: Validates an AlertmanagerConfig, including its original (pre-normalized) form, before it is accepted for use.
  • Alertmanager Configuration: Reading and applying Alertmanager configuration including receivers and matchers.
  • Application Configuration: Load application configuration for cluster mode, inhibition rules, integrations, and receivers.
  • Config Display: Shows the active configuration to the user.
  • Config Validation: A test/verification capability that checks configuration and reports whether it is valid, usable by a user via the CLI.
  • Configuration File Parsing: Loads and parses a configuration template file into an application configuration structure.
  • Configuration Loading: Load and parse alerting configuration from files or data, resolving file paths and templating.
  • Configuration Reload: Allows users to trigger a reload of the running configuration at runtime.
  • Configuration Serialization: Serialize and deserialize regexp-matching configuration to and from JSON and YAML formats.
  • Hot Configuration Reload: Reloads configuration at runtime, atomically swapping components while preserving previous state on error and supporting a nil-safe stop.
  • Routing Configuration: Configure routing from a user-supplied config file, converting routes into a tree and resolving receivers.
  • Runtime Configuration Reload: The system can reload its configuration at runtime without a restart, exposing reloading/reloaded lifecycle states and a reload entry point.

HTTP Request Handling Pipeline

Routing, middleware, validation, content negotiation and response handling for inbound API requests.

  • API Handler Registration: Register and retrieve the API handler that the server delegates requests to.
  • API Response Handling: Transforms and unwraps API responses and surfaces errors into a usable form for consumers.
  • CORS Handling: Applies cross-origin resource sharing policy to incoming API requests.
  • Content Negotiation: Select request and response media types based on registered formats, producers, and consumers.
  • Error Response Handling: Produce and format error responses returned to API clients.
  • HTTP Request Handling: Registers and serves HTTP endpoints for incoming requests.
  • HTTP Response Writing: A capability to write status, headers, and body to an HTTP response and flush it to the client.
  • Middleware Pipeline: Compose request-processing middleware such as authorization and validation around handlers.
  • Middleware Processing: A capability that processes requests through middleware, likely invoking or coordinating middleware functions.
  • Request Binding: A capability that binds an incoming HTTP request into a structured request object for downstream handling.
  • Request Concurrency Limiting: Limits the number of in-flight requests across unary and streaming endpoints to protect the server from overload.
  • Request Routing and Handling: Match incoming requests to registered handlers and dispatch them through the API.
  • Request Validation: Validate incoming requests before they are handled.
  • Response Compression Negotiation: Selects a content encoding (brotli, gzip, or none) and decompresses content for delivery to clients.

State Store and Persistence

Persistent storage, snapshotting, compaction and lifecycle management of alerts, silences and cluster state.

  • Alert Garbage Collection: Resolved and stale alerts are garbage collected within a configurable interval window.
  • Alert Lifecycle Management: Storing, retrieving, deleting, and garbage-collecting alerts in a persistent alert store.
  • Alert Storage: A keyed store for alerts that supports adding, retrieving, listing, and counting alert entries.
  • Alert Storage and Retrieval: Storing, deleting, garbage-collecting, and retrieving pending alerts with enforced limits.
  • Background Garbage Collection: A background loop that periodically reclaims expired items and listeners.
  • Bucket Upsert: Insert or update entries in a bucket, including handling concurrency, stale/expired entries, and edge cases.
  • Cache Entry Creation: Creates a new cache entry to be stored in the cache.
  • Cache Entry Retrieval: Retrieves a stored cache entry by key.
  • Cache Expiry Detection: A capability to determine whether a cached entry has become stale and to refresh it on access.
  • Data Storage Directory: Persistent data is stored in a configurable data directory with a sensible default.
  • Silence State Persistence: Persists and restores silence definitions, including binary marshalling and post-unmarshal normalization, so silences survive across restarts.
  • State Persistence: Encoding, decoding, and merging of persisted state with error handling for corrupt data.
  • State Snapshot Save/Load: Serialization and restoration of store state to and from a durable snapshot representation.
  • State Store Persistence: A persistent key-value store that users can open, query, snapshot, and compact on disk.

Web UI Application Shell

The embedded web application including routing, navigation, settings, status views and asset serving.

  • Calendar Display: Displays a calendar grid of days and weeks with start/end/mouseover/this-month highlighting classes.
  • Date Time Picker: An interactive calendar picker that lets users navigate months, select a day, enter hour/minute inputs, and choose start and end date/time values.
  • Embedded Web UI Serving: The service serves embedded static web assets (including index pages and prefix-mounted assets) for the UI.
  • Loading Indicator: Displays a loading state while content or data is being prepared.
  • Mantine App Serving: The service serves the Mantine-based web application, including client-side hash routing and redirects.
  • Navigation Bar Display: Renders a navigation bar with its items so users can see and access top-level destinations.
  • Navigation and Routing: The application routes users between internal views, external URLs, and a not-found page.
  • Not Found Page: Renders a not-found view to surface a missing-resource page to users.
  • Settings Management: Users can view and update application settings.
  • Settings View: Renders the settings screen with a configurable model and radio-selection input backed by a checked/radio value.
  • Static Asset Serving: Serves static files and UI assets to clients.
  • Tabbed Navigation: Provides tab-based navigation between sub-views within the silence list interface.
  • UI Initialization: Initializes the user interface by setting up initial state and wiring for the application.
  • View Rendering: Renders the current view for display by resolving the present view and its presentation.

Alert Notification Delivery

Delivery of alert notifications to receivers and integrations with templating, batching, retry and truncation.

  • Alert Notification: Delivers notifications for grouped and resolved alerts based on alert details and notification reasons.
  • Alert Notification Batching: Groups firing and resolved alerts by receiver and group metadata into mesh entries for delivery.
  • Alert Notification Delivery: Sends formatted alert notifications and renders their payloads to a configured notifier.
  • Alert Notification Templating: Produce provider-specific alert notification payloads (titles, messages, descriptions, subjects) from templates for each delivery channel.
  • Alert Payload Truncation: Trimming alert payloads and labels to size limits before delivery, with error detail handling.
  • Alert Truncation: Truncates oversized alert batches to fit within payload limits.
  • Notification Delivery: Alerts are delivered to configured receivers through a notification function.
  • Notification Delivery Retry: Retries failed push notification deliveries to improve reliability of message delivery.
  • Notification Dispatch: Delivers notifications to recipients, including resolving and notifying on alert resolution events.
  • Notification Receiver Definition: Define named receivers that group the integrations used to deliver notifications.
  • Notification Receiver Grouping: Grouping and routing of notification receivers with configurable intervals and wait times to determine which receivers get notified for a given route.
  • Notification Receiver Integrations: Delivers alerts through configured channels such as Slack, OpsGenie, VictorOps, Pushover, and email.
  • Notification Templating: Renders user-facing notification content using named templates for delivery through receivers.

Cluster and Service Status Reporting

Exposing cluster, peer, build, version and overall service status to users and monitoring systems.

  • Alertmanager Status: Expose build and runtime status information via a status endpoint.
  • Build and Version Information: Reports build and runtime version details including version number, Go version, build date, and build user.
  • Cluster Status Display: A user can view the current status of the cluster.
  • Cluster Status Reporting: Exposes cluster status information to users through an API endpoint backed by cluster state snapshotting.
  • Cluster Status View: Exposing the Alertmanager cluster and peer status along with version information.
  • Node Identity and Uptime: Reports node identity and liveness metadata such as name, address, branch, revision, config, and uptime.
  • Peer Status Reporting: Reporting of individual peer instances, including their address, name, and state.
  • Service Status Reporting: Exposes the current status of a service as a capability that users or systems can query.
  • Status Query: Clients can request the current status from a remote StatusService over RPC and receive the resulting status value.
  • Status Reporting: Report the current status of the alerting system and its peers and collectors.
  • Status View: Users can view the overall system status page.
  • Version Info Display: Build and runtime version information (version, revision, build date/user, Go version) is assembled and presented to the user.
  • Version Reporting: Capability to report the tool version to the user.

TLS and Secure Transport

Configuring and establishing TLS for inbound servers, outbound clients and cluster transports.

  • Authenticated API Client Setup: Configure an API client with basic auth or bearer token credentials.
  • Basic Authentication: Authenticate a user by supplying a username and password credential pair.
  • HTTPS/TLS Server Hosting: Serve an application's API over HTTPS with TLS certificates.
  • Packet Transport: Sends and receives network packets over a transport with configurable bind address/port and advertised address, supporting TLS configuration.
  • Request Authorization: Authenticate and authorize incoming API requests using configured authenticators.
  • TLS Client Configuration: Allows configuring TLS client-side credentials and trust settings such as client certificates, private keys, and CA files for secure outbound connections.
  • TLS Configuration: Users can configure TLS client and server settings including certificates, keys, CA files, and client authentication type.
  • TLS Connection Establishment: Establishes and manages a TLS-wrapped network connection, including dialing, handshaking, and tracking its live state.
  • TLS Connection Read/Write: Read and write data over a TLS connection with access to connection metadata.
  • TLS Server Configuration: Allows configuring server-side TLS termination including server certificates, client authentication type, and the client CA file for verifying peers.
  • TLS Transport Configuration Retrieval: Provide TLS transport configuration (client and server settings) for secure connections.
  • TLS Transport Setup: Enables establishing a secure TLS-based transport connection using loaded TLS configuration.
  • User Authentication: Authenticates users via a login flow that collects credentials and verifies them against a secret.

Notification and Event Streaming

Streaming alert lifecycle events, broadcasts and updates to subscribed consumers.

  • Alert Event Streaming: Emit and consume lifecycle events for alerts being created, grouped, and resolved.
  • Alert Lifecycle Events: Stream of events emitted when alerts are created, grouped, or resolved.
  • Alert Lifecycle Notifications: Alerts are converted into notification events covering creation, grouping, and resolution states.
  • Alert Subscription: Subscribing consumers to receive new alerts as they arrive.
  • Broadcast Retrieval: Retrieves current broadcasts so peers can observe cluster-wide messages.
  • Channel Broadcast: Broadcast messages to channel peers while handling oversized messages via gossip.
  • Event Recording: Capture and dispatch events through an event recorder that forwards them to configured outputs.
  • Inhibition Muting Events: Inhibition rules cause alerts to be muted, producing inhibition-muted alert events.
  • Message Gossip Propagation: A capability that lets clients broadcast messages through a cluster via channel-based gossip, including handling of oversized messages.
  • Muted Alert Notifications: Emit events when alerts are muted by silences so downstream consumers observe suppression.
  • Silence Change Events: Silence creation, update, and muting actions produce events describing the affected alerts.
  • Subscriber Notification: Delivers notifications to registered subscribers when events occur.

Incident and Issue Management Integration

Creating and managing tickets and incidents in Jira, Incident.io and other IMS platforms from alerts.

  • Error Receiver Integration: Builds and registers receiver integrations so users can capture and route errors to their configured destinations.
  • Incident Management Integration: Emit alerts into incident and on-call platforms such as PagerDuty, Opsgenie, VictorOps, and Jira with hooks for incident lifecycle fields.
  • Incident Notification Dispatch: Sending incident notifications to configured endpoints with retry handling, redacted URLs, and templated or file-sourced metadata.
  • Incident.io Alert Ingestion Configuration: Provides user-configurable settings for ingesting alerts into Incident.io, including source tokens, endpoint URL, HTTP behavior, timeouts, and alert volume limits.
  • Issue Retrieval: Retrieve a single Jira issue's fields including key, summary, description, status, priority, resolution, labels, and project.
  • Issue Search: Search and retrieve Jira issues by JQL query with paging, returning matching issues and metadata.
  • Issue Transitions: View available workflow transitions for an issue and apply a transition to change its status.
  • Jira Issue Creation: Create Jira issues by preparing and validating an issue request body with description templating.
  • Jira Issue Search: Search for existing Jira issues using a prepared search request against the Jira API.
  • Jira Issue Transition: Move a Jira issue to a new workflow status by resolving a transition and submitting the request.
  • Jira Notifications: Send notifications to Jira with priority handling and retry behaviour.
03 · Size

What was analyzed

  • Go · 418 files · 76,285 lines
  • JSON · 16 files · 8,056 lines
  • Elm · 94 files · 6,410 lines
  • Markdown · 26 files · 4,461 lines
  • YAML · 92 files · 2,428 lines
  • TypeScript · 29 files · 1,190 lines
  • HTML · 3 files · 372 lines
  • Protocol Buffers · 5 files · 274 lines
  • CSS · 4 files · 235 lines
  • make · 6 files · 225 lines
  • JavaScript · 6 files · 166 lines
  • Other (6 languages) · 10 files · 149 lines

Whole repository: 766 files. cloc 2.06 counts 100,251 lines of code in 709 of them (129,968 lines with comments and blanks).

04 · Source

Where this came from

Extracted by CoreStory V3 (build 4470 with two small engine fixes) using DeepSeek-V4.1-Flash from the public repository at commit b6c5821 on 2026-11-13. Capability descriptions are from the same run.

Code excerpts are from the upstream repository and remain under its Apache-2.0 license. CoreStory is not affiliated with or endorsed by the Prometheus project.

Want this for your own codebase?

Talk to us about mapping the business rules in your repositories.

Talk to an expert