Skip to content

Commit 05cd7c3

Browse files
chore: Initial commit - msgtrace-sdk v0.1.0
OpenTelemetry-based observability SDK for AI applications. Features: - OpenTelemetry-based tracing for AI applications - Support for Gen AI semantic conventions (gen_ai.*) - Automatic token counting and cost calculation - Tool call tracking and execution monitoring - Thread-safe TracerManager with lazy initialization - Zero-overhead when telemetry disabled (no-op tracer) - Sync/async context managers and decorators - Comprehensive test suite (69 tests) - Full CI/CD automation with security validation - Automated release workflow - Branch protection and merge bot This is the initial 0.1.0 release for testing CI/CD. Production 1.0.0 release will follow after validation.
0 parents  commit 05cd7c3

36 files changed

+5990
-0
lines changed

.github/dependabot.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
updates:
3+
# Python dependencies
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- "msgflux/maintainers"
13+
labels:
14+
- "dependencies"
15+
- "python"
16+
commit-message:
17+
prefix: "CHORE"
18+
prefix-development: "CHORE"
19+
groups:
20+
# Group OpenTelemetry packages together
21+
opentelemetry:
22+
patterns:
23+
- "opentelemetry-*"
24+
# Group dev dependencies together
25+
dev-dependencies:
26+
dependency-type: "development"
27+
update-types:
28+
- "minor"
29+
- "patch"
30+
31+
# GitHub Actions dependencies
32+
- package-ecosystem: "github-actions"
33+
directory: "/"
34+
schedule:
35+
interval: "weekly"
36+
day: "monday"
37+
time: "09:00"
38+
open-pull-requests-limit: 5
39+
labels:
40+
- "dependencies"
41+
- "github-actions"
42+
commit-message:
43+
prefix: "CHORE"

.github/labeler.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Configuration for labeler action
2+
# https://github.com/actions/labeler
3+
4+
# SDK code
5+
sdk:
6+
- changed-files:
7+
- any-glob-to-any-file: 'src/msgtrace/sdk/**'
8+
9+
# Core/Parser code
10+
core:
11+
- changed-files:
12+
- any-glob-to-any-file: 'src/msgtrace/core/**'
13+
14+
# Tests
15+
tests:
16+
- changed-files:
17+
- any-glob-to-any-file: 'tests/**'
18+
19+
# Documentation
20+
documentation:
21+
- changed-files:
22+
- any-glob-to-any-file:
23+
- '**/*.md'
24+
- 'docs/**'
25+
26+
# CI/CD
27+
ci:
28+
- changed-files:
29+
- any-glob-to-any-file:
30+
- '.github/workflows/**'
31+
- '.github/dependabot.yml'
32+
- '.github/labeler.yml'
33+
34+
# Dependencies
35+
dependencies:
36+
- changed-files:
37+
- any-glob-to-any-file:
38+
- 'pyproject.toml'
39+
- 'uv.lock'
40+
- '.pre-commit-config.yaml'
41+
42+
# Examples
43+
examples:
44+
- changed-files:
45+
- any-glob-to-any-file: 'examples/**'

.github/release-drafter.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
4+
categories:
5+
- title: '🚀 Features'
6+
labels:
7+
- 'enhancement'
8+
- 'feat'
9+
- title: '🐛 Bug Fixes'
10+
labels:
11+
- 'bug'
12+
- 'fix'
13+
- title: '📚 Documentation'
14+
labels:
15+
- 'documentation'
16+
- 'docs'
17+
- title: '🧪 Tests'
18+
labels:
19+
- 'tests'
20+
- 'test'
21+
- title: '⚡ Performance'
22+
labels:
23+
- 'performance'
24+
- 'perf'
25+
- title: '🔧 Maintenance'
26+
labels:
27+
- 'maintenance'
28+
- 'chore'
29+
- title: '🔐 Security'
30+
labels:
31+
- 'security'
32+
- title: '📦 Dependencies'
33+
labels:
34+
- 'dependencies'
35+
36+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
37+
change-title-escapes: '\<*_&'
38+
39+
version-resolver:
40+
major:
41+
labels:
42+
- 'breaking-change'
43+
- 'major'
44+
minor:
45+
labels:
46+
- 'enhancement'
47+
- 'feat'
48+
- 'feature'
49+
patch:
50+
labels:
51+
- 'bug'
52+
- 'fix'
53+
- 'patch'
54+
- 'documentation'
55+
- 'dependencies'
56+
default: patch
57+
58+
template: |
59+
## Changes
60+
61+
$CHANGES
62+
63+
## Contributors
64+
65+
Thank you to all contributors! 🙏
66+
67+
$CONTRIBUTORS

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
lint-format:
13+
name: Ruff Lint & Format
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v4
21+
with:
22+
version: "latest"
23+
24+
- name: Set up Python
25+
run: uv python install 3.12
26+
27+
- name: Install dependencies
28+
run: uv sync --group dev
29+
30+
- name: Run ruff format check
31+
run: uv run ruff format --check
32+
33+
- name: Run ruff lint
34+
run: uv run ruff check --output-format=github
35+
36+
test:
37+
name: Test Python ${{ matrix.python-version }}
38+
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python-version: ['3.10', '3.11', '3.12', '3.13']
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v4
49+
with:
50+
version: "latest"
51+
52+
- name: Set up Python ${{ matrix.python-version }}
53+
run: uv python install ${{ matrix.python-version }}
54+
55+
- name: Install dependencies
56+
run: uv sync --group dev
57+
58+
- name: Run tests
59+
run: uv run pytest -v --cov=src/msgtrace --cov-report=xml --cov-report=term
60+
61+
- name: Upload coverage
62+
uses: codecov/codecov-action@v4
63+
if: matrix.python-version == '3.12'
64+
with:
65+
file: ./coverage.xml
66+
fail_ci_if_error: false
67+
68+
build:
69+
name: Build distribution
70+
runs-on: ubuntu-latest
71+
needs: [lint-format, test]
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Install uv
77+
uses: astral-sh/setup-uv@v4
78+
79+
- name: Set up Python
80+
run: uv python install 3.12
81+
82+
- name: Install dependencies
83+
run: uv sync --group dev
84+
85+
- name: Build package
86+
run: uv build
87+
88+
- name: Check package
89+
run: |
90+
ls -lh dist/
91+
uv run twine check dist/*
92+
93+
- name: Store distribution
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: python-package-distributions
97+
path: dist/

.github/workflows/codeql.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CodeQL Security Scan
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# Run every Monday at 3am UTC
10+
- cron: "0 3 * * 1"
11+
12+
permissions:
13+
actions: read
14+
contents: read
15+
security-events: write
16+
17+
jobs:
18+
analyze:
19+
name: Analyze Python Code
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v3
28+
with:
29+
languages: python
30+
# Queries: security-extended includes more security checks
31+
queries: security-extended
32+
33+
- name: Perform CodeQL Analysis
34+
uses: github/codeql-action/analyze@v3
35+
with:
36+
category: "/language:python"

0 commit comments

Comments
 (0)