my requirement is to get the alerts if for any ser...
# support
r
my requirement is to get the alerts if for any service i will get status code <=199 or >=400 what should be the expression? I tried multiple expression for alerts but didn't get the metrics 1. http_status_code 2. status_code 3. http_status_code 4. probe_http_status_code above expressions didn't work. Kindly help me.
p
r
I don't require total http request (http_requests_total) , i need to check for http status code when error comes
s
@Rishabh Tripathi the query is invalid. It should be something like
metric_name{k=v,...}
r
can u help me with the query
s
What is the metric name you want to query?
r
this is what I tried alert: Status code(Error) expr: http_status_code <=199 and http_status_code >=400 for: 0m labels: severity: warning annotations: summary: Error coming description: "Status code <Error> VALUE = {{ $value }} LABELS = {{ $labels }}"
s
That expression is invalid. Based on my understanding it would be something like this
signoz_calls_total{http_status_code=~"[45].."}
?
r
a
@Rishabh Tripathi try out
Copy code
signoz_calls_total{http_status_code=~"4.."}
r
Thanks, It's working. But i need for specific services, it's giving for all services
a
@Rishabh Tripathi
Copy code
signoz_calls_total{service_name="YOUR_SERVICE_NAME", http_status_code=~"4.."}
r
Thanks
👍 1