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

Commit 37fd034

Browse files
tstirrat15mayurkale22
authored andcommitted
Add usage instructions (#300)
1 parent 6b9e53d commit 37fd034

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

packages/opencensus-exporter-jaeger/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,48 @@ OpenCensus Jaeger Exporter allows the user to send collected traces with OpenCen
55

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

8+
## Installation
9+
10+
Install OpenCensus Jaeger Exporter with:
11+
```bash
12+
npm install @opencensus/nodejs
13+
npm install @opencensus/exporter-jaeger
14+
```
15+
16+
## Usage
17+
18+
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.
19+
20+
For ES6:
21+
22+
```javascript
23+
import tracing from '@opencensus/nodejs';
24+
import { JaegerTraceExporter } from '@opencensus/exporter-jaeger';
25+
26+
const options = {
27+
serviceName: 'my-service';
28+
tags: []; // optional
29+
host: localhost; // optional
30+
port: 6832; // optional
31+
maxPacketSize: 65000; // optional
32+
}
33+
var exporter = new JaegerTraceExporter(options);
34+
```
35+
36+
Now, register the exporter and start tracing.
37+
38+
```javascript
39+
tracing.start({'exporter': exporter});
40+
```
41+
42+
or
43+
44+
```javascript
45+
tracing.registerExporter(exporter).start();
46+
```
847

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

0 commit comments

Comments
 (0)