Skip to content

Enforce ALWAYS_ON sampler, reuse existing TracerProvider, expand test…#19

Merged
deborahjacob-botanu merged 2 commits intomainfrom
developer-deborah
Feb 7, 2026
Merged

Enforce ALWAYS_ON sampler, reuse existing TracerProvider, expand test…#19
deborahjacob-botanu merged 2 commits intomainfrom
developer-deborah

Conversation

@deborahjacob-botanu
Copy link
Collaborator

… coverage to 365

  • Force sampler=ALWAYS_ON on TracerProvider to override OTEL_TRACES_SAMPLER env var
  • Warn when OTEL_TRACES_SAMPLER is set to anything other than always_on
  • Reuse existing TracerProvider if already configured (prevents double-spanning)
  • Fix config.py to_dict() missing export_timeout_ms field
  • Fix context token leak: single attach/detach in decorators and middleware
  • Add 96 new unit tests (269 → 365) covering config, context, data tracking, LLM tracking, resource detector, middleware, ledger, no-sampling guarantees
  • Remove unnecessary comments across SDK source files
  • Fix SPDX header formatting in bootstrap.py

Summary

Changes

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • CI / build / tooling

Testing

  • Unit tests pass (pytest)
  • Lint passes (ruff check)
  • Type check passes (mypy)

Checklist

  • My code follows the project's coding style
  • I have added SPDX headers to new files
  • I have added tests for my changes
  • I have updated documentation if needed
  • All commits are signed off (git commit -s) per the DCO

Complete implementation of the Botanu SDK including:
- Zero-config bootstrap with enable()/disable() lifecycle
- Auto-instrumentation for 50+ libraries (HTTP, DB, messaging, GenAI)
- W3C Baggage propagation for run_id across services
- ALWAYS_ON sampler (never drops spans)
- TracerProvider reuse (no double-spanning)
- Resource detection (cloud, container, process)
- Lean enricher (run_id + use_case per span)
- YAML + env var configuration with BOTANU_* precedence
- Thread-safe initialization with RLock
- CI/CD workflows (lint, typecheck, test 3.9-3.13, build, DCO)
- 365 unit tests at 73% coverage
- LF-compliant documentation and repo structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Deborah Jacob <deborah@botanu.ai>
Signed-off-by: deborahjacob-botanu <deborah@botanu.ai>
@deborahjacob-botanu deborahjacob-botanu merged commit 2225f6a into main Feb 7, 2026
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments