Skip to content

Commit 04d8069

Browse files
added a configuration example to the readme file
1 parent 07079e6 commit 04d8069

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

instrumentation/sessions/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ for additional details about sessions.
1212
See ["Session Events"](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/session.md#session-events)
1313
for more information about the specific events generated by this instrumentation.
1414

15+
## Configuration
16+
17+
When using the [android agent](../../android-agent), sessions work out of the box with sensible defaults.
18+
You can customize session behavior using the configuration DSL:
19+
20+
```kotlin
21+
OpenTelemetryRumInitializer.initialize(context) {
22+
session {
23+
// Session expires after 15 minutes in background (default)
24+
backgroundInactivityTimeout = 15.minutes
25+
26+
// Session expires after 4 hours regardless of activity (default)
27+
maxLifetime = 4.hours
28+
}
29+
}
30+
```
31+
32+
If not using the agent, you can create a `SessionManager` directly with a custom `SessionConfig`.
33+
1534
## Installation
1635

1736
This instrumentation comes with the [android agent](../../android-agent) out of the box, so

0 commit comments

Comments
 (0)