open-telemetry / open-telemetry/opentelemetry-android

[Question] SessionIdRatioBasedSampler defined but not used in the SDK

Open
#792 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
297
Forks
113
Avg merge
1d 13h
Merged PRs (30d)
51

Description

Currently, the SDK does not use the defined SessionIdRatioBasedSampler.

I also came across a different implementation of this sampler in splunk-otel-android code - UInt32QuadXorTraceIdRatioSampler - where it converts the hex session id to long in a specific way so it aligns with the computation in JS RUM SDK.

Looks like opentelemetry-java SDK implementation which the SessionIdRatioBasedSampler depends on also converts hex to long but in a different way (not the same as JS RUM SDK).

Was wondering if this is a blocker for not yet using the defined SessionIdRatioBasedSampler in this SDK? Do we need to propose an issue in the opentelemetry-java SDK to get a JS like calculation added, perhaps that is used in an alternate new sampler that we can then depend on instead of TraceIdRatioBasedSampler?

Another blocker could be Logs don't provide an options to add Sampler like how the Trace does.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/src/main/java/io/opentelemetry/android/SessionIdRatioBasedSampler.java and compare its conversion with the linked Java, Splunk, and JS sampler implementations. Check whether the SDK's Logs API exposes sampler options. Done means establishing and testing a decided path for using the sampler, or documenting the confirmed blocker.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
mobile-dev, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.