acrisci / simple-breakpad-server

Simple breakpad crash reports collecting server
https://www.npmjs.com/package/simple-breakpad-server
MIT License
67 stars 29 forks source link

Add /crashreport/query/count monitoring endpoint #8

Closed Jimbly closed 7 years ago

Jimbly commented 7 years ago

This allows the server to be queried by arbitrary monitoring software, which can be configured to alert whenever a new crash is submitted.

acrisci commented 7 years ago

Let's do a proper api endpoint here.

Put api endpoints under /api.

This one would be /api/crashreports. This returns an object with the total count sort of like this.

{
  "count": 50,
  "crashreports": [
  ...
  ]
}

That should return the 10 most recent crashreports. Later you can add query parameters to do more complex sorting and limiting.

That's just how I do things, but there are a lot of different api styles so if you would like to propose an alternative format, I'd like to hear it.

acrisci commented 7 years ago

If all you need is the count right now, just make the object look like { "count": 50 } so we have room to put in that functionality later.

Jimbly commented 7 years ago

I specifically just need the count per-product (have a separate alert for when a server crashes than for a client crash), but that seems reasonable, and I'm assuming my monitor software should be able to parse JSON :). I've reworked it to be in that format.