|
1 | 1 | # Zipkin Export Example |
2 | 2 |
|
3 | | -This is a simple example program to demonstrate how to export tracing information |
4 | | -to Zipkin using OpenCensus. |
| 3 | +This is a simple example program to demonstrate how to export tracing |
| 4 | +information to Zipkin using OpenCensus. |
5 | 5 |
|
6 | | -Usage: |
7 | | - |
8 | | -Start the zipkin server. |
| 6 | +Start the zipkin server: |
9 | 7 | ```shell |
10 | | -java -jar zipkin.jar --logging.level.zipkin=DEBUG --logging.level.zipkin2=DEBUG |
| 8 | +docker run -p 9411:9411 openzipkin/zipkin |
| 9 | + |
| 10 | +# Or, download zipkin and run: |
| 11 | +# java -jar zipkin.jar --logging.level.zipkin=DEBUG --logging.level.zipkin2=DEBUG |
11 | 12 | ``` |
12 | 13 |
|
13 | | -Build and run the OpenCensus example. |
| 14 | +Run the OpenCensus example: |
14 | 15 | ```shell |
15 | | -bazel build opencensus/... |
16 | | -./bazel-bin/opencensus/exporters/trace/zipkin/zipkin_exporter_test |
| 16 | +bazel run //opencensus/exporters/trace/zipkin:zipkin_exporter_test |
17 | 17 | ``` |
18 | 18 |
|
19 | | -## Zipkin: |
| 19 | +Go to http://127.0.0.1:9411/ and click the "Find Traces" button to see traces. |
20 | 20 |
|
21 | | -A Zipkin server needs to be running to collect the spans. Zipkin can be found [here](https://github.com/openzipkin/zipkin). Instructions on running the server can be found [here](https://github.com/openzipkin/zipkin/tree/master/zipkin-server). The Zipkin server should by default listen on port 9411. If you are running the server locally, the spans should be sent to "http://127.0.0.1:9411/api/v2/spans". |
| 21 | +## Zipkin |
| 22 | + |
| 23 | +A Zipkin server needs to be running to send spans to it. |
| 24 | +Zipkin can be found [here](https://github.com/openzipkin/zipkin). |
| 25 | +Instructions on running the server can be found in their |
| 26 | +[quickstart](https://zipkin.io/pages/quickstart.html). |
| 27 | +The Zipkin server should by default listen on port 9411. |
22 | 28 |
|
23 | 29 | Zipkin's tracing model is not identical to the model used by OpenCensus. Here is |
24 | | - a list of some of the differences when converting from OpenCensus to Zipkin. |
| 30 | +a list of some of the differences when converting from OpenCensus to Zipkin: |
25 | 31 |
|
26 | | -**OpenCensus -> Zipkin** |
27 | | - * message events -> annotations (serialized as <SENT/RECEIVED>/\<Id\>/\<size\>) |
28 | | - * attributes -> tags (which are a dict of key/value pairs in Zipkin) |
29 | | - * links -> Not Supported |
| 32 | +OpenCensus | Zipkin |
| 33 | +---------- | ------ |
| 34 | +message events | annotations (formatted as: SENT/ID/size) |
| 35 | +attributes | tags (which are key/value pairs in Zipkin) |
| 36 | +links | not supported |
30 | 37 |
|
31 | 38 | ## Viewing Example Trace |
32 | 39 |
|
33 | | -The traces will show up on the Zipkin webpage UI. If you are using the default address it will be "http://127.0.0.1:9411/zipkin". Click on find traces. The trace sent from the exporter should appear. Click on it and it should look something like this: |
| 40 | +The traces will show up on the Zipkin webpage UI. |
| 41 | +By default, this is http://127.0.0.1:9411/ |
| 42 | + |
| 43 | +Click the "Find Traces" button and the trace sent from the exporter should |
| 44 | +appear. |
| 45 | +Click on it and it should look something like this: |
34 | 46 |
|
35 | 47 |  |
36 | 48 |
|
|
0 commit comments