Zipkin UI

Repackages Zipkin UI jar until its source moves to this repository

License

License

Categories

Categories

Java Languages Zipkin Application Testing & Monitoring Application Performance Monitoring (APM)
GroupId

GroupId

io.zipkin.java
ArtifactId

ArtifactId

zipkin-ui
Last Version

Last Version

2.12.11
Release Date

Release Date

Type

Type

jar
Description

Description

Zipkin UI
Repackages Zipkin UI jar until its source moves to this repository
Project Organization

Project Organization

OpenZipkin
Source Code Management

Source Code Management

https://github.com/openzipkin/zipkin-classic

Download zipkin-ui

How to add to project

<!-- https://jarcasting.com/artifacts/io.zipkin.java/zipkin-ui/ -->
<dependency>
    <groupId>io.zipkin.java</groupId>
    <artifactId>zipkin-ui</artifactId>
    <version>2.12.11</version>
</dependency>
// https://jarcasting.com/artifacts/io.zipkin.java/zipkin-ui/
implementation 'io.zipkin.java:zipkin-ui:2.12.11'
// https://jarcasting.com/artifacts/io.zipkin.java/zipkin-ui/
implementation ("io.zipkin.java:zipkin-ui:2.12.11")
'io.zipkin.java:zipkin-ui:jar:2.12.11'
<dependency org="io.zipkin.java" name="zipkin-ui" rev="2.12.11">
  <artifact name="zipkin-ui" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.zipkin.java', module='zipkin-ui', version='2.12.11')
)
libraryDependencies += "io.zipkin.java" % "zipkin-ui" % "2.12.11"
[io.zipkin.java/zipkin-ui "2.12.11"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 3.12.2

Project Modules

There are no modules declared in this project.

zipkin-ui

Zipkin-UI is a single-page application mounted at /zipkin. For simplicity, assume paths mentioned below are relative to that. For example, the UI reads config.json, from the absolute path /zipkin/config.json

When looking at a trace, the browser is sent to the path "/traces/{id}". For the single-page app to serve that route, the server needs to forward the request to "/index.html". The same forwarding applies to "/dependencies" and any other routes the UI controls.

Under the scenes the JavaScript code looks at window.location to figure out what the UI should do. This is handled by a route api defined in the crossroads library.

The suggested logic for serving the assets of Zipkin-UI is as follows:

  1. If the browser is requesting a file with an extension (that is, the last path segment has a . in it), then serve that file. If it doesn't exist, then return 404.
  2. Otherwise, serve index.html.

For an example implementation using Finatra, see zipkin-query.

Note that in cases where a non-existent resource is requested, this logic returns the contents of index.html. When loaded as a web-page, the client application will handle the problem of telling the user about this. When not, it'll take an extra step to find where the problem is - you won't see a 404 in your network tab.

Why is it packaged as a .jar and not a .zip?

Since many Zipkin servers are Java-based, it's convenient to distribute the UI as a jar, which can be imported by the Gradle build tool. A .jar file is really only a .zip file, and can be treated as such. It can be opened by any program that can extract zip files.

How do I run against a proxy zipkin-backend?

By specifying the proxy environment variable, you can point the zipkin-ui to a different backend, allowing you to access real data while developing locally. An example to run with npm would be proxy=http://myzipkininstance.com:9411/zipkin/ npm run dev. (note that prefixing with http:// and suffixing the port is mandatory)

What's the easiest way to develop against this locally?

There is one requirement not currently filled in our build. You need a recent version of Chrome (>= 59) installed. If the build doesn't detect this, you can explicitly assign a location with the variable CHROME_BIN.

The maven install process downloads everything else needed to do development, so you don't need to install node/npm or whatever. Instead, you can use the ./npm.sh shell script to perform npm operations. Here's how you launch zipkin server and webapp to work together:

  • In one terminal, go to the root of the zipkin repo and run this to build zipkin:
# In one terminal, build the server and also make its dependencies (run from the root of the zipkin repo)
$ ./mvnw -DskipTests --also-make -pl zipkin-server clean install
# Run it!
$ java -jar ./zipkin-server/target/zipkin-server-*exec.jar
  • In another terminal, launch the zipkin UI server:
# Do this in another terminal!
$ cd zipkin-ui
$ proxy=http://localhost:9411/zipkin/ ./npm.sh run dev

This runs an NPM development server, which will automatically rebuild the webapp when you change the source code. You should now be able to access your local copy of zipkin-ui at http://localhost:9090.

What's an easy way to create new spans for testing?

Using this setup, if you open the web UI and find a trace from zipkin-server, you can download a JSON blob by right clicking on the JSON button on the trace page (top right) and doing a "Save As". Modify the span to your heart's content, and then you can submit the span(s) via curl:

$ curl -H "Content-Type: application/json" --data @span.json http://localhost:9411/api/v1/spans

How do I find logs associated with a particular trace

Since zipkin provides a correlation id (the trace id), it's a good pattern to add it in your logs. If you use zipkin, it's very likely that you have distributed logging sytem also and a way to query your logs (e.g. ELK stack).

One convenient way to switch from a trace to its logs is to get a button which directly links a trace to its logs.

This feature can be activated by setting the property zipkin.ui.logs-url or its corresponding environment variable:

  • Kibana 3: ZIPKIN_UI_LOGS_URL=http://kibana.company.com/query={traceId}
  • Kibana 4 or newer: ZIPKIN_UI_LOGS_URL=http://kibana.company.com/app/kibana#/discover?_a=(index:'filebeat-*',query:(language:lucene,query:'{traceId}')) This assumes that the log data is stored under the filebeat-* index pattern (replace this with the correct pattern if needed) and it uses the default timerange of 15 minutes (change it to 24 hours by adding &_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-24h,mode:quick,to:now)) to the URL for example).

where {traceId} will be contextually replaced by the trace id.

If this feature is activated, you'll see on the trace detail page an additional button named logs.

Logs Button

How do I make errors visible in yellow or red?

The UI interprets an "error" tag as a failed span, coloring it red. It interprets an annotation containing the substring "error" as a transient failure. To ensure the UI displays errors, please use the error key appropriately.

How do I adjust the error rates in the dependency graph

By default, the /dependency endpoint colors a link yellow when the error rate is 50% or higher, or red when it 75% or higher. You can control these rates via the dependency.low-error-rate and dependency.high-error-rate properties:

Ex. To make lines yellow when there's a 10% error rate, set: ZIPKIN_UI_DEPENDENCY_LOW_ERROR_RATE=0.1

To disable coloring of lines, set both rates to a number higher than 1.

Running behind a reverse proxy

Starting with Zipkin 1.31.2, Zipkin UI supports running under an arbitrary context root. As a result, it can be proxied under a different path than /zipkin/ such as /proxy/foo/bar/zipkin/.

Note that Zipkin requires the last path segment to be zipkin.

Also note that due to html-webpack-plugin limitations, Zipkin UI relies on a base tag and its href attribute to be set in the index.html file. By default its value is /zipkin/ and as such the reverse proxy must rewrite the value to an alternate context root.

Apache HTTP as a Zipkin reverse proxy

To configure Apache HTTP as a reverse proxy, following minimal configuration is required.

LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_html_module libexec/apache2/mod_proxy_html.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so

ProxyPass /proxy/foo/bar/ http://localhost:9411/
SetOutputFilter proxy-html
ProxyHTMLURLMap /zipkin/ /proxy/foo/bar/zipkin/
ProxyHTMLLinks  base        href

To access Zipkin UI behind the reverse proxy, execute:

$ curl http://localhost/proxy/foo/bar/zipkin/
<html><head><!--
      add 'base' tag to work around the fact that 'html-webpack-plugin' does not work
      with '__webpack_public_path__' being set as reported at https://github.com/jantimon/html-webpack-plugin/issues/119
    --><base href="/proxy/foo/bar/zipkin/"><link rel="icon" type="image/x-icon" href="favicon.ico"><meta charset="UTF-8"><title>Webpack App</title><link href="app-94a6ee84dc608c5f9e66.min.css" rel="stylesheet"></head><body>
  <script type="text/javascript" src="app-94a6ee84dc608c5f9e66.min.js"></script></body></html>

As you would see, the attribute href of the base tag is rewritten which is the way to get around the html-webpack-plugin limitations.

Uploading the span is easy as

$ curl -H "Content-Type: application/json" --data-binary "[$(cat ../benchmarks/src/main/resources/span-local.json)]" http://localhost/proxy/foo/bar/api/v1/spans

And then it's observable in the UI:

$ open http://localhost/proxy/foo/bar/zipkin/?serviceName=zipkin-server&startTs=1378193040000&endTs=1505463856013

How do I configure security (authentication, authorization)?

Zipkin UI can be secured by running it behind an authenticating proxy like Apache HTTPD, Nginx or similar. Make sure to also consult the notes on running apache http as a reverse proxy for the UI, as it can be a bit tricky.

Note that by default, a Zipkin server runs both the UI ('/zipkin') and the span collector ('/api') endpoint. Your configuration to secure the UI should only target the UI endpoint in order to not prevent clients from ingesting span data.

io.zipkin.java

Open Zipkin

Versions

Version
2.12.11
2.12.10
2.12.9
2.12.8
2.12.7
2.12.6
2.12.5
2.12.4
2.12.3
2.12.2
2.12.1
2.12.0
2.11.13
2.11.12
2.11.11
2.11.10
2.11.9
2.11.8
2.11.7
2.11.6
2.11.5
2.11.4
2.11.3
2.11.2
2.11.1
2.11.0
2.10.4
2.10.3
2.10.2
2.10.1
2.10.0
2.9.4
2.9.3
2.9.2
2.9.1
2.9.0
2.8.4
2.8.3
2.8.2
2.8.1
2.8.0
2.7.5
2.7.4
2.7.3
2.7.2
2.7.1
2.7.0
2.6.1
2.6.0
2.5.3
2.5.2
2.5.1
2.5.0
2.4.9
2.4.8
2.4.7
2.4.6
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.1
2.3.0
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
2.0.1
2.0.0
1.31.3
1.31.2
1.31.1
1.31.0
1.30.3
1.30.2
1.30.1
1.30.0
1.29.4
1.29.3
1.29.2
1.29.1
1.29.0
1.28.1
1.28.0
1.27.0
1.26.2
1.26.1
1.26.0
1.25.0
1.24.0
1.23.3
1.23.2
1.23.1
1.23.0
1.22.1
1.22.0
1.21.0
1.20.1
1.20.0
1.19.4
1.19.3
1.19.2
1.19.1
1.19.0
1.18.0
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.14.4
1.14.3
1.14.2
1.14.1
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.1
1.11.0
1.10.0
1.9.0
1.8.4
1.8.3
1.8.2
1.8.1
1.8.0
1.7.0
1.6.0
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.1
1.2.0
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
0.21.5
0.21.3
0.21.2
0.21.1
0.21.0