Skip to content

Alert in Firing State after "FOR" period increased in config #18243

Description

@Ketan-Goyal

What did you do?

Steps to Reproduce:

  • Run Prometheus with a config file and a alert rule with short FOR period as shown below
  • wait for the alert to fire
  • Increase the for period of the alert in the same file and trigger config reload on Prometheus
  • The alert now shows the increased FOR period but doesn't go back to pending but remains in FIRING State

attaching a bash script for the same and my alert config file

echo "groups:
  - name: test-rule
    rules:
      - alert: test-rule
        annotations:
          description: Test rule
          summary: Test rule
        expr: >
          up == 1
        for: 15s
        labels:
          severity: info
          team: test" > documentation/examples/first_rules.yml
./prometheus --config.file=documentation/examples/prometheus.yml  --web.enable-lifecycle > prometheus.log 2>&1 &
for i in {1..40}; do printf "\rWaiting: %ds" "$i"; sleep 1; done; echo
sed -i '' 's/for: 15s/for: 1h/' documentation/examples/first_rules.yml
curl -X POST http://localhost:9090/-/reload
for i in {1..15}; do printf "\rWaiting: %ds" "$i"; sleep 1; done; echo
curl http://localhost:9090/api/v1/alerts

What did you expect to see?

Expected behavior is to get the alert back to pending state when the FOR duration is increased enough that the alert shouldnt be firing..

What did you see instead? Under which circumstances?

alert is still in firing after updating the For Duration in config file and the change is visible in the details of alert though.

{
    "status": "success",
    "data": {
        "alerts": [
            {
                "labels": {
                    "alertname": "test-rule",
                    "app": "prometheus",
                    "instance": "localhost:9090",
                    "job": "prometheus",
                    "severity": "info",
                    "team": "test"
                },
                "annotations": {
                    "description": "Test rule",
                    "summary": "Test rule"
                },
                "state": "firing",
                "activeAt": "2026-03-06T00:02:06.787126409Z",
                "value": "1e+00"
            }
        ]
    }
}         

System information

Darwin 25.3.0 arm64

Prometheus version

./prometheus --version
prometheus, version 3.10.0 (branch: heads/ketan, revision: cddac4d3df25dcbcc990d4748403c6c5dafe23a9)
  build user:       [email protected]
  build date:       20260305-23:58:50
  go version:       go1.25.0
  platform:         darwin/arm64
  tags:             netgo,builtinassets

Prometheus configuration file

# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ["localhost:9090"]
       # The label name is added as a label `label_name=<label_value>` to any timeseries scraped from this config.
        labels:
          app: "prometheus"

Alertmanager version


Alertmanager configuration file

Logs


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions