Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Add usage instructions (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 authored and mayurkale22 committed Jan 22, 2019
1 parent 6b9e53d commit 37fd034
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion packages/opencensus-exporter-jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,48 @@ OpenCensus Jaeger Exporter allows the user to send collected traces with OpenCen

This project is still at an early stage of development. It's subject to change.

## Installation

Install OpenCensus Jaeger Exporter with:
```bash
npm install @opencensus/nodejs
npm install @opencensus/exporter-jaeger
```

## Usage

Instance the exporter on your application and pass the options, it must contain a service name and, optionaly, an URL. If no URL is passed, `http://localhost:9411/api/v2/spans` is used as default.

For ES6:

```javascript
import tracing from '@opencensus/nodejs';
import { JaegerTraceExporter } from '@opencensus/exporter-jaeger';

const options = {
serviceName: 'my-service';
tags: []; // optional
host: localhost; // optional
port: 6832; // optional
maxPacketSize: 65000; // optional
}
var exporter = new JaegerTraceExporter(options);
```

Now, register the exporter and start tracing.

```javascript
tracing.start({'exporter': exporter});
```

or

```javascript
tracing.registerExporter(exporter).start();
```

## Useful links
- To know more about Jaeger, visit: <https://cloud.google.com/docs/authentication/getting-started>
- To know more about Jaeger, visit: <https://www.jaegertracing.io/docs/1.8/getting-started/>
- For more information on OpenCensus, visit: <https://opencensus.io/>
- To checkout the OpenCensus for Node.js, visit: <https://github.com/census-instrumentation/opencensus-node>
- For help or feedback on this project, join us on [gitter](https://gitter.im/census-instrumentation/Lobby)
Expand Down

0 comments on commit 37fd034

Please sign in to comment.