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

Commit 677eef4

Browse files
committed
doc: update README.md
1 parent 34a7744 commit 677eef4

1 file changed

Lines changed: 0 additions & 90 deletions

File tree

README.md

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -13,97 +13,7 @@ Note: This code was tested on the following Node versions:
1313

1414
___
1515

16-
## OpenCensus Setup
1716

18-
1. Clone the OpenCensus Node repository < https://github.com/census-instrumentation/opencensus-node.git>
19-
```bash
20-
git clone https://github.com/census-instrumentation/opencensus-node.git
21-
```
22-
23-
**TODO Ver com Fábio se o usuário terá que compilar**
24-
25-
2. Switch to branch `dev` with:
26-
```bash
27-
git checkout dev
28-
```
29-
30-
3. Navigate to the OpenCensus Node project folder and install the dependencies with:
31-
```bash
32-
cd opencensus-node
33-
npm install
34-
```
35-
36-
4. Compile the TypeScript code into JavaScript with:
37-
```
38-
node_modules/.bin/tsc
39-
```
40-
41-
___
42-
43-
## Instrumenting an Application
44-
45-
Navigate to your application folder. Inside it's `node_modules` folder, create a directory named `@opencensus`:
46-
```
47-
cd node_modules
48-
mkdir @opencensus
49-
```
50-
51-
Navigate to your new `@opencensus` folder and create a symlink to OpenCensus Node package with:
52-
```bash
53-
cd @opencensus
54-
ln -s <path-to-opencensus-dir>/packages/opencensus-nodejs/ opencensus-nodejs
55-
```
56-
57-
### Using Stackdriver Exporter
58-
59-
To use Stackdriver as your exporter, make sure you have enabled [Stackdriver Tracing](https://cloud.google.com/trace/docs/quickstart) on Google Cloud Platform. Enable your [Application Default Credentials](https://cloud.google.com/docs/authentication/getting-started) for authentication with:
60-
```bash
61-
export GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credential.json
62-
```
63-
64-
Add the OpenCensus Stackdriver Exporter package to your project's `node_modules/@opencensus` folder with:
65-
```
66-
cd node_modules/@opencensus
67-
ln -s <path-to-opencensus-dir>/packages/opencensus-exporter-stackdriver/ opencensus-exporter-stackdriver
68-
```
69-
70-
Finally, on top of your application, add the following lines of code:
71-
```javascript
72-
var tracing = require('@opencensus/opencensus-nodejs');
73-
var stackdriver = require('@opencensus/opencensus-exporter-stackdriver');
74-
75-
// Add your project id to the Stackdriver options
76-
var options = new stackdriver.StackdriverOptions('your-project-id');
77-
var exporter = new stackdriver.Stackdriver(options);
78-
79-
tracing.registerExporter(exporter).start();
80-
```
81-
82-
### Using Zipkin Exporter
83-
84-
To use Zipkin as your exporter, first, download from any of the three available options on [Quickstart](https://zipkin.io/pages/quickstart.html): through Docker, on Java or manually compiling the source code. Tests were executed running Zipkin with Java, through the following commands on terminal:
85-
```bash
86-
wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
87-
java -jar zipkin.jar
88-
```
89-
90-
Add the OpenCensus Zipkin Exporter package to your project's `node_modules/@opencensus` folder with:
91-
```
92-
cd node_modules/@opencensus
93-
ln -s <path-to-opencensus-dir>/packages/opencensus-exporter-zipkin/ opencensus-exporter-zipkin
94-
```
95-
96-
Finally, on top of your application, add the following lines of code:
97-
```javascript
98-
var tracing = require('@opencensus/opencensus-nodejs');
99-
var zipkin = require('@opencensus/opencensus-exporter-zipkin');
100-
101-
// Add your zipkin url and application name to the Zipkin options
102-
var options = new zipkin.ZipkinOptions("your-zipkin-url", "your-application-name")
103-
var exporter = new zipkin.Zipkin(options);
104-
105-
tracing.registerExporter(exporter).start();
106-
```
10717

10818
[gitter-image]: https://badges.gitter.im/census-instrumentation/lobby.svg
10919
[gitter-url]: https://gitter.im/census-instrumentation/lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

0 commit comments

Comments
 (0)