Skip to content

Alert Caching Time Interval Override does not work if the alert payload has time-stamp key #1822

@danialahmed97

Description

@danialahmed97

Describe the bug
When we try to override the default alert caching interval of 2 hours using the env variable

runner: additional_env_vars: - name: PROCESSED_ALERTS_CACHE_TTL value: "1"

It does not work if the alert payload has a "starts_at" timestamp. But it works for the payload that does not have a time-stamp.

To Reproduce
Firstly, from inside the robusta-runner pod hit the below command 3 times. You will notice that it will be sent only once despite the Cache duration overriding.

curl -X POST http://localhost:5000/api/trigger -H 'Content-Type: application/json' -d '{"action_name": "prometheus_alert", "action_params": {"alert_name": "KubePodNone", "pod_name": "crashpod", "starts_at": "2025-05-18 16:44:15.084", "fingerprint": "1234"}}'

Next, hit a different payload without time-stamp 3 times and it works.

curl -X POST http://localhost:5000/api/trigger -H 'Content-Type: application/json' -d '{"action_name": "prometheus_alert", "action_params": {"alert_name": "KubePodNone", "pod_name": "crashpod"}}'

Expected behavior
It should be overriding the cache interval even in case of alert payloads with time-stamps

Screenshots

With timestamp logs output :
Image

Without timestamp logs output:
Image

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions