Skip to content

Commit e1fe417

Browse files
breedx-splkMateusz Rzeszutek
andauthored
Prepare for 1.0.0 RC1 (#362)
* Prepare for the 0.18 release * Use the setLocalIpAddressSupplier() method on Zipkin expoerter * update version to 1.0.0-RC1 * s/RC1/rc.1/ * lowercase and dots Co-authored-by: Mateusz Rzeszutek <[email protected]>
1 parent d237fc1 commit e1fe417

File tree

11 files changed

+70
-72
lines changed

11 files changed

+70
-72
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
99

10+
## Version 1.0.0-rc.1
11+
12+
Release candidate for 1.0.0.
13+
14+
* Updated to OpenTelemetry Java v1.18.0
15+
* Introduced a `SplunkRumBuilder` class and deprecated `Config` (#342)
16+
* Add mobile carrier info to Span attributes (name/mcc/mnc/icc) (#358)
17+
* Improve thread safety of slow rendering detector (#361)
18+
1019
## Version 0.17.0
1120

1221
* Ignore background application starts when measuring AppStart events (#315)

README.md

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</p>
1010

1111
<p align="center">
12-
<a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.17.0">
13-
<img alt="OpenTelemetry Instrumentation for Java Version" src="https://img.shields.io/badge/otel-1.17.0-blueviolet?style=for-the-badge">
12+
<a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.18.0">
13+
<img alt="OpenTelemetry Instrumentation for Java Version" src="https://img.shields.io/badge/otel-1.18.0-blueviolet?style=for-the-badge">
1414
</a>
1515
<a href="https://github.com/signalfx/splunk-otel-android/releases">
1616
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/signalfx/splunk-otel-android?include_prereleases&style=for-the-badge">
@@ -91,7 +91,7 @@ Then, add the latest release as a dependency in your application's build.gradle
9191
```
9292
dependencies {
9393
...
94-
implementation ("com.splunk:splunk-otel-android:0.17.0")
94+
implementation ("com.splunk:splunk-otel-android:1.0.0-rc.1")
9595
...
9696
}
9797
```
@@ -127,53 +127,65 @@ Then, add the locally built library as a dependency in your application's build.
127127
```
128128
dependencies {
129129
...
130-
implementation ("com.splunk:splunk-otel-android:0.18.0-SNAPSHOT")
130+
implementation ("com.splunk:splunk-otel-android:1.0.0-rc.2-SNAPSHOT")
131131
...
132132
}
133133
```
134134

135-
### Configuration
135+
### Configuration and initialization
136136

137137
In order to configure the Splunk RUM library, you will need to know three things:
138138

139139
* Your Splunk realm.
140140
* The realm can be found in your Splunk Observability UI in the Account Settings page.
141+
* Use the `setRealm(String)` method on the `SplunkRumBuilder` class to set the Splunk realm.
141142
* Your RUM access token.
142143
* You can find or create a RUM access token in the Splunk Observability UI, in your Organization
143144
Settings.
144145
* Important: this access token *must* have the `RUM` authorization scope to work.
146+
* Use the `setRumAccessToken(String)` method on the `SplunkRumBuilder` class to set the RUM
147+
access token.
145148
* The name of your application.
149+
* Use the `setApplicationName(String)` method on the `SplunkRumBuilder` class to set your
150+
application name.
146151

147152
Here is an example of a the very minimal configuration which uses these 3 values:
148153

149154
```java
150155
class MyApplication extends Application {
151156
private final String realm = "<realm>";
152157
private final String rumAccessToken = "<your_RUM_access_token>";
153-
private final Config config = SplunkRum.newConfigBuilder()
154-
.realm(realm)
155-
.rumAccessToken(rumAccessToken)
156-
.applicationName("My Android App")
157-
.build();
158+
159+
@Override
160+
public void onCreate() {
161+
super.onCreate();
162+
163+
SplunkRum.builder()
164+
.setApplicationName("My Android App")
165+
.setRealm(realm)
166+
.setRumAccessToken(rumAccessToken)
167+
.build(this);
168+
}
158169
}
159170
```
160171

161-
There are other options available on the `Config.Builder` instance, including enabling debug mode
172+
There are other options available on the `SplunkRumBuilder` instance, including enabling debug mode
162173
and enabling/disabling various instrumentation features.
163174

164-
### Initialization
165-
166175
To initialize the Splunk RUM monitoring library, from your `android.app.Application` instance,
167-
simply call the static initializer in your `Application.onCreate()` implementation:
176+
call the `build()` method on the `SplunkRumBuilder` instance in your `Application.onCreate()`
177+
implementation:
168178

169179
```java
170180
class MyApplication extends Application {
171-
//...
172181

173182
@Override
174183
public void onCreate() {
175184
super.onCreate();
176-
SplunkRum.initialize(config, this);
185+
186+
SplunkRum.builder()
187+
// configuration ...
188+
.build(this);
177189
}
178190
}
179191
```
@@ -226,41 +238,41 @@ You can now retrieve the session id in your JS code using `SplunkRumNative.getNa
226238
```
227239
### Advanced Usage
228240

229-
#### Additional `Config.Builder` options.
241+
#### Additional `SplunkRumBuilder` options.
230242

231-
There are a number of optional configuration options that can be specified via the `Config.Builder`
232-
when initializing your instance of the SplunkRum API:
243+
There are a number of optional configuration options that can be specified via
244+
the `SplunkRumBuilder` when initializing your instance of the SplunkRum API:
233245

234246
(Note: full javadoc can be found at [javadoc.io][javadoc-url])
235247

236-
- `deploymentEnvironment(String)` :
248+
- `setDeploymentEnvironment(String)` :
237249
This option will set the Splunk environment attribute on the spans that are generated by the
238250
instrumentation.
239-
- `beaconEndpoint(String)` :
240-
Rather than using the `realm(String)` configuration option, you can use this method to explicitly
251+
- `setBeaconEndpoint(String)` :
252+
Rather than using the `setRealm(String)` configuration option, you can use this method to explicitly
241253
give the full URL of the RUM ingest endpoint.
242-
- `debugEnabled(boolean)` :
243-
Enabling `debug` mode will turn on the opentelemetry logging span exporter, which can be useful
254+
- `enableDebug()` :
255+
Enabling `debug` mode will turn on the OpenTelemetry logging span exporter, which can be useful
244256
when debugging instrumentation issues. Additional logging may also be turned on with this option.
245-
- `crashReportingEnabled(boolean)` :
257+
- `disableCrashReporting()` :
246258
This option can be used to turn off the crash reporting feature.
247-
- `networkMonitorEnabled(boolean)` :
259+
- `disableNetworkMonitor()` :
248260
This option can be used to turn off the network monitoring feature.
249-
- `anrDetectionEnabled(boolean)` :
261+
- `disableAnrDetection()` :
250262
This option can be used to turn off the ANR detection feature.
251-
- `globalAttributes(Attributes)` :
263+
- `disableSlowRenderingDetection()` :
264+
This option can be used to turn off the slow frame render detection feature.
265+
- `setSlowRenderingDetectionPollInterval(Duration)` :
266+
Set/change the default polling interval for slow/frozen render detection.
267+
Default is 1000ms. Value must be positive.
268+
- `setGlobalAttributes(Attributes)` :
252269
This option allows you to add a set of OpenTelemetry Attributes to be appended to every span
253270
generated by the library.
254271
- `filterSpans(Consumer<SpanFilterBuilder>)` :
255272
This can be used to provide customizations of the spans that are emitted by the library. Examples
256273
include: removing spans altogether from export, removing span attributes, changing span attributes
257274
or changing the span name. See the javadoc on the `SpanFilterBuilder` class for more details.
258-
- `slowRenderingDetectionPollInterval(Duration)` :
259-
Set/change the default polling interval for slow/frozen render detection.
260-
Default is 1000ms. Value must be positive.
261-
- `slowRenderingDetectionEnabled(boolean)` :
262-
Disables the detection of slow frame renders. Enabled by default.
263-
- `diskBufferingEnabled(boolean)` :
275+
- `enableDiskBufferingEnabled()` :
264276
Enables the storage-based buffering of telemetry.
265277
This setting is useful when instrumenting applications that might work offline for extended periods of time.
266278
- `limitDiskUsageMegabytes(int)` :
@@ -304,8 +316,8 @@ when initializing your instance of the SplunkRum API:
304316
#### Detection of slow or frozen renders
305317

306318
By default, Splunk RUM detects and reports slow or frozen screen renders.
307-
To disable this feature, call `.slowRenderingDetectionEnabled(false)` on the
308-
`Config.Builder`.
319+
To disable this feature, call `.disableSlowRenderingDetection()` on the
320+
`SplunkRumBuilder`.
309321

310322
Splunk RUM defines renders as slow or frozen following the [Android Vitals definitions](https://developer.android.com/topic/performance/vitals/frozen):
311323

@@ -326,7 +338,7 @@ attribute set to the value "Buttercup":
326338
```java
327339
@RumScreenName("Buttercup")
328340
public class MainActivity extends Activity {
329-
...
341+
// ...
330342
}
331343
```
332344

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1616
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1717
android.useAndroidX=true
1818

19-
version=0.17.0
19+
version=1.0.0-rc.1
2020
group=com.splunk

sample-app/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ android {
4949
}
5050
}
5151

52-
val otelVersion = "1.16.0-alpha"
52+
val otelVersion = "1.18.0"
53+
val otelAlphaVersion = "$otelVersion-alpha"
54+
5355
dependencies {
5456
implementation("androidx.legacy:legacy-support-v4:1.0.0")
5557
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.6")
@@ -65,7 +67,7 @@ dependencies {
6567
implementation(project(":splunk-otel-android-volley"))
6668
implementation("com.android.volley:volley:1.2.1")
6769
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:$otelVersion")
68-
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:$otelVersion")
70+
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:$otelAlphaVersion")
6971

7072
testImplementation("junit:junit:4.13.2")
7173
}

splunk-otel-android-volley/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ you will also need to add the `splunk-otel-android-volley` dependency to your `b
1616
```gradle
1717
dependencies {
1818
...
19-
implementation("com.splunk:splunk-otel-android-volley:0.16.0")
19+
implementation("com.splunk:splunk-otel-android-volley:1.0.0-rc.1")
2020
...
2121
}
2222
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
}
4343
}
4444

45-
val otelVersion = "1.17.0"
45+
val otelVersion = "1.18.0"
4646
val otelAlphaVersion = "$otelVersion-alpha"
4747

4848
dependencies {

splunk-otel-android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ android {
4040
}
4141
}
4242

43-
val otelVersion = "1.17.0"
43+
val otelVersion = "1.18.0"
4444
val otelAlphaVersion = "$otelVersion-alpha"
4545

4646
dependencies {

splunk-otel-android/src/main/java/com/splunk/rum/CustomZipkinEncoder.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.nio.charset.StandardCharsets;
2020
import java.util.List;
21-
import zipkin2.Endpoint;
2221
import zipkin2.Span;
2322
import zipkin2.codec.BytesEncoder;
2423
import zipkin2.codec.Encoding;
@@ -50,9 +49,6 @@ public int sizeInBytes(Span span) {
5049

5150
@Override
5251
public byte[] encode(Span span) {
53-
Endpoint localEndpoint = Endpoint.newBuilder().serviceName(span.localServiceName()).build();
54-
span = span.toBuilder().localEndpoint(localEndpoint).build();
55-
5652
String properSpanName = span.tags().get(RumAttributeAppender.SPLUNK_OPERATION_KEY.getKey());
5753

5854
// note: this can be optimized, if necessary. Let's keep it simple for now.

splunk-otel-android/src/main/java/com/splunk/rum/RumInitializer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ SpanExporter getCoreSpanExporter(String endpoint) {
403403
ZipkinSpanExporter.builder()
404404
.setEncoder(new CustomZipkinEncoder())
405405
.setEndpoint(endpoint)
406+
// remove the local IP address
407+
.setLocalIpAddressSupplier(() -> null)
406408
.build());
407409
}
408410

splunk-otel-android/src/main/java/com/splunk/rum/ZipkinWriteToDiskExporterFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ static ZipkinSpanExporter create(Application application, int maxUsageMegabytes)
5959
return ZipkinSpanExporter.builder()
6060
.setEncoder(new CustomZipkinEncoder())
6161
.setSender(sender)
62+
// remove the local IP address
63+
.setLocalIpAddressSupplier(() -> null)
6264
.build();
6365
}
6466
}

0 commit comments

Comments
 (0)