Skip to content

Commit 0664982

Browse files
feat: Botanu SDK for Python — OpenTelemetry-native cost attribution
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>
1 parent 9217770 commit 0664982

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+15442
-17
lines changed

.clomonitor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-FileCopyrightText: 2026 The Botanu Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# CLOMonitor metadata — used by LF AI & Data Foundation to track
5+
# project maturity and best-practice adoption.
6+
# See: https://clomonitor.io/docs/topics/checks/
7+
8+
# Documentation
9+
documentation:
10+
adopters: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/ADOPTERS.md"
11+
changelog: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/CHANGELOG.md"
12+
code_of_conduct: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/CODE_OF_CONDUCT.md"
13+
contributing: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/CONTRIBUTING.md"
14+
governance: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/GOVERNANCE.md"
15+
maintainers: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/MAINTAINERS.md"
16+
readme: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/README.md"
17+
security: "https://github.com/botanu-ai/botanu-sdk-python/blob/main/SECURITY.md"
18+
19+
# License
20+
license:
21+
approved: true
22+
spdx_id: "Apache-2.0"
23+
24+
# Best practices
25+
best_practices:
26+
dco: true
27+
openssf_badge: false # TODO: apply at https://www.bestpractices.dev/
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-FileCopyrightText: 2026 The Botanu Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Bug Report
5+
description: Report a bug in the Botanu SDK
6+
labels: ["bug", "triage"]
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to report a bug.
12+
Please fill in the details below to help us reproduce and fix the issue.
13+
14+
- type: input
15+
id: version
16+
attributes:
17+
label: Botanu SDK version
18+
description: "Output of `python -c 'import botanu; print(botanu.__version__)'`"
19+
placeholder: "0.1.0"
20+
validations:
21+
required: true
22+
23+
- type: input
24+
id: python-version
25+
attributes:
26+
label: Python version
27+
description: "Output of `python --version`"
28+
placeholder: "3.12.1"
29+
validations:
30+
required: true
31+
32+
- type: dropdown
33+
id: init-mode
34+
attributes:
35+
label: Initialization mode
36+
options:
37+
- Standalone (no existing TracerProvider)
38+
- Attach (OTEL-native vendor — Splunk, Honeycomb, etc.)
39+
- Alongside (proprietary agent — Datadog, New Relic, etc.)
40+
- Unknown / not sure
41+
validations:
42+
required: true
43+
44+
- type: textarea
45+
id: description
46+
attributes:
47+
label: Description
48+
description: A clear and concise description of the bug.
49+
validations:
50+
required: true
51+
52+
- type: textarea
53+
id: reproduce
54+
attributes:
55+
label: Steps to reproduce
56+
description: Minimal code or steps to reproduce the issue.
57+
render: python
58+
validations:
59+
required: true
60+
61+
- type: textarea
62+
id: expected
63+
attributes:
64+
label: Expected behavior
65+
description: What you expected to happen.
66+
validations:
67+
required: true
68+
69+
- type: textarea
70+
id: actual
71+
attributes:
72+
label: Actual behavior
73+
description: What actually happened. Include tracebacks if applicable.
74+
render: shell
75+
validations:
76+
required: true
77+
78+
- type: textarea
79+
id: context
80+
attributes:
81+
label: Additional context
82+
description: |
83+
- OS and platform
84+
- OTel SDK / instrumentation versions
85+
- Existing observability vendor (Datadog, Splunk, etc.)
86+
- Collector configuration
87+
validations:
88+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: 2026 The Botanu Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
blank_issues_enabled: false
5+
contact_links:
6+
- name: Questions & Discussions
7+
url: https://github.com/botanu-ai/botanu-sdk-python/discussions
8+
about: Ask questions and discuss ideas
9+
- name: Security Vulnerabilities
10+
url: https://github.com/botanu-ai/botanu-sdk-python/blob/main/SECURITY.md
11+
about: Report security vulnerabilities privately (do NOT open a public issue)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-FileCopyrightText: 2026 The Botanu Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Feature Request
5+
description: Suggest a new feature or enhancement
6+
labels: ["enhancement"]
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for suggesting an improvement to Botanu SDK!
12+
13+
- type: textarea
14+
id: problem
15+
attributes:
16+
label: Problem statement
17+
description: What problem does this feature solve? Is this related to a frustration?
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: solution
23+
attributes:
24+
label: Proposed solution
25+
description: Describe the solution you'd like. Include API sketches if possible.
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: alternatives
31+
attributes:
32+
label: Alternatives considered
33+
description: Any alternative approaches you've considered.
34+
validations:
35+
required: false
36+
37+
- type: dropdown
38+
id: scope
39+
attributes:
40+
label: Which component does this affect?
41+
multiple: true
42+
options:
43+
- Core SDK (bootstrap / attach)
44+
- Run context / decorators
45+
- Span processors
46+
- Carrier propagation (SQS, Kafka, Celery)
47+
- LLM / GenAI tracking
48+
- Resource detection
49+
- Collector configuration
50+
- Documentation
51+
- Other
52+
validations:
53+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!-- SPDX-FileCopyrightText: 2026 The Botanu Authors -->
2+
<!-- SPDX-License-Identifier: Apache-2.0 -->
3+
4+
## Summary
5+
6+
<!-- Brief description of what this PR does and why. -->
7+
8+
## Changes
9+
10+
<!-- Bulleted list of changes. -->
11+
12+
-
13+
14+
## Type of change
15+
16+
<!-- Check all that apply. -->
17+
18+
- [ ] Bug fix (non-breaking change that fixes an issue)
19+
- [ ] New feature (non-breaking change that adds functionality)
20+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
21+
- [ ] Documentation update
22+
- [ ] CI / build / tooling
23+
24+
## Testing
25+
26+
<!-- How was this tested? Include commands, screenshots, or links. -->
27+
28+
- [ ] Unit tests pass (`pytest`)
29+
- [ ] Lint passes (`ruff check`)
30+
- [ ] Type check passes (`mypy`)
31+
32+
## Checklist
33+
34+
- [ ] My code follows the project's coding style
35+
- [ ] I have added SPDX headers to new files
36+
- [ ] I have added tests for my changes
37+
- [ ] I have updated documentation if needed
38+
- [ ] All commits are signed off (`git commit -s`) per the [DCO](../DCO)

.github/repolinter.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/todogroup/repolinter/master/rulesets/schema.json",
3+
"version": 2,
4+
"axioms": {},
5+
"rules": {
6+
"license-file-exists": {
7+
"level": "error",
8+
"rule": {
9+
"type": "file-existence",
10+
"options": {
11+
"globsAny": ["LICENSE*", "COPYING*"]
12+
}
13+
}
14+
},
15+
"readme-file-exists": {
16+
"level": "error",
17+
"rule": {
18+
"type": "file-existence",
19+
"options": {
20+
"globsAny": ["README*"]
21+
}
22+
}
23+
},
24+
"contributing-file-exists": {
25+
"level": "warning",
26+
"rule": {
27+
"type": "file-existence",
28+
"options": {
29+
"globsAny": ["CONTRIBUTING*"]
30+
}
31+
}
32+
},
33+
"changelog-file-exists": {
34+
"level": "warning",
35+
"rule": {
36+
"type": "file-existence",
37+
"options": {
38+
"globsAny": ["CHANGELOG*"]
39+
}
40+
}
41+
},
42+
"code-of-conduct-file-exists": {
43+
"level": "warning",
44+
"rule": {
45+
"type": "file-existence",
46+
"options": {
47+
"globsAny": ["CODE_OF_CONDUCT*", "CODE-OF-CONDUCT*", ".github/CODE_OF_CONDUCT*"]
48+
}
49+
}
50+
},
51+
"security-file-exists": {
52+
"level": "warning",
53+
"rule": {
54+
"type": "file-existence",
55+
"options": {
56+
"globsAny": ["SECURITY*", ".github/SECURITY*"]
57+
}
58+
}
59+
},
60+
"notice-file-exists": {
61+
"level": "warning",
62+
"rule": {
63+
"type": "file-existence",
64+
"options": {
65+
"globsAny": ["NOTICE*"]
66+
}
67+
}
68+
},
69+
"license-detectable-by-licensee": {
70+
"level": "warning",
71+
"rule": {
72+
"type": "license-detectable-by-licensee",
73+
"options": {}
74+
}
75+
}
76+
}
77+
}

0 commit comments

Comments
 (0)