aboutsummaryrefslogtreecommitdiff
path: root/examples/README.md
blob: 921691b7ec10fc9a6198e4296d5bebbc75607b53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# OpenCensus Examples

## To build the examples use

### Gradle
```
$ ./gradlew installDist
```

### Maven
```
$ mvn package appassembler:assemble
```

### Bazel
```
$ bazel build :all
```

## To run "TagContextExample" use

### Gradle
```
$ ./build/install/opencensus-examples/bin/TagContextExample
```

### Maven
```
$ ./target/appassembler/bin/TagContextExample
```

### Bazel
```
$ ./bazel-bin/TagContextExample
```

## To run "ZPagesTester"

### Gradle
```
$ ./build/install/opencensus-examples/bin/ZPagesTester
```

### Maven
```
$ ./target/appassembler/bin/ZPagesTester
```

### Bazel
```
$ ./bazel-bin/ZPagesTester
```

Available pages:
* For tracing page go to [localhost:8080/tracez][ZPagesTraceZLink]. 
* For tracing config page go to [localhost:8080/traceconfigz][ZPagesTraceConfigZLink].
* For RPC stats page go to [localhost:8080/rpcz][ZPagesRpcZLink].
* For stats and measures on all registered views go to [localhost:8080/statsz][ZPagesStatsZLink].

[ZPagesTraceZLink]: http://localhost:8080/tracez
[ZPagesTraceConfigZLink]: http://localhost:8080/traceconfigz
[ZPagesRpcZLink]: http://localhost:8080/rpcz
[ZPagesStatsZLink]: http://localhost:8080/statsz

## To run "QuickStart" example use

### Gradle
```
$ ./build/install/opencensus-examples/bin/QuickStart
```

### Maven
```
$ ./target/appassembler/bin/QuickStart
```

### Bazel
```
$ ./bazel-bin/QuickStart
```

## To run "gRPC Hello World" example use

Please note all the arguments are optional. If you do not specify these arguments, default values
will be used:

* host and serverPort will be "localhost:50051"
* user will be "world"
* cloudProjectId will be null (which means no stats/spans will be exported to Stackdriver)
* server zPagePort will be 3000
* client zPagePort will be 3001
* Prometheus port will be 9090


However, if you want to specify any of these arguements, please make sure they are in order.

### Gradle
```
$ ./build/install/opencensus-examples/bin/HelloWorldServer serverPort cloudProjectId zPagePort prometheusPort
$ ./build/install/opencensus-examples/bin/HelloWorldClient user host serverPort cloudProjectId zPagePort
```

### Maven
```
$ ./target/appassembler/bin/HelloWorldServer serverPort cloudProjectId zPagePort prometheusPort
$ ./target/appassembler/bin/HelloWorldClient user host serverPort cloudProjectId zPagePort
```

### Bazel
```
$ ./bazel-bin/HelloWorldServer serverPort cloudProjectId zPagePort prometheusPort
$ ./bazel-bin/HelloWorldClient user host serverPort cloudProjectId zPagePort
```