Skip to content

Commit e61a758

Browse files
authoredAug 11, 2023
Dependency and gradle updates (#605)
* update build tools to 33.0.1 and update gradle wrapper to 8.2.1. This also updates the volley getter to use the new apis. * add getNetworkTransport
1 parent 942460b commit e61a758

File tree

11 files changed

+33
-54
lines changed

11 files changed

+33
-54
lines changed
 

‎gradle/wrapper/gradle-wrapper.jar

1.27 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

‎gradlew

+4-1
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,13 @@ location of your Java installation."
130130
fi
131131
else
132132
JAVACMD=java
133-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134136
135137
Please set the JAVA_HOME variable in your environment to match the
136138
location of your Java installation."
139+
fi
137140
fi
138141

139142
# Increase the maximum file descriptors if we can.

‎opentelemetry-android-instrumentation/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
namespace = "opentelemetry.rum.instrumentation"
1212

1313
compileSdk = 33
14-
buildToolsVersion = "30.0.3"
14+
buildToolsVersion = "33.0.1"
1515

1616
defaultConfig {
1717
minSdk = 21

‎sample-app/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
namespace = "com.splunk.android.sample"
1313

1414
compileSdk = 33
15-
buildToolsVersion = "30.0.3"
15+
buildToolsVersion = "33.0.1"
1616

1717
defaultConfig {
1818
applicationId = "com.splunk.android.sample"

‎sample-app/src/main/java/com/splunk/android/sample/FirstFragment.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.splunk.android.sample;
1818

1919
import static io.opentelemetry.api.common.AttributeKey.longKey;
20-
import static org.apache.http.conn.ssl.SSLSocketFactory.SSL;
2120

2221
import android.annotation.SuppressLint;
2322
import android.os.Bundle;
@@ -195,7 +194,7 @@ private Call.Factory buildOkHttpClient(SplunkRum splunkRum) {
195194
try {
196195
// NOTE: This is really bad and dangerous. Don't ever do this in the real world.
197196
// it's only necessary because the demo endpoint uses a self-signed SSL cert.
198-
SSLContext sslContext = SSLContext.getInstance(SSL);
197+
SSLContext sslContext = SSLContext.getInstance("SSL");
199198
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
200199
SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
201200
return splunkRum.createRumOkHttpCallFactory(

‎splunk-otel-android-volley/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010
namespace = "com.splunk.android.rum.volley"
1111

1212
compileSdk = 33
13-
buildToolsVersion = "30.0.3"
13+
buildToolsVersion = "33.0.1"
1414

1515
defaultConfig {
1616
minSdk = 21

‎splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyHttpClientAttributesGetter.java

+21
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.android.volley.Request;
2525
import com.android.volley.toolbox.HttpResponse;
2626
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesGetter;
27+
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
2728
import java.util.ArrayList;
2829
import java.util.List;
2930
import java.util.Map;
@@ -37,6 +38,16 @@ public String getUrlFull(RequestWrapper requestWrapper) {
3738
return requestWrapper.getRequest().getUrl();
3839
}
3940

41+
@Override
42+
public String getServerAddress(RequestWrapper requestWrapper) {
43+
return UrlParser.getHost(requestWrapper.getRequest().getUrl());
44+
}
45+
46+
@Override
47+
public Integer getServerPort(RequestWrapper requestWrapper) {
48+
return UrlParser.getPort(requestWrapper.getRequest().getUrl());
49+
}
50+
4051
@Nullable
4152
@Override
4253
public String getHttpRequestMethod(RequestWrapper requestWrapper) {
@@ -116,4 +127,14 @@ static List<String> headersToList(List<Header> headers, String name) {
116127
}
117128
return headersList;
118129
}
130+
131+
@Override
132+
public String getTransport(RequestWrapper requestWrapper, HttpResponse httpResponse) {
133+
return SemanticAttributes.NetTransportValues.IP_TCP;
134+
}
135+
136+
@Override
137+
public String getNetworkTransport(RequestWrapper requestWrapper, HttpResponse httpResponse) {
138+
return "tcp";
139+
}
119140
}

‎splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyNetClientAttributesGetter.java

-44
This file was deleted.

‎splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracingBuilder.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public final class VolleyTracingBuilder {
4040
private final HttpClientAttributesExtractorBuilder<RequestWrapper, HttpResponse>
4141
httpClientAttributesExtractorBuilder =
4242
HttpClientAttributesExtractor.builder(
43-
VolleyHttpClientAttributesGetter.INSTANCE,
44-
VolleyNetClientAttributesGetter.INSTANCE);
43+
VolleyHttpClientAttributesGetter.INSTANCE);
4544

4645
VolleyTracingBuilder(OpenTelemetry openTelemetry) {
4746
this.openTelemetry = openTelemetry;

‎splunk-otel-android/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
namespace = "com.splunk.android.rum"
99

1010
compileSdk = 33
11-
buildToolsVersion = "30.0.3"
11+
buildToolsVersion = "33.0.1"
1212

1313
defaultConfig {
1414
minSdk = 21

0 commit comments

Comments
 (0)
Please sign in to comment.