Skip to content

Commit

Permalink
doc: Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dszakallas committed Mar 30, 2017
1 parent 7a3acbe commit 5e214dd
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ As Trace uses scoped packages, be sure to use npm version greater than 2.7.0.
npm install --save @risingstack/trace
```

*If you can't update to [email protected] for whatever reason, you can still install Trace using `npm i risingstack/trace-nodejs`.*
> ⚠️
>Trace depends on a couple of native addons. We host precompiled
binaries of these for Linux and Darwin 64-bit platforms at https://oss.risingstack.com.
The installer will attempt to download these dependencies, so it should be allowed
through your firewall, or else the download will fail and the installer will fall back
to building from source. This also happens if there isn't a precompiled binary for your platform. Note that compiling native addons requires native toolchain.

After you installed Trace as a dependency, you just require it at the beginning of your main file.
```javascript
Expand Down Expand Up @@ -95,13 +101,14 @@ module.exports = {

For the complete set of configuration options, visit the [docs](https://trace-docs.risingstack.com/docs/advanced-usage#section-available-options).

*Note: Custom reporters are no longer supported in trace 2.x*

*Note: If you are running your app with NODE_ENV=test, Trace won't start*
> ⚠️
>If you are running your app with NODE_ENV=test, Trace won't start
## API

### trace.report(String, [Object])
### trace.report(name, object)

This method can be use to report additional data to the Trace servers which later on helps with debugging.

Expand All @@ -114,10 +121,9 @@ trace.report('name', {
Throws an error if first parameter is not a String.
Throws an error if second parameter is not an Object.

### trace.reportError(String, Error)
### trace.reportError(name, error)

This method can be used to send errors to the Trace servers - note that transactions that use
this method are not subject to sampling, so it will be collected all the time.
This method can be used to send errors to the Trace servers.

```javascript
trace.reportError('mysql_error', new Error('connection refused'));
Expand Down Expand Up @@ -155,7 +161,7 @@ trace.incrementMetric('user/signup')

The name must have the following format: `<Category>/<Name>`

### trace.stop()
### trace.stop([cb])

This method gracefully stops trace.

Expand Down Expand Up @@ -242,6 +248,8 @@ module.exports = {

Also, from `2.x` you can specify these values using only environment variables: `TRACE_SERVICE_NAME` and `TRACE_API_KEY`.

Custom reporters are no longer supported in trace 2.x*

### Versions below 3.x

We dropped support for Node v0.10. [Update your runtime](node) to a more recent version to continue using Trace.
Expand Down

0 comments on commit 5e214dd

Please sign in to comment.