Skip to main content

GET /api/sam/alerts/

Get alerts

Description

This method returns all the alerts SAM has collected from Prometheus and InterSystems IRIS® data platform.

Request Example

GET http://localhost:8080/api/sam/alerts/

Parameters
cluster Optional query parameter. Only return alerts from the cluster with the specified id. Cannot be combined with target.
target Optional query parameter. Only return alerts from the instance with the specified id. Cannot be combined with cluster.
count Optional query parameter. Only return the specified number of alerts. Returns most recently reported alerts first. Cannot be combined with timestamp or state.
timestamp Optional query parameter. Only return alerts that were reported after the specified ISO 8601 UTC timestamp. Cannot be combined with count or state
state Optional query parameter. Filters alerts that factor into the system state calculation. Cannot be combined with count or timestamp

This endpoint supports several query parameters to filter the results. For example:

GET http://localhost:8080/api/sam/alerts/?target=2

GET http://localhost:8080/api/sam/alerts/?timestamp=2020-01-07T19:20:21.434Z:

Response Example

The response is a JSON array of JSON objects for each alert, which contains the alert name, instance, severity, description, first reported timestamp, last reported timestamp and quantity reported. For example:

[
    {
        "instance": "172.16.6.9:80",
        "name": "iris_phys_mem_per_cent_used",
        "severity": "warning",
        "instanceid": 1,
        "description": "Warning: iris_phys_mem_per_cent_used = 96 (warning threshold is 90).",
        "quantity": 2,
        "clustername": "test",
        "clusterid": 1
        "firstreported": "2020-03-16T14:09:51.873Z",
        "lastreported": "2020-03-16T14:13:53.823Z",
    },
    {
        "instance": "172.16.6.9:80",
        "name": "iris_cpu_usage",
        "severity": "critical",
        "instanceid": 1,
        "description": "Critical: iris_cpu_usage = 98 (critical threshold is 95)",
        "quantity": 3,
        "clustername": "test",
        "clusterid": 1,
        "firstreported": "2020-03-16T14:09:51.873Z",
        "lastreported": "2020-03-16T14:11:21.872Z"
    }
]
FeedbackOpens in a new tab