Skip to content

Commit

Permalink
Add info about health and monitoring to README
Browse files Browse the repository at this point in the history
  • Loading branch information
typpo authored Sep 9, 2019
1 parent 60f8fb4 commit 06a7899
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ As you can see, the Javascript or JSON object contained in the URL defines the c

The chart configuration object is based on the popular Chart.js API. Check out the [Chart.js documentation](https://www.chartjs.org/docs/latest/charts/) for more information on how to customize your chart, or see [QuickChart.io](https://quickchart.io/) for more examples.

QuickChart includes several Chart.js plugins that allow you to add chart annotations, data labels, and more. See [full QuickChart documentation](https://quickchart.io/#chart-types) for examples.

## QR Codes

The service also produces QR codes. For example, https://quickchart.io/qr?text=Hello+world produces:
Expand All @@ -60,8 +62,6 @@ To install system dependencies on Mac OSX, you probably just need to `brew insta

Once you have system dependencies installed, run `yarn install` or `npm install` to install the node dependencies.

You may optionally set up monitoring by running `./test/monit/install.sh` (you may have to modify `./test/monit/quickchart_monit.cfg` to suit your environment).

## Running the server

`node index.js` will start the server on port 3400. Set your `PORT` environmental variable to change this port.
Expand Down Expand Up @@ -97,6 +97,16 @@ Clicking the following will execute the Docker build on a remote machine and dep

[![Run on Google Cloud](https://storage.googleapis.com/cloudrun/button.svg)](https://console.cloud.google.com/cloudshell/editor?shellonly=true&cloudshell_image=gcr.io/cloudrun/button&cloudshell_git_repo=https://github.com/typpo/quickchart)

## Health and Monitoring

QuickChart has two API endpoints to determine the health of the service.

`/healthcheck` is a basic endpoint that returns a 200 status code and a JSON object that looks like this: `{"success":true,"version":"1.1.0"}`.

A second endpoint, `/healthcheck/chart` returns a 302 status code and redirects to a chart with random attributes. Although it is a more expensive endpoint, it can be useful for cache busting or testing chart rendering.

The hosted QuickChart service uses [monit](https://mmonit.com/monit/) to make sure the service is online and restart it if not. An example monit config is in `test/monit`.

## License

QuickChart is open source, licensed under version 3 of the GNU GPL. If you would like to modify this project for commercial purposes (and not release the source code), please [contact me](https://www.ianww.com/).

0 comments on commit 06a7899

Please sign in to comment.