[GH-ISSUE #371] Expose job run times history via API #285

Closed
opened 2026-02-25 23:41:53 +03:00 by kerem · 5 comments
Owner

Originally created by @mountaindude on GitHub (May 27, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/371

Similar to #349 , but not quite the same thing I believe.

I am particularly interested in run times of jobs, and would like to access this info via the API.
Basically, for a specific (or all) checks I'd like to retrieve start/end times in a JSON. And maybe the duration too, for convenience.

Originally created by @mountaindude on GitHub (May 27, 2020). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/371 Similar to #349 , but not quite the same thing I believe. I am particularly interested in run times of jobs, and would like to access this info via the API. Basically, for a specific (or all) checks I'd like to retrieve start/end times in a JSON. And maybe the duration too, for convenience.
kerem closed this issue 2026-02-25 23:41:53 +03:00
Author
Owner

@cuu508 commented on GitHub (Jun 9, 2020):

We keep a log of received pings, and show them in web UI:

image

Would exposing the same information via API suffice? Let's say, if there was

GET https://server/api/v1/checks/<uuid>/log/

endpoint, which would return (very approximately) this JSON:

[
    {
	"type": "success",
	"date": "2020-05-12T12:31:01.881509+00:00",
	"n": 7282404,
	"duration": 5.09289,
	"scheme": "http",
	"remote_addr": "127.0.0.1",
	"ua": "curl/7.68.0"
    },
    {
	"type": "start",
	"date": "2020-05-12T12:31:01.881509+00:00",
	"n": 7282403,
	"duration": null,
	"scheme": "http",
	"remote_addr": "127.0.0.1",
	"ua": "curl/7.68.0"
    },
    {
	"type": "success",
	"date": "2020-05-12T12:31:01.881509+00:00",
	"n": 7282402,
	"duration": null,
	"scheme": "http",
	"remote_addr": "127.0.0.1",
	"ua": "curl/7.68.0"
    },
    (...)
]    
<!-- gh-comment-id:641265325 --> @cuu508 commented on GitHub (Jun 9, 2020): We keep a log of received pings, and show them in web UI: ![image](https://user-images.githubusercontent.com/661859/84148255-63be7100-aa67-11ea-9db1-cf5fc36d66db.png) Would exposing the same information via API suffice? Let's say, if there was GET https://server/api/v1/checks/<uuid>/log/ endpoint, which would return (very approximately) this JSON: [ { "type": "success", "date": "2020-05-12T12:31:01.881509+00:00", "n": 7282404, "duration": 5.09289, "scheme": "http", "remote_addr": "127.0.0.1", "ua": "curl/7.68.0" }, { "type": "start", "date": "2020-05-12T12:31:01.881509+00:00", "n": 7282403, "duration": null, "scheme": "http", "remote_addr": "127.0.0.1", "ua": "curl/7.68.0" }, { "type": "success", "date": "2020-05-12T12:31:01.881509+00:00", "n": 7282402, "duration": null, "scheme": "http", "remote_addr": "127.0.0.1", "ua": "curl/7.68.0" }, (...) ]
Author
Owner

@mountaindude commented on GitHub (Jun 9, 2020):

Yeah that would be great!

The duration is available in that JSON, super userful.

On Tue, 9 Jun 2020 at 14:41, Pēteris Caune notifications@github.com wrote:

We keep a log of received pings, and show them in web UI:

[image: image]
https://user-images.githubusercontent.com/661859/84148255-63be7100-aa67-11ea-9db1-cf5fc36d66db.png

Would exposing the same information via API suffice? Let's say, if there
was

GET https://server/api/v1/checks//log/

endpoint, which would return (very approximately) this JSON:

[
{
"type": "success",
"date": "2020-05-12T12:31:01.881509+00:00",
"n": 7282404,
"duration": 5.09289,
"scheme": "http",
"remote_addr": "127.0.0.1",
"ua": "curl/7.68.0"
},
{
"type": "start",
"date": "2020-05-12T12:31:01.881509+00:00",
"n": 7282403,
"duration": null,
"scheme": "http",
"remote_addr": "127.0.0.1",
"ua": "curl/7.68.0"
},
{
"type": "success",
"date": "2020-05-12T12:31:01.881509+00:00",
"n": 7282402,
"duration": null,
"scheme": "http",
"remote_addr": "127.0.0.1",
"ua": "curl/7.68.0"
},
(...)
]


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/healthchecks/healthchecks/issues/371#issuecomment-641265325,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAH3JDXSSXYAMFXK4G5F653RVYUXTANCNFSM4NL3WWVA
.

<!-- gh-comment-id:641276414 --> @mountaindude commented on GitHub (Jun 9, 2020): Yeah that would be great! The duration is available in that JSON, super userful. On Tue, 9 Jun 2020 at 14:41, Pēteris Caune <notifications@github.com> wrote: > We keep a log of received pings, and show them in web UI: > > [image: image] > <https://user-images.githubusercontent.com/661859/84148255-63be7100-aa67-11ea-9db1-cf5fc36d66db.png> > > Would exposing the same information via API suffice? Let's say, if there > was > > GET https://server/api/v1/checks/<uuid>/log/ > > endpoint, which would return (very approximately) this JSON: > > [ > { > "type": "success", > "date": "2020-05-12T12:31:01.881509+00:00", > "n": 7282404, > "duration": 5.09289, > "scheme": "http", > "remote_addr": "127.0.0.1", > "ua": "curl/7.68.0" > }, > { > "type": "start", > "date": "2020-05-12T12:31:01.881509+00:00", > "n": 7282403, > "duration": null, > "scheme": "http", > "remote_addr": "127.0.0.1", > "ua": "curl/7.68.0" > }, > { > "type": "success", > "date": "2020-05-12T12:31:01.881509+00:00", > "n": 7282402, > "duration": null, > "scheme": "http", > "remote_addr": "127.0.0.1", > "ua": "curl/7.68.0" > }, > (...) > ] > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/healthchecks/healthchecks/issues/371#issuecomment-641265325>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAH3JDXSSXYAMFXK4G5F653RVYUXTANCNFSM4NL3WWVA> > . >
Author
Owner

@cuu508 commented on GitHub (Jun 11, 2020):

This is now implemented and deployed on https://healthchecks.io

<!-- gh-comment-id:642644092 --> @cuu508 commented on GitHub (Jun 11, 2020): This is now implemented and deployed on https://healthchecks.io
Author
Owner

@mountaindude commented on GitHub (Jun 11, 2020):

Cool!

Is the API endpoint the one you mentioned before, i.e.
GET https://server/api/v1/checks//log/ ?

<!-- gh-comment-id:642646935 --> @mountaindude commented on GitHub (Jun 11, 2020): Cool! Is the API endpoint the one you mentioned before, i.e. GET https://server/api/v1/checks/<uuid>/log/ ?
Author
Owner

@cuu508 commented on GitHub (Jun 11, 2020):

Ah, sorry, forgot to mention – the endpoint is

GET https://healthchecks.io/api/v1/checks/<uuid>/pings/

And it is documented here: https://healthchecks.io/docs/api/#list-pings

<!-- gh-comment-id:642659270 --> @cuu508 commented on GitHub (Jun 11, 2020): Ah, sorry, forgot to mention – the endpoint is GET https://healthchecks.io/api/v1/checks/<uuid>/pings/ And it is documented here: https://healthchecks.io/docs/api/#list-pings
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/healthchecks#285
No description provided.