Skip to content

Commit

Permalink
[tracing] Update user info for OpenTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Feb 4, 2020
1 parent 68bf012 commit 63a1bf8
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions java/server/src/org/openqa/selenium/grid/commands/tracing.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
Selenium Grid ships with support for distributed tracing, backed by
the OpenTracing APIs. This allows admins and devops engineers to trace
the flow of control through the Grid for each and every command.
the OpenTelemetry APIs. This allows admins and devops engineers to
trace the flow of control through the Grid for each and every command.

To enable this support, you must first provide a "Tracer"
implementation that should be used. We use OpenTracing's own
TracerResolver to find the Tracer to use, so if your chosen tracing
library supports this mechanism to (and most do!) you should be good
to go. If you are using the standalone selenium jar, updating the
classpath to contain your tracer can be done using the `--ext` flag to
selenium. As a worked example, using Jaeger as the tracing library and
running on macOS or Linux:
implementation that should be used. We use OpenTelemtry's own
mechanisms for selecting the implementations, so if your chosen
tracing library supports this you should be good to go. If you are
using the standalone selenium jar, updating the classpath to contain
your tracer can be done using the `--ext` flag to selenium.

As a worked example, using Jaeger as the tracing library and running
on macOS or Linux:

```
java -jar selenium.jar \
--ext $(coursier fetch -p io.jaegertracing:jaeger-client:1.0.0) \
--ext $(coursier fetch -p \
io.opentelemetry:opentelemetry-exporters-jaeger:0.2.0 \
io.grpc:grpc-okhttp:1.26.0) \
standalone
```

Expand All @@ -29,40 +32,34 @@ this can be done via system properties. Modifying our example:
```
java -DJAEGER_SERVICE_NAME="selenium-standalone" \
-DJAEGER_AGENT_HOST=localhost \
-DJAEGER_AGENT_PORT=6831 \
-DJAEGER_SAMPLER_TYPE=const \
-DJAEGER_SAMPLER_PARAM=1 \
-DJAEGER_AGENT_PORT=14250 \
-jar selenium.jar \
--ext $(coursier fetch -p io.jaegertracing:jaeger-client:1.0.0) \
--ext $(coursier fetch -p \
io.opentelemetry:opentelemetry-exporters-jaeger:0.2.0 \
io.grpc:grpc-okhttp:1.26.0) \
standalone
```

There are other popular tracing libraries that are supported by
OpenTracing, so please check their documentation for more information
on how to configure them.

You will also need to be running a tracing server somewhere. In the
case of Jaeger, you can do this using docker to fire up something
locally:

```
docker run --rm -it -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
docker run --rm -it --name jaeger \
-p 16686:16686 \
-p 14268:14268 \
-p 9411:9411 \
jaegertracing/all-in-one:1.14
-p 14250:14250 \
jaegertracing/all-in-one:1.16
```

Now run some tests, and then point a browser at
http://localhost:16686/ to view the outputs.

There are other popular tracing libraries that are supported by
OpenTelemetry, so please check their documentation for more
information on how to configure them.

More information can be found at:

* OpenTracing: https://opentracing.io
* TracerResolver: https://github.com/opentracing-contrib/java-tracerresolver
* OpenTelemetry: https://opentelemetry.io
* Jaeger: https://www.jaegertracing.io
* Coursier: https://get-coursier.io

0 comments on commit 63a1bf8

Please sign in to comment.