9
9
</p>
10
10
11
11
<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">
14
14
</a>
15
15
<a href="https://github.com/signalfx/splunk-otel-android/releases">
16
16
<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
91
91
```
92
92
dependencies {
93
93
...
94
- implementation ("com.splunk:splunk-otel-android:0.17.0 ")
94
+ implementation ("com.splunk:splunk-otel-android:1.0.0-rc.1 ")
95
95
...
96
96
}
97
97
```
@@ -127,53 +127,65 @@ Then, add the locally built library as a dependency in your application's build.
127
127
```
128
128
dependencies {
129
129
...
130
- implementation ("com.splunk:splunk-otel-android:0.18.0 -SNAPSHOT")
130
+ implementation ("com.splunk:splunk-otel-android:1.0.0-rc.2 -SNAPSHOT")
131
131
...
132
132
}
133
133
```
134
134
135
- ### Configuration
135
+ ### Configuration and initialization
136
136
137
137
In order to configure the Splunk RUM library, you will need to know three things:
138
138
139
139
* Your Splunk realm.
140
140
* 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.
141
142
* Your RUM access token.
142
143
* You can find or create a RUM access token in the Splunk Observability UI, in your Organization
143
144
Settings.
144
145
* 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.
145
148
* The name of your application.
149
+ * Use the ` setApplicationName(String) ` method on the ` SplunkRumBuilder ` class to set your
150
+ application name.
146
151
147
152
Here is an example of a the very minimal configuration which uses these 3 values:
148
153
149
154
``` java
150
155
class MyApplication extends Application {
151
156
private final String realm = " <realm>" ;
152
157
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
+ }
158
169
}
159
170
```
160
171
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
162
173
and enabling/disabling various instrumentation features.
163
174
164
- ### Initialization
165
-
166
175
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:
168
178
169
179
``` java
170
180
class MyApplication extends Application {
171
- // ...
172
181
173
182
@Override
174
183
public void onCreate () {
175
184
super . onCreate();
176
- SplunkRum . initialize(config, this );
185
+
186
+ SplunkRum . builder()
187
+ // configuration ...
188
+ .build(this );
177
189
}
178
190
}
179
191
```
@@ -226,41 +238,41 @@ You can now retrieve the session id in your JS code using `SplunkRumNative.getNa
226
238
```
227
239
### Advanced Usage
228
240
229
- #### Additional ` Config.Builder ` options.
241
+ #### Additional ` SplunkRumBuilder ` options.
230
242
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:
233
245
234
246
(Note: full javadoc can be found at [ javadoc.io] [ javadoc-url ] )
235
247
236
- - ` deploymentEnvironment (String)` :
248
+ - ` setDeploymentEnvironment (String)` :
237
249
This option will set the Splunk environment attribute on the spans that are generated by the
238
250
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
241
253
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
244
256
when debugging instrumentation issues. Additional logging may also be turned on with this option.
245
- - ` crashReportingEnabled(boolean )` :
257
+ - ` disableCrashReporting( )` :
246
258
This option can be used to turn off the crash reporting feature.
247
- - ` networkMonitorEnabled(boolean )` :
259
+ - ` disableNetworkMonitor( )` :
248
260
This option can be used to turn off the network monitoring feature.
249
- - ` anrDetectionEnabled(boolean )` :
261
+ - ` disableAnrDetection( )` :
250
262
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) ` :
252
269
This option allows you to add a set of OpenTelemetry Attributes to be appended to every span
253
270
generated by the library.
254
271
- ` filterSpans(Consumer<SpanFilterBuilder>) ` :
255
272
This can be used to provide customizations of the spans that are emitted by the library. Examples
256
273
include: removing spans altogether from export, removing span attributes, changing span attributes
257
274
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() ` :
264
276
Enables the storage-based buffering of telemetry.
265
277
This setting is useful when instrumenting applications that might work offline for extended periods of time.
266
278
- ` limitDiskUsageMegabytes(int) ` :
@@ -304,8 +316,8 @@ when initializing your instance of the SplunkRum API:
304
316
#### Detection of slow or frozen renders
305
317
306
318
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 ` .
309
321
310
322
Splunk RUM defines renders as slow or frozen following the [ Android Vitals definitions] ( https://developer.android.com/topic/performance/vitals/frozen ) :
311
323
@@ -326,7 +338,7 @@ attribute set to the value "Buttercup":
326
338
``` java
327
339
@RumScreenName (" Buttercup" )
328
340
public class MainActivity extends Activity {
329
- ...
341
+ // ...
330
342
}
331
343
```
332
344
0 commit comments