open-telemetry / open-telemetry/opentelemetry-java

Support persistent batch processor to prevent telemetry data loss

Open
#6,940 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocked:spec Feature Request
Dominant language
Java
Stars
2.5k
Forks
1k
Avg merge
3d 17h
Merged PRs (30d)
58

Description

Is your feature request related to a problem? Please describe.
We are using BatchSpanProcessor and have a scenario that where the traffic burst, we will lose some of the spans because we can't always tune the processor configs perfectly at time. Hence I am thinking if there is a way we can persist the data to make sure there is no data loss when traffic spikes.

Reference: If the configs are not tuned well, it will drop spans here silently only with limited metrics: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L238

Describe the solution you'd like

  1. Replacing the in memory queue implementation with some local persisitent queue solution like https://github.com/bulldog2011/bigqueue?
  2. Using MpscUnboundedArrayQueue instead of bounded MpscArrayQueue? https://github.com/open-telemetry/opentelemetry-java/blob/efdacc1c184b17433b49a18f56b9dab01a97eb82/sdk/trace-shaded-deps/src/main/java/io/opentelemetry/sdk/trace/internal/JcTools.java#L32

Describe alternatives you've considered
N/A

Additional context
N/A

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 sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java, especially the referenced queue behavior, and inspect sdk/trace-shaded-deps/src/main/java/io/opentelemetry/sdk/trace/internal/JcTools.java. Compare the proposed persistent local queue and unbounded queue approaches, then define tests showing that burst traffic does not silently lose spans and that normal batch processing still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.