Skip to content

Commit

Permalink
Bump the version of OpenTelemetry to 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Mar 20, 2020
1 parent 8e623f4 commit c8b88cd
Show file tree
Hide file tree
Showing 19 changed files with 159 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ java_library(
# Exposed by tracing APIs
"//java/client/src/org/openqa/selenium/remote/http",
artifact("io.opentelemetry:opentelemetry-api"),
artifact("io.opentelemetry:opentelemetry-context-prop"),
],
deps = [
"//java/client/src/org/openqa/selenium/remote/http",
artifact("io.opentelemetry:opentelemetry-api"),
artifact("io.opentelemetry:opentelemetry-context-prop"),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import io.opentelemetry.trace.SpanId;
import io.opentelemetry.trace.TraceFlags;
import io.opentelemetry.trace.TraceId;
import io.opentelemetry.trace.TraceState;
import io.opentelemetry.trace.Tracer;
import io.opentelemetry.trace.Tracestate;
import org.openqa.selenium.remote.http.HttpRequest;

import java.util.Objects;
Expand All @@ -36,7 +36,7 @@ public class HttpTracing {
TraceId.getInvalid(),
SpanId.getInvalid(),
TraceFlags.getDefault(),
Tracestate.getDefault());
TraceState.getDefault());

private HttpTracing() {
// Utility classes
Expand Down
10 changes: 6 additions & 4 deletions java/maven_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ load("@rules_jvm_external//:specs.bzl", "maven")
def selenium_java_deps():
jetty_version = "9.4.27.v20200227"
netty_version = "4.1.47.Final"
opentelemetry_version = "0.2.4"

maven_install(
artifacts = [
Expand All @@ -29,10 +30,11 @@ def selenium_java_deps():
"io.netty:netty-transport-native-kqueue:%s" % netty_version,
"io.netty:netty-transport-native-kqueue:jar:osx-x86_64:%s" % netty_version,
"io.netty:netty-transport-native-unix-common:%s" % netty_version,
"io.opentelemetry:opentelemetry-api:0.2.0",
"io.opentelemetry:opentelemetry-exporters-inmemory:0.2.0",
"io.opentelemetry:opentelemetry-exporters-logging:0.2.0",
"io.opentelemetry:opentelemetry-sdk:0.2.0",
"io.opentelemetry:opentelemetry-api:%s" % opentelemetry_version,
"io.opentelemetry:opentelemetry-context-prop:%s" % opentelemetry_version,
"io.opentelemetry:opentelemetry-exporters-inmemory:%s" % opentelemetry_version,
"io.opentelemetry:opentelemetry-exporters-logging:%s" % opentelemetry_version,
"io.opentelemetry:opentelemetry-sdk:%s" % opentelemetry_version,
"it.ozimov:embedded-redis:0.7.2",
"javax.servlet:javax.servlet-api:3.1.0",
maven.artifact(
Expand Down
204 changes: 128 additions & 76 deletions java/maven_install.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions java/server/src/org/openqa/selenium/grid/commands/tracing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on macOS or Linux:
```
java -jar selenium.jar \
--ext $(coursier fetch -p \
io.opentelemetry:opentelemetry-exporters-jaeger:0.2.0 \
io.opentelemetry:opentelemetry-exporters-jaeger:0.2.4 \
io.grpc:grpc-okhttp:1.26.0) \
standalone
```
Expand All @@ -35,7 +35,7 @@ this can be done via system properties. Modifying our example:
-DJAEGER_AGENT_PORT=14250 \
-jar selenium.jar \
--ext $(coursier fetch -p \
io.opentelemetry:opentelemetry-exporters-jaeger:0.2.0 \
io.opentelemetry:opentelemetry-exporters-jaeger:0.2.4 \
io.grpc:grpc-okhttp:1.26.0) \
standalone
```
Expand Down
2 changes: 0 additions & 2 deletions java/server/src/org/openqa/selenium/grid/log/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ java_library(
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//java/server/src/org/openqa/selenium/grid/config",
# artifact("io.grpc:grpc-api"),
artifact("io.opentelemetry:opentelemetry-api"),
# artifact("io.opentelemetry:opentelemetry-exporters-jaeger"),
artifact("io.opentelemetry:opentelemetry-exporters-logging"),
artifact("io.opentelemetry:opentelemetry-sdk"),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@

package org.openqa.selenium.grid.log;

import io.opentelemetry.exporters.logging.LoggingExporter;
import io.opentelemetry.sdk.OpenTelemetrySdk;
import io.opentelemetry.sdk.trace.MultiSpanProcessor;
import io.opentelemetry.sdk.trace.SpanData;
import io.opentelemetry.sdk.trace.SpanProcessor;
import io.opentelemetry.sdk.trace.TracerSdkFactory;
import io.opentelemetry.sdk.trace.TracerSdkProvider;
import io.opentelemetry.sdk.trace.data.SpanData;
import io.opentelemetry.sdk.trace.export.SimpleSpansProcessor;
import io.opentelemetry.sdk.trace.export.SpanExporter;
import io.opentelemetry.trace.Tracer;
Expand Down Expand Up @@ -55,7 +54,7 @@ public boolean isUsingPlainLogs() {
}

public Tracer getTracer() {
TracerSdkFactory tracerFactory = OpenTelemetrySdk.getTracerFactory();
TracerSdkProvider tracerFactory = OpenTelemetrySdk.getTracerProvider();

List<SpanProcessor> exporters = new LinkedList<>();
exporters.add(SimpleSpansProcessor.newBuilder(new SpanExporter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class WebDriverBackedSeleniumHandlerTest {

@Before
public void setUpServer() throws MalformedURLException {
Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
Tracer tracer = OpenTelemetry.getTracerProvider().get("default");

// Register the emulator
ActiveSessions sessions = new ActiveSessions(3, MINUTES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class AddingNodesTest {

@Before
public void setUpDistributor() throws MalformedURLException {
tracer = OpenTelemetry.getTracerFactory().get("default");
tracer = OpenTelemetry.getTracerProvider().get("default");
bus = new GuavaEventBus();

handler = new CombinedHandler();
Expand Down Expand Up @@ -194,7 +194,7 @@ protected CustomNode(
UUID nodeId,
URI uri,
Function<Capabilities, Session> factory) {
super(OpenTelemetry.getTracerFactory().get("default"), nodeId, uri);
super(OpenTelemetry.getTracerProvider().get("default"), nodeId, uri);

this.bus = bus;
this.factory = Objects.requireNonNull(factory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class DistributorTest {

@Before
public void setUp() {
tracer = OpenTelemetry.getTracerFactory().get("default");
tracer = OpenTelemetry.getTracerProvider().get("default");
bus = new GuavaEventBus();
clientFactory = HttpClient.Factory.createDefault();
LocalSessionMap sessions = new LocalSessionMap(tracer, bus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class LocalDistributorTest {

@Before
public void setUp() throws URISyntaxException {
tracer = OpenTelemetry.getTracerFactory().get("default");
tracer = OpenTelemetry.getTracerProvider().get("default");
bus = new GuavaEventBus();
clientFactory = HttpClient.Factory.createDefault();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class NodeTest {

@Before
public void setUp() throws URISyntaxException {
tracer = OpenTelemetry.getTracerFactory().get("default");
tracer = OpenTelemetry.getTracerProvider().get("default");
bus = new GuavaEventBus();

clientFactory = HttpClient.Factory.createDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void shouldAcceptAW3CPayload() throws URISyntaxException {
URI uri = new URI("http://example.com");

Node node = LocalNode.builder(
OpenTelemetry.getTracerFactory().get("default"),
OpenTelemetry.getTracerProvider().get("default"),
new GuavaEventBus(),
HttpClient.Factory.createDefault(),
uri,
Expand Down Expand Up @@ -114,7 +114,7 @@ public void ifOnlyJWPPayloadSentResponseShouldBeJWPOnlyIfJWPConfigured()
URI uri = new URI("http://example.com");

Node node = LocalNode.builder(
OpenTelemetry.getTracerFactory().get("default"),
OpenTelemetry.getTracerProvider().get("default"),
new GuavaEventBus(),
HttpClient.Factory.createDefault(),
uri,
Expand Down Expand Up @@ -157,7 +157,7 @@ public void shouldPreferUsingTheW3CProtocol() throws URISyntaxException {
URI uri = new URI("http://example.com");

Node node = LocalNode.builder(
OpenTelemetry.getTracerFactory().get("default"),
OpenTelemetry.getTracerProvider().get("default"),
new GuavaEventBus(),
HttpClient.Factory.createDefault(),
uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void setFields() {
}

private static Object[] createInMemory() throws MalformedURLException, URISyntaxException {
Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
Tracer tracer = OpenTelemetry.getTracerProvider().get("default");
EventBus bus = ZeroMqEventBus.create(
new ZContext(),
"inproc://end-to-end-pub",
Expand Down Expand Up @@ -156,7 +156,7 @@ private static Object[] createInMemory() throws MalformedURLException, URISyntax
}

private static Object[] createRemotes() throws URISyntaxException {
Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
Tracer tracer = OpenTelemetry.getTracerProvider().get("default");
EventBus bus = ZeroMqEventBus.create(
new ZContext(),
"tcp://localhost:" + PortProber.findFreePort(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class RouterTest {

@Before
public void setUp() {
tracer = OpenTelemetry.getTracerFactory().get("default");
tracer = OpenTelemetry.getTracerProvider().get("default");
bus = new GuavaEventBus();

handler = new CombinedHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void setUp() throws URISyntaxException {
new URI("http://localhost:1234"),
new ImmutableCapabilities());

Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
Tracer tracer = OpenTelemetry.getTracerProvider().get("default");
bus = new GuavaEventBus();

local = new LocalSessionMap(tracer, bus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class RedisBackedSessionMapTest {

private static RedisServer server;
private static Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
private static Tracer tracer = OpenTelemetry.getTracerProvider().get("default");
private static URI uri;

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
public class ProtocolConverterTest {

private final Json json = new Json();
private final Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
private final Tracer tracer = OpenTelemetry.getTracerProvider().get("default");

@Test
public void shouldRoundTripASimpleCommand() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
public class ReverseProxyHandlerTest {

private Server server;
private Tracer tracer = OpenTelemetry.getTracerFactory().get("default");
private Tracer tracer = OpenTelemetry.getTracerProvider().get("default");
private HttpClient.Factory factory = HttpClient.Factory.createDefault();

@Before
Expand Down

0 comments on commit c8b88cd

Please sign in to comment.