1
1
Selenium Grid ships with support for distributed tracing, backed by
2
- the OpenTracing APIs. This allows admins and devops engineers to trace
3
- the flow of control through the Grid for each and every command.
2
+ the OpenTelemetry APIs. This allows admins and devops engineers to
3
+ trace the flow of control through the Grid for each and every command.
4
4
5
5
To enable this support, you must first provide a "Tracer"
6
- implementation that should be used. We use OpenTracing's own
7
- TracerResolver to find the Tracer to use, so if your chosen tracing
8
- library supports this mechanism to (and most do!) you should be good
9
- to go. If you are using the standalone selenium jar, updating the
10
- classpath to contain your tracer can be done using the `--ext` flag to
11
- selenium. As a worked example, using Jaeger as the tracing library and
12
- running on macOS or Linux:
6
+ implementation that should be used. We use OpenTelemtry's own
7
+ mechanisms for selecting the implementations, so if your chosen
8
+ tracing library supports this you should be good to go. If you are
9
+ using the standalone selenium jar, updating the classpath to contain
10
+ your tracer can be done using the `--ext` flag to selenium.
11
+
12
+ As a worked example, using Jaeger as the tracing library and running
13
+ on macOS or Linux:
13
14
14
15
```
15
16
java -jar selenium.jar \
16
- --ext $(coursier fetch -p io.jaegertracing:jaeger-client:1.0.0) \
17
+ --ext $(coursier fetch -p \
18
+ io.opentelemetry:opentelemetry-exporters-jaeger:0.2.0 \
19
+ io.grpc:grpc-okhttp:1.26.0) \
17
20
standalone
18
21
```
19
22
@@ -29,40 +32,34 @@ this can be done via system properties. Modifying our example:
29
32
```
30
33
java -DJAEGER_SERVICE_NAME="selenium-standalone" \
31
34
-DJAEGER_AGENT_HOST=localhost \
32
- -DJAEGER_AGENT_PORT=6831 \
33
- -DJAEGER_SAMPLER_TYPE=const \
34
- -DJAEGER_SAMPLER_PARAM=1 \
35
+ -DJAEGER_AGENT_PORT=14250 \
35
36
-jar selenium.jar \
36
- --ext $(coursier fetch -p io.jaegertracing:jaeger-client:1.0.0) \
37
+ --ext $(coursier fetch -p \
38
+ io.opentelemetry:opentelemetry-exporters-jaeger:0.2.0 \
39
+ io.grpc:grpc-okhttp:1.26.0) \
37
40
standalone
38
41
```
39
42
40
- There are other popular tracing libraries that are supported by
41
- OpenTracing, so please check their documentation for more information
42
- on how to configure them.
43
-
44
43
You will also need to be running a tracing server somewhere. In the
45
44
case of Jaeger, you can do this using docker to fire up something
46
45
locally:
47
46
48
47
```
49
- docker run --rm -it -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
50
- -p 5775:5775/udp \
51
- -p 6831:6831/udp \
52
- -p 6832:6832/udp \
53
- -p 5778:5778 \
48
+ docker run --rm -it --name jaeger \
54
49
-p 16686:16686 \
55
- -p 14268:14268 \
56
- -p 9411:9411 \
57
- jaegertracing/all-in-one:1.14
50
+ -p 14250:14250 \
51
+ jaegertracing/all-in-one:1.16
58
52
```
59
53
60
54
Now run some tests, and then point a browser at
61
55
http://localhost:16686/ to view the outputs.
62
56
57
+ There are other popular tracing libraries that are supported by
58
+ OpenTelemetry, so please check their documentation for more
59
+ information on how to configure them.
60
+
63
61
More information can be found at:
64
62
65
- * OpenTracing: https://opentracing.io
66
- * TracerResolver: https://github.com/opentracing-contrib/java-tracerresolver
63
+ * OpenTelemetry: https://opentelemetry.io
67
64
* Jaeger: https://www.jaegertracing.io
68
65
* Coursier: https://get-coursier.io
0 commit comments