Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update to new package #36

Merged
merged 1 commit into from
Aug 6, 2024
Merged
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
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# bw-monitoring

# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
## Version 3 now available with zero runtime dependencies, requires Node >=14.18.0.

`@brandwatch/monitoring` is Express middleware that exposes a collection of standardised endpoints for monitoring infrastructure (e.g. Prometheus) to consume.

`bw-monitoring` is Express middleware that exposes a collection of standardised endpoints for monitoring infrastructure (e.g. Prometheus) to consume.
`npm i @brandwatch/monitoring`

`npm install --save bw-monitoring`
The package is published to brandwatch private artifactory repo, and therefore npmrc will need to be setup.
`npm login --registry https://artifactory.brandwatch.com/artifactory/api/npm/npm/` Can be run to setup a local npmrc, however, for the service to install & use this package
the npmrc must be mounted. For example see https://github.com/BrandwatchLtd/application-service/blob/main/service/Dockerfile#L19

`bw-monitoring` exports a function `getMiddleware` which returns an express middleware to pass to `expressApp.use`. This adds standard routes `/healthz`, `/metricz`, `/checkz`.
`@brandwatch/monitoring` exports a function `getMiddleware` which returns an express middleware to pass to `expressApp.use`. This adds standard routes `/healthz`, `/metricz`, `/checkz`.

```js
var monitoring = require('bw-monitoring');
var monitoring = require('@brandwatch/monitoring');
expressApp.use(monitoring.getMiddleware());
```

Expand Down Expand Up @@ -73,10 +76,3 @@ var c = new Counter('my_counter');
setTimeout(c.inc, 200);
monitoring.addMetrics(() => prometheus.register.metrics());
```

[npm-image]: https://badge.fury.io/js/bw-monitoring.svg
[npm-url]: https://npmjs.org/package/bw-monitoring
[travis-image]: https://travis-ci.org/BrandwatchLtd/bw-monitoring.svg?branch=master
[travis-url]: https://travis-ci.org/BrandwatchLtd/bw-monitoring
[daviddm-image]: https://david-dm.org/BrandwatchLtd/bw-monitoring.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/BrandwatchLtd/bw-monitoring
Loading