HTTP Status Codes are returned with the text equivalent #114

Open
opened 2026-02-28 01:35:22 -05:00 by deekerman · 2 comments
Owner

Originally created by @proffalken on GitHub (Aug 10, 2021).

Describe the bug

The recent introduction of monitoring HTTP status codes allows us to see what the returned code was as part of the heartbeat map:

Monitor #1 'Make Monmouth (beta)': Successful Response: 505 ms | Interval: 20 seconds | Type: http
Heartbeat {
  beanMeta: BeanMeta {
    noCache: false,
    fetchAs: '',
    alias: '',
    via: '',
    withCondition: '',
    withConditionData: []
  },
  _monitorId: 1,
  _time: '2021-08-10 06:54:18',
  _status: 1,
  _duration: 20,
  _msg: '200 - OK',
  _ping: 505,
  _important: false
}

This is great, however because the _msg returns not only the status code 200 but also the - OK response, it makes it difficult to translate this value into something useful for other monitoring systems such as Prometheus.

Expected behavior
An additional field could be added to the heartbeat so that it returns the following:

Monitor #1 'Make Monmouth (beta)': Successful Response: 505 ms | Interval: 20 seconds | Type: http
Heartbeat {
  beanMeta: BeanMeta {
    noCache: false,
    fetchAs: '',
    alias: '',
    via: '',
    withCondition: '',
    withConditionData: []
  },
  _monitorId: 1,
  _time: '2021-08-10 06:54:18',
  _status: 1,
  _duration: 20,
  _http_status: '200',
  _msg: 'OK',
  _ping: 505,
  _important: false
}

This would then allow us to track response time, current state, certificate validation details, and the HTTP return codes in the Prometheus end-point.

Originally created by @proffalken on GitHub (Aug 10, 2021). **Describe the bug** The recent introduction of monitoring HTTP status codes allows us to see what the returned code was as part of the `heartbeat` map: ``` Monitor #1 'Make Monmouth (beta)': Successful Response: 505 ms | Interval: 20 seconds | Type: http Heartbeat { beanMeta: BeanMeta { noCache: false, fetchAs: '', alias: '', via: '', withCondition: '', withConditionData: [] }, _monitorId: 1, _time: '2021-08-10 06:54:18', _status: 1, _duration: 20, _msg: '200 - OK', _ping: 505, _important: false } ``` This is great, however because the `_msg` returns not only the status code `200` but also the ` - OK` response, it makes it difficult to translate this value into something useful for other monitoring systems such as Prometheus. **Expected behavior** An additional field could be added to the `heartbeat` so that it returns the following: ``` Monitor #1 'Make Monmouth (beta)': Successful Response: 505 ms | Interval: 20 seconds | Type: http Heartbeat { beanMeta: BeanMeta { noCache: false, fetchAs: '', alias: '', via: '', withCondition: '', withConditionData: [] }, _monitorId: 1, _time: '2021-08-10 06:54:18', _status: 1, _duration: 20, _http_status: '200', _msg: 'OK', _ping: 505, _important: false } ``` This would then allow us to track response time, current state, certificate validation details, **and** the HTTP return codes in the Prometheus end-point.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2022):

We are clearing up our old issues and your ticket has been open for 6 months with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions[bot] commented on GitHub (Feb 6, 2022): We are clearing up our old issues and your ticket has been open for 6 months with no activity. Remove stale label or comment or this will be closed in 7 days.
Author
Owner

@proffalken commented on GitHub (Feb 7, 2022):

Would be good to know if there are still plans to implement this

@proffalken commented on GitHub (Feb 7, 2022): Would be good to know if there are still plans to implement this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#114
No description provided.