Skip to content

Commit c5fd220

Browse files
authored
feat(release): Add configuration for Commitizen and GitHub Actions for release (#8)
1 parent 762a0e2 commit c5fd220

File tree

7 files changed

+408
-233
lines changed

7 files changed

+408
-233
lines changed

.cz.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tool.commitizen]
2+
name = "cz_conventional_commits"
3+
version = "0.1.0"
4+
tag_format = "v$version"
5+
update_changelog_on_bump = true
6+
major_version_zero = true
7+
version_scheme = "pep440"
8+
9+
# Files where Commitizen will update the version
10+
version_files = [
11+
"pyproject.toml:version",
12+
"src/opentelemetry_mcp/__init__.py:__version__"
13+
]
14+
15+
# Changelog configuration
16+
[tool.commitizen.changelog]
17+
# Categorize commits by type
18+
file = "CHANGELOG.md"

.github/workflows/release.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch: # Manual trigger via GitHub Actions UI
5+
6+
permissions:
7+
contents: write # Required for pushing commits, tags, and creating releases
8+
id-token: write # Required for PyPI OIDC (Trusted Publishing)
9+
10+
jobs:
11+
bump-version:
12+
name: Bump Version & Create Release
13+
runs-on: ubuntu-latest
14+
outputs:
15+
new_version: ${{ steps.cz.outputs.version }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Full history required for Commitizen
21+
token: ${{ secrets.GH_ACCESS_TOKEN }} # Use PAT for pushing
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
28+
- name: Install Commitizen
29+
run: pip install commitizen
30+
31+
- name: Bump version
32+
id: cz
33+
uses: commitizen-tools/commitizen-action@master
34+
with:
35+
github_token: ${{ secrets.GH_ACCESS_TOKEN }}
36+
changelog_increment_filename: body.md
37+
38+
- name: Print version info
39+
run: |
40+
echo "New version: ${{ steps.cz.outputs.version }}"
41+
echo "Version bump: ${{ steps.cz.outputs.version }}"
42+
43+
- name: Create GitHub Release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
46+
run: |
47+
gh release create "${{ steps.cz.outputs.version }}" \
48+
--title "Release ${{ steps.cz.outputs.version }}" \
49+
--notes-file "body.md"
50+
51+
build-and-publish:
52+
name: Build and Publish to PyPI
53+
needs: bump-version
54+
runs-on: ubuntu-latest
55+
permissions:
56+
id-token: write # Required for PyPI OIDC
57+
steps:
58+
- name: Checkout code (with new version)
59+
uses: actions/checkout@v4
60+
with:
61+
ref: main # Get the version-bumped code
62+
63+
- name: Setup UV
64+
uses: astral-sh/setup-uv@v3
65+
with:
66+
version: "latest"
67+
enable-cache: true
68+
69+
- name: Setup Python
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: "3.12"
73+
74+
- name: Build package
75+
run: |
76+
uv build --wheel --sdist
77+
ls -lh dist/
78+
79+
- name: Publish to PyPI
80+
uses: pypa/gh-action-pypi-publish@release/v1
81+
# No credentials needed - uses OIDC/Trusted Publishing!
82+
83+
test-installation:
84+
name: Test PyPI Installation
85+
needs: [bump-version, build-and-publish]
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Setup Python
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: "3.12"
92+
93+
- name: Wait for package availability
94+
run: sleep 60 # Wait for PyPI to index the package
95+
96+
- name: Test installation from PyPI
97+
run: |
98+
pip install opentelemetry-mcp==${{ needs.bump-version.outputs.new_version }}
99+
python -c "import opentelemetry_mcp; print(f'Installed version: {opentelemetry_mcp.__version__}')"
100+
opentelemetry-mcp --help
101+
102+
- name: Installation successful
103+
run: echo "✅ Package successfully published and verified on PyPI!"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ cython_debug/
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187187
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189-
# .vscode/
189+
.vscode/
190190

191191
# Ruff stuff:
192192
.ruff_cache/

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# OpenTelemetry-MCP-Server
2+
23
Unified MCP server for querying OpenTelemetry traces across multiple backends (Jaeger, Tempo, Traceloop, etc.), enabling AI agents to analyze distributed traces for automated debugging and observability.
34

45
An MCP (Model Context Protocol) server for querying OpenTelemetry traces from LLM applications, with specialized support for OpenLLMetry semantic conventions.
@@ -57,12 +58,14 @@ The easiest way to run the server locally is using the provided startup script:
5758
```
5859

5960
The script will:
61+
6062
- Auto-detect the project directory (works from anywhere)
6163
- Verify `uv` is installed
6264
- Set up your backend configuration
6365
- Start the MCP server in stdio mode (ready for Claude Desktop)
6466

6567
**Supported Backends:**
68+
6669
- **Jaeger** (local): `http://localhost:16686`
6770
- **Traceloop** (cloud): `https://api.traceloop.com` (requires API key)
6871
- **Tempo** (local): `http://localhost:3200`
@@ -177,12 +180,14 @@ uv run openllmetry-mcp --transport http --host 127.0.0.1 --port 9000
177180
The HTTP server will be accessible at `http://localhost:8000/sse` by default.
178181

179182
**Transport Use Cases:**
183+
180184
- **stdio transport**: Local use, Claude Desktop integration, single process
181185
- **HTTP transport**: Remote access, multiple clients, network deployment, sample applications
182186

183187
### Integrating with Claude Desktop
184188

185189
Configure the MCP server in your Claude Desktop config file:
190+
186191
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
187192
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
188193

@@ -210,11 +215,13 @@ Choose the approach that fits your workflow. See [Best Practices](#best-practice
210215
```
211216

212217
**Pros:**
218+
213219
- Switch backends by editing one file (`start_locally.sh`)
214220
- Centralized configuration
215221
- Includes validation (checks if `uv` is installed)
216222

217223
**Cons:**
224+
218225
- Requires absolute path
219226
- macOS/Linux only (no Windows support yet)
220227

@@ -292,29 +299,31 @@ Choose the approach that fits your workflow. See [Best Practices](#best-practice
292299
```
293300

294301
**Pros:**
302+
295303
- Standard MCP ecosystem pattern
296304
- Works on all platforms (Windows/macOS/Linux)
297305
- Can configure multiple backends simultaneously (use different server names)
298306
- No wrapper script dependency
299307

300308
**Cons:**
309+
301310
- Must edit JSON config to switch backends
302311
- Backend configuration split between script and config file
303312

304313
**Tip:** You can configure multiple backends at once (e.g., `opentelemetry-mcp-jaeger` and `opentelemetry-mcp-tempo`) and Claude will show both as available MCP servers.
305314

306315
### Best Practices: Choosing an Approach
307316

308-
| Scenario | Recommended Approach | Why |
309-
|----------|---------------------|-----|
310-
| **Development & Testing** | Wrapper Script (`start_locally.sh`) | Easy to switch backends, centralized config |
311-
| **Testing multiple backends** | Wrapper Script | Edit one file to switch, no JSON editing |
312-
| **Production deployment** | Direct Configuration | Standard MCP pattern, explicit configuration |
313-
| **Single backend only** | Direct Configuration | Simpler, no wrapper needed |
314-
| **Windows users** | Direct Configuration | Wrapper script not yet supported on Windows |
315-
| **macOS/Linux users** | Either approach | Choose based on your workflow |
316-
| **Multiple backends simultaneously** | Direct Configuration | Configure all backends with different names |
317-
| **Shared team configuration** | Direct Configuration | More portable, follows MCP conventions |
317+
| Scenario | Recommended Approach | Why |
318+
| ------------------------------------ | ----------------------------------- | -------------------------------------------- |
319+
| **Development & Testing** | Wrapper Script (`start_locally.sh`) | Easy to switch backends, centralized config |
320+
| **Testing multiple backends** | Wrapper Script | Edit one file to switch, no JSON editing |
321+
| **Production deployment** | Direct Configuration | Standard MCP pattern, explicit configuration |
322+
| **Single backend only** | Direct Configuration | Simpler, no wrapper needed |
323+
| **Windows users** | Direct Configuration | Wrapper script not yet supported on Windows |
324+
| **macOS/Linux users** | Either approach | Choose based on your workflow |
325+
| **Multiple backends simultaneously** | Direct Configuration | Configure all backends with different names |
326+
| **Shared team configuration** | Direct Configuration | More portable, follows MCP conventions |
318327

319328
**General Guidelines:**
320329

@@ -349,6 +358,7 @@ Search for traces with flexible filtering:
349358
```
350359

351360
**Parameters:**
361+
352362
- `service_name` - Filter by service
353363
- `operation_name` - Filter by operation
354364
- `start_time` / `end_time` - ISO 8601 timestamps
@@ -372,6 +382,7 @@ Get complete trace details including all spans and OpenLLMetry attributes:
372382
```
373383

374384
**Returns:** Full trace tree with:
385+
375386
- All spans with attributes
376387
- Parsed OpenLLMetry data for LLM spans
377388
- Token usage per span
@@ -392,6 +403,7 @@ Get aggregated token usage metrics:
392403
```
393404

394405
**Returns:** Aggregated metrics with:
406+
395407
- Total prompt/completion/total tokens
396408
- Breakdown by model
397409
- Breakdown by service
@@ -420,6 +432,7 @@ Find traces with errors:
420432
```
421433

422434
**Returns:** Error traces with:
435+
423436
- Error messages and types
424437
- Stack traces (truncated)
425438
- LLM-specific error info
@@ -559,7 +572,7 @@ Contributions are welcome! Please ensure:
559572

560573
## License
561574

562-
MIT License - see LICENSE file for details
575+
Apache 2.0 License - see LICENSE file for details
563576

564577
## Related Projects
565578

@@ -570,5 +583,6 @@ MIT License - see LICENSE file for details
570583
## Support
571584

572585
For issues and questions:
586+
573587
- GitHub Issues: https://github.com/yourusername/openllmetry-mcp/issues
574588
- Traceloop Community: https://traceloop.com/slack

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,32 @@ authors = [
88
{name = "Nir Gazit", email = "nir@traceloop.com"}
99
]
1010
readme = "README.md"
11+
license = {text = "Apache-2.0"}
1112
requires-python = ">=3.11"
13+
keywords = [
14+
"mcp",
15+
"opentelemetry",
16+
"observability",
17+
"tracing",
18+
"llm",
19+
"model-context-protocol",
20+
"debugging",
21+
"telemetry",
22+
"jaeger",
23+
"tempo",
24+
"traceloop"
25+
]
26+
classifiers = [
27+
"Development Status :: 4 - Beta",
28+
"Intended Audience :: Developers",
29+
"Topic :: System :: Monitoring",
30+
"Topic :: Software Development :: Libraries :: Python Modules",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
35+
"Framework :: FastAPI",
36+
]
1237
dependencies = [
1338
"mcp~=1.20.0",
1439
"fastmcp~=2.13.0",
@@ -22,6 +47,13 @@ dependencies = [
2247
"opentelemetry-semantic-conventions>=0.48b0",
2348
]
2449

50+
[project.urls]
51+
Homepage = "https://github.com/traceloop/opentelemetry-mcp-server"
52+
Documentation = "https://github.com/traceloop/opentelemetry-mcp-server#readme"
53+
Repository = "https://github.com/traceloop/opentelemetry-mcp-server"
54+
Issues = "https://github.com/traceloop/opentelemetry-mcp-server/issues"
55+
Changelog = "https://github.com/traceloop/opentelemetry-mcp-server/blob/main/CHANGELOG.md"
56+
2557
[project.scripts]
2658
opentelemetry-mcp = "opentelemetry_mcp.server:main"
2759

start_locally.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ fi
2424
# Uncomment and configure ONE of the backends below:
2525

2626
## Jaeger (local)
27-
export BACKEND_TYPE="jaeger"
28-
export BACKEND_URL="http://localhost:16686"
27+
# export BACKEND_TYPE="jaeger"
28+
# export BACKEND_URL="http://localhost:16686"
2929

3030
## Traceloop (cloud)
31+
export BACKEND_TYPE="traceloop"
32+
export BACKEND_URL="https://api-staging.traceloop.com"
33+
export BACKEND_API_KEY="tl_9981e7218948437584e08e7b724304d8" # Set your API key here or via environment
3134
# export BACKEND_TYPE="traceloop"
3235
# export BACKEND_URL="https://api.traceloop.com"
3336
# export BACKEND_API_KEY="your-api-key-here" # Set your API key here or via environment

0 commit comments

Comments
 (0)