open-telemetry / open-telemetry/opentelemetry-android

Session-based sampling doesn't consider Events/Logs

Open
#970 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In addition to the sampler problems identified in #841, the current approach within SessionIdRatioBasedSampler assumes that telemetry is entirely still span-based, which is no longer the case.

We need a means to expand/enhance the current approach to also account for LogRecord sampling. Currently, there isn't a single mechanism to do this like in tracing, but there are a couple of options.

Option 1: We could somehow, through customization, wrap the upstream SDK LogRecordBuilder with a session-aware sampling decision. If sampled, then emit() would simply delegate, and if not sampled, then emit() would effectively be a noop.

Option 2: We could create a custom session-aware sampling LogRecordProcessor that is ahead of the upstream SDK BatchLogRecordProcessor.

Both options are not optimized and unfortunately consume memory/cpu where it shouldn't be necessary.

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 by reading the SessionIdRatioBasedSampler implementation and the context from issue #841, then inspect the upstream LogRecordBuilder and BatchLogRecordProcessor APIs. Compare the two proposed approaches for applying session-aware decisions to LogRecords; done means the chosen design accounts for Events/Logs sampling without the unnecessary memory and CPU costs identified here.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev, observability
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.