Skip to content

Add Badger ADR#8166

Merged
yurishkuro merged 1 commit intojaegertracing:mainfrom
yurishkuro:badger-adr
Mar 13, 2026
Merged

Add Badger ADR#8166
yurishkuro merged 1 commit intojaegertracing:mainfrom
yurishkuro:badger-adr

Conversation

@yurishkuro
Copy link
Copy Markdown
Member

@yurishkuro yurishkuro commented Mar 13, 2026

  • Document existing Badger implementation
  • Fix status of other ADRs

Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro requested a review from a team as a code owner March 13, 2026 01:27
Copilot AI review requested due to automatic review settings March 13, 2026 01:27
@dosubot dosubot bot added documentation storage/badger Issues related to badger storage labels Mar 13, 2026
@yurishkuro yurishkuro merged commit c40e9a0 into jaegertracing:main Mar 13, 2026
65 checks passed
@yurishkuro yurishkuro deleted the badger-adr branch March 13, 2026 01:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ADR documenting the existing Badger storage record layouts and standardizes the metadata header format across existing ADRs in docs/adr/.

Changes:

  • Add ADR-005 describing Badger spanstore/samplingstore key/value layouts and query behavior.
  • Update ADRs 001–004 to use a consistent header metadata format (Status + Date).
  • Update the ADR index (docs/adr/README.md) to reference ADR-005.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/adr/README.md Adds ADR-005 to the ADR index list.
docs/adr/005-badger-storage-record-layouts.md New ADR documenting Badger record formats, indexes, TTLs, and query execution.
docs/adr/004-migrating-coverage-gating-to-github-actions.md Converts “Status” section to standardized metadata header and adds date.
docs/adr/003-lazy-storage-factory-initialization.md Converts “Status” section to standardized metadata header and adds date.
docs/adr/002-mcp-server.md Converts “Status” section to standardized metadata header and adds date.
docs/adr/001-cassandra-find-traces-duration.md Updates status wording, converts to standardized metadata header, and adds date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


**Purpose**: enables finding trace IDs for a specific service + operation pair within a time range.

**Note**: because the service name and operation name are concatenated without a separator, a service named `"foo"` with operation `"bar"` produces the same prefix as a service named `"foobar"` with operation `""`. The reader guards against this ambiguity by checking that the full key prefix (up to the timestamp) matches exactly.

**Value**: JSON-encoded `[]*model.Throughput`

**No TTL**: sampling entries do not have an explicit expiry set via Badger's `ExpiresAt`. Cleanup relies on explicit deletion or Badger's value-log GC.

- **Not distributed**: Badger is a single-node store. It is not suitable for high-throughput or multi-instance deployments.
- **No spanKind in operations**: the operation name index does not encode span kind, so `GetOperations` returns operations without span kind information (tracked in [issue #1922](https://github.com/jaegertracing/jaeger/issues/1922)).
- **String concatenation without separators**: the absence of separators between service name, tag key, and tag value in composite index keys means that a suffix of one component can collide with a prefix of the next. The implementation handles this with exact-prefix length checks but it is a latent source of subtle bugs if the key format is extended.
Comment on lines +147 to +149
**Purpose**: enables range scans over span duration. A duration query scans forward from `[0x84][minDuration]` to `[0x84][maxDuration]`, collecting trace IDs. The result is used as a hash-set filter (`hashOuter`) that is intersected with results from other indexes before final trace retrieval.

**Key design rationale**: by placing `duration` before `startTime`, all keys for a given duration value are contiguous in the sorted keyspace, making range scans efficient. The time range filter is applied as a secondary check during the scan.
@github-actions
Copy link
Copy Markdown

CI Summary Report

Metrics Comparison

❌ 1 metric change(s) detected

View changed metrics

metrics_snapshot_badger_v2
1 added

  • jaeger_storage_badger_write_pending_num_memtable

metrics_snapshot_cassandras_4.x_v004_v2_auto

metrics_snapshot_cassandras_4.x_v004_v2_manual

metrics_snapshot_cassandras_5.x_v004_v2_auto

metrics_snapshot_cassandras_5.x_v004_v2_manual

Code Coverage

✅ Coverage 96.8% (baseline 96.8%)

➡️ View CI run | View publish logs
2026-03-13 01:39:12 UTC

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.67%. Comparing base (099e207) to head (698ad6d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8166   +/-   ##
=======================================
  Coverage   95.67%   95.67%           
=======================================
  Files         317      317           
  Lines       16746    16746           
=======================================
  Hits        16022    16022           
  Misses        571      571           
  Partials      153      153           
Flag Coverage Δ
badger_v1 9.05% <ø> (ø)
badger_v2 1.04% <ø> (ø)
cassandra-4.x-v1-manual 13.25% <ø> (ø)
cassandra-4.x-v2-auto 1.03% <ø> (ø)
cassandra-4.x-v2-manual 1.03% <ø> (ø)
cassandra-5.x-v1-manual 13.25% <ø> (ø)
cassandra-5.x-v2-auto 1.03% <ø> (ø)
cassandra-5.x-v2-manual 1.03% <ø> (ø)
clickhouse 1.16% <ø> (ø)
elasticsearch-6.x-v1 16.60% <ø> (ø)
elasticsearch-7.x-v1 16.63% <ø> (ø)
elasticsearch-8.x-v1 16.78% <ø> (ø)
elasticsearch-8.x-v2 1.04% <ø> (?)
elasticsearch-9.x-v2 1.04% <ø> (ø)
grpc_v1 7.79% <ø> (ø)
grpc_v2 1.04% <ø> (?)
kafka-3.x-v2 1.04% <ø> (ø)
memory_v2 1.04% <ø> (ø)
opensearch-1.x-v1 16.67% <ø> (ø)
opensearch-2.x-v1 16.67% <ø> (ø)
opensearch-2.x-v2 1.04% <ø> (ø)
opensearch-3.x-v2 1.04% <ø> (ø)
query 1.04% <ø> (ø)
tailsampling-processor 0.52% <ø> (ø)
unittests 94.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants