Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 43 additions & 21 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,19 @@ your own custom checks.
For more insight into why we built this, check out [our blog post introducing
OkComputer](http://pulse.sportngin.com/news_article/show/267646?referrer_id=543230).

OkComputer currently fully supports the following Rails versions:
OkComputer supports the following Rails versions, as tested by the CI build matrix:

* 8.1
* 8.0
* 7.2
* 7.1
* 7.0
* 6.1
* 6.0
* 5.2
* 5.1
* 4.2

In addition, the CI tests are passing on, but is not guaranteed to work with, the following Rails versions:

* 8.1
* 8.0
* 7.2
* 7.1
* 5.0
* 4.2
* 4.1
* 4.0

Expand Down Expand Up @@ -60,8 +57,43 @@ $ gem install okcomputer

## Usage

To perform the default checks (application running and ActiveRecord database
connection), do nothing other than adding to your application's Gemfile.
Adding OkComputer to your Gemfile mounts its routes at `/okcomputer` and
registers a simple application check named `default`. When ActiveRecord is
loaded, it also registers an ActiveRecord connection check named
`database`. If Sequel is loaded instead, it registers a Sequel database check.

Test the application check without any additional configuration:

```
$ curl http://localhost:3000/okcomputer
default: PASSED Application is running (0.000s)
```

### Endpoints

| Endpoint | Checks performed |
| --- | --- |
| `/okcomputer` | The `default` application check |
| `/okcomputer/database` | The registered `database` check, when present |
| `/okcomputer/all` | All checks and collections in the default collection, except those registered with `skip_all: true` |
| `/okcomputer/:name` | The registered check or collection named `:name` |

A successful check returns HTTP 200. A failed check, or an aggregate containing
a failed check, returns HTTP 500. Requesting an unregistered check returns HTTP
404.

Responses are plain text by default. Append `.json` or send an
`Accept: application/json` header to receive JSON:

```json
{
"default": {
"message": "Application is running",
"success": true,
"time": 0.000123
}
}
```

### If Not Using ActiveRecord

Expand Down Expand Up @@ -238,16 +270,6 @@ By default, OkComputer runs checks in sequence. If you'd like to run them in par
OkComputer.check_in_parallel = true
```

## Performing Checks

* Perform a simple up check: http://example.com/okcomputer
* Perform all installed checks: http://example.com/okcomputer/all
* Perform a specific installed check: http://example.com/okcomputer/database

Checks are available as plain text (by default) or JSON by appending .json, e.g.:
* http://example.com/okcomputer.json
* http://example.com/okcomputer/all.json

## OkComputer NewRelic Ignore

If NewRelic is installed, OkComputer automatically disables NewRelic monitoring for uptime checks,
Expand Down