Only "1" appears in localhost:3001/metrics > monika_probe_result. #1326
-
Creating an API monitoring system using monika. The API failed intentionally, but on http://localhost:3001/metrics, If it fails, what can I do to get "0" exposed? here is my monika.yml: probes:
- id: '4'
name: name
interval: 60 # in seconds
requests:
- method: PATCH
url: {url}
timeout: 7000 # in milliseconds
saveBody: true
headers:
Authorization: {Authorization}
Content-Type: application/json
body:
name : name
followRedirects: 1
incidentThreshold: 3
alerts:
- assertions: response.status != 204
message: Status not 204 ![]() |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
hi @sapiderman |
Beta Was this translation helpful? Give feedback.
-
@Sanitater941 thanks for the additional info. Looking into it now. |
Beta Was this translation helpful? Give feedback.
-
I've finally got round to trying it out, so far everything checks out. What is the http response or status code from your PATCH to your url/API? Does the PATCH request fail immediately? a 401 or 404? Did you get the "status not 204" alert? I'm using this setup (similar to yours). probes:
- id: 'http-1'
name: 'status-401-test'
requests:
- url: https://httpbin.org/status/401
method: PATCH
alerts:
- assertion: response.status < 200 or response.status > 308
message: HTTP Status is not 200
- assertion: response.ime > 2000
message: Too sloow Here's my localhost:3001/metrics Are you able to get the same result the above config yaml? |
Beta Was this translation helpful? Give feedback.
@Sanitater941 Hi,
It's been a month. I just want to tell you the PR has been merged.
You can try using the latest version of Monika and this Dashboard:
https://github.com/dennypradipta/monika-dashboard
Thank you