prometheus / prometheus/alertmanager

Feature Request: Preserve EndsAt timestamp in Webhook payloads instead of resetting to zero value

Open
#5,198 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Proposal
Description

I've noticed that Alertmanager explicitly resets the EndsAt field to a zero value (0001-01-01T00:00:00Z) when sending webhook payloads for alerts that are not yet resolved.

Technical Observation

The current logic specifically clears the EndsAt value as follows:

	for _, alert := range alerts {
		a := *alert
		// Ensure that alerts don't resolve as time move forwards.
		if a.ResolvedAt(now) {
			resolvedSlice = append(resolvedSlice, &a)
		} else {
			a.EndsAt = time.Time{}
		}
		alertsSlice = append(alertsSlice, &a)
	}
Question & Curiosity

I found that this behavior has been discussed in several previous issues:

Since these discussions have been around for a while without a change in the implementation, I’m curious if there’s a specific technical reason or a design philosophy behind keeping this as a zero value. Is this behavior intentionally maintained to avoid specific side effects that I might be overlooking? Or is there a concern that exposing this value might lead to inconsistent states in external integrations?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the webhook payload construction loop shown in the issue and read the linked discussions in issues 3351 and 3341. Determine the intended semantics for EndsAt on unresolved alerts and confirm the change does not cause alerts to resolve as time advances; done requires an agreed behavior and corresponding webhook coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.