• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

screenshots/23-Nov-2023-

src/23-Nov-2023-3,0752,383

README.mdD23-Nov-20233.3 KiB9873

build.gradleD23-Nov-2023374 1712

README.md

1# OpenCensus Z-Pages
2[![Build Status][travis-image]][travis-url]
3[![Windows Build Status][appveyor-image]][appveyor-url]
4[![Maven Central][maven-image]][maven-url]
5
6The *OpenCensus Z-Pages for Java* is a collection of HTML pages to display stats and trace data and
7allows library configuration control.
8
9## Quickstart
10
11### Add the dependencies to your project
12
13For Maven add to your `pom.xml`:
14```xml
15<dependencies>
16  <dependency>
17    <groupId>io.opencensus</groupId>
18    <artifactId>opencensus-api</artifactId>
19    <version>0.16.1</version>
20  </dependency>
21  <dependency>
22    <groupId>io.opencensus</groupId>
23    <artifactId>opencensus-contrib-zpages</artifactId>
24    <version>0.16.1</version>
25  </dependency>
26  <dependency>
27    <groupId>io.opencensus</groupId>
28    <artifactId>opencensus-impl</artifactId>
29    <version>0.16.1</version>
30    <scope>runtime</scope>
31  </dependency>
32</dependencies>
33```
34
35For Gradle add to your dependencies:
36```gradle
37compile 'io.opencensus:opencensus-api:0.16.1'
38compile 'io.opencensus:opencensus-contrib-zpages:0.16.1'
39runtime 'io.opencensus:opencensus-impl:0.16.1'
40```
41
42### Register the Z-Pages
43
44```java
45public class MyMainClass {
46  public static void main(String[] args) throws Exception {
47    ZPageHandlers.startHttpServerAndRegisterAll(8080);
48    // ... do work
49  }
50}
51```
52
53### View stats and spans on Z-Pages
54
55#### View RPC stats on /rpcz page
56
57The /rpcz page displays the canonical gRPC cumulative and interval stats broken down by RPC methods.
58Example:
59
60![rpcz-example](screenshots/rpcz-example.png)
61
62#### View measures and stats for all exported views on /statsz page
63
64The /statsz page displays measures and stats for all exported views. Views are grouped into directories
65according to their namespace. Example:
66
67![statsz-example-1](screenshots/statsz-example-1.png)
68![statsz-example-2](screenshots/statsz-example-2.png)
69
70#### View trace spans on /tracez page
71
72The /tracez page displays information about all active spans and all sampled spans based on latency
73and errors. Example:
74
75![tracez-example](screenshots/tracez-example.png)
76
77#### View and update tracing configuration on /traceconfigz page
78
79The /traceconfigz page displays information about the current active tracing configuration and
80allows users to change it. Example:
81
82![traceconfigz-example](screenshots/traceconfigz-example.png)
83
84
85### FAQ
86
87#### Why do I not see sampled spans based on latency and error codes for a given span name?
88Sampled spans based on latency and error codes are available only for registered span names.
89For more details see [SampledSpanStore][sampledspanstore-url].
90
91[travis-image]: https://travis-ci.org/census-instrumentation/opencensus-java.svg?branch=master
92[travis-url]: https://travis-ci.org/census-instrumentation/opencensus-java
93[appveyor-image]: https://ci.appveyor.com/api/projects/status/hxthmpkxar4jq4be/branch/master?svg=true
94[appveyor-url]: https://ci.appveyor.com/project/opencensusjavateam/opencensus-java/branch/master
95[maven-image]: https://maven-badges.herokuapp.com/maven-central/io.opencensus/opencensus-contrib-zpages/badge.svg
96[maven-url]: https://maven-badges.herokuapp.com/maven-central/io.opencensus/opencensus-contrib-zpages
97[sampledspanstore-url]: https://github.com/census-instrumentation/opencensus-java/blob/master/api/src/main/java/io/opencensus/trace/export/SampledSpanStore.java
98