0xfurai / 0xfurai/peekaping

Feature request: Push endpoint should honor status parameter to change monitor state

Đang mở
#214 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
1.2k
Fork
69
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Description:**
First of all — great work on Peekaping! I really like the UI and overall usability.
While testing the Push monitor, I noticed that the `status` and `msg` query parameters are accepted but not applied to the monitor’s state.

- The `msg` value appears in the logs.
- The `status` value (`up`, `down`, `start`) seems to be ignored.
- The check remains green as long as pings arrive within the allowed interval.

Is this the intended behavior or something still in progress?

**Expected behavior:**
Sending:
```bash
curl "https://demo.peekaping.com/api/v1/push/?status=down&msg=Manual fail"
```
should immediately mark the monitor as failed, while
```bash
curl "https://demo.peekaping.com/api/v1/push/?status=up&msg=OK"
```
should mark it as healthy again.

**Actual behavior:**
The API always returns a success response but does not modify the check state.

**API response:**
```json
{
"ok": "true"
}
```
This response is returned regardless of the `status` value. The monitor remains green until no further pings arrive and the interval times out.

**Steps to reproduce:**
1. Create a Push monitor.
2. Send one `status=up` request.
3. Send `status=down` — returns `"ok": "true"`, but the check state does not change.

**Suggestion:**
Evaluate the `status` parameter to allow explicit state changes (`up` → healthy, `down` → failed, `start` → pending).
This would make the Push endpoint compatible with heartbeat-based tools such as Healthchecks.io.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Find the push endpoint handler in the API routes, likely in a file like `api/v1/push.go`. Examine how it processes the `status` and `msg` query parameters. The logic to update a monitor's state based on the `status` parameter needs to be added. Look for existing monitor state management functions to understand the data model. Test by creating a push monitor and sending curl requests to verify the state changes.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go
Lĩnh vực
api, backend
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.