Skip to content

Commit 3db64d8

Browse files
committed
feat(release): Add configuration for Commitizen and GitHub Actions for versioning and release management
1 parent e12167b commit 3db64d8

File tree

7 files changed

+409
-233
lines changed

7 files changed

+409
-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.
@@ -56,12 +57,14 @@ The easiest way to run the server locally is using the provided startup script:
5657
```
5758

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

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

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

182186
### Integrating with Claude Desktop
183187

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

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

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

216222
**Cons:**
223+
217224
- Requires absolute path
218225
- macOS/Linux only (no Windows support yet)
219226

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

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

299307
**Cons:**
308+
300309
- Must edit JSON config to switch backends
301310
- Backend configuration split between script and config file
302311

303312
**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.
304313

305314
### Best Practices: Choosing an Approach
306315

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

318327
**General Guidelines:**
319328

@@ -348,6 +357,7 @@ Search for traces with flexible filtering:
348357
```
349358

350359
**Parameters:**
360+
351361
- `service_name` - Filter by service
352362
- `operation_name` - Filter by operation
353363
- `start_time` / `end_time` - ISO 8601 timestamps
@@ -371,6 +381,7 @@ Get complete trace details including all spans and OpenLLMetry attributes:
371381
```
372382

373383
**Returns:** Full trace tree with:
384+
374385
- All spans with attributes
375386
- Parsed OpenLLMetry data for LLM spans
376387
- Token usage per span
@@ -391,6 +402,7 @@ Get aggregated token usage metrics:
391402
```
392403

393404
**Returns:** Aggregated metrics with:
405+
394406
- Total prompt/completion/total tokens
395407
- Breakdown by model
396408
- Breakdown by service
@@ -419,6 +431,7 @@ Find traces with errors:
419431
```
420432

421433
**Returns:** Error traces with:
434+
422435
- Error messages and types
423436
- Stack traces (truncated)
424437
- LLM-specific error info
@@ -584,7 +597,7 @@ Contributions are welcome! Please ensure:
584597

585598
## License
586599

587-
MIT License - see LICENSE file for details
600+
Apache 2.0 License - see LICENSE file for details
588601

589602
## Related Projects
590603

@@ -595,5 +608,6 @@ MIT License - see LICENSE file for details
595608
## Support
596609

597610
For issues and questions:
611+
598612
- GitHub Issues: https://github.com/yourusername/openllmetry-mcp/issues
599613
- Traceloop Community: https://traceloop.com/slack

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,33 @@ 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+
"License :: OSI Approved :: "Apache-2.0 License",
32+
"Programming Language :: Python :: 3",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: 3.13",
36+
"Framework :: FastAPI",
37+
]
1238
dependencies = [
1339
"mcp~=1.20.0",
1440
"fastmcp~=2.13.0",
@@ -22,6 +48,13 @@ dependencies = [
2248
"opentelemetry-semantic-conventions>=0.48b0",
2349
]
2450

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

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)