Hello, I'm using Prometheus API Client
<https://github.com/AICoE/prometheus-api-client-python> and getting alerts
for last 24 hours with below code
import json from prometheus_api_client
import PrometheusConnect from prometheus_api_client.utils
import parse_datetime from datetime
import timedelta
prom = PrometheusConnect(url="***prometheus-url***", disable_ssl=True)
start_time = parse_datetime("1d")
end_time = parse_datetime("now")
chunk_size = timedelta(days=1)
metric_data = prom.get_metric_range_data(
metric_name='ALERTS',
start_time=start_time,
end_time=end_time,
chunk_size=chunk_size
)
print(json.dumps(metric_data, indent=4))
The alarm list for the last 24 hours comes, but I want to find the resolved
alarms in this list. How can I do that?
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/dff266c0-6e6b-4fc0-bc63-44fa49fc4e81n%40googlegroups.com.