Thank you for your interest in contributing! 🎉 We appreciate your help in making this project better.
Be kind, respectful, and constructive. We're all here to build something useful together! 💜
-
Clone the repository
git clone https://github.com/TechNickAI/claude_telemetry.git cd claude_telemetry -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies
pip install -r requirements/requirements-dev.txt pip install -e . -
Install pre-commit hooks
pre-commit install
# Run all tests
pytest
# Run with coverage
pytest --cov=claude_telemetry --cov-report=term-missing
# Run specific test file
pytest tests/test_telemetry.py
# Run with verbose output
pytest -vWe use several tools to maintain code quality:
- Ruff for linting and formatting
- pytest for testing
- pre-commit for automated checks
# Run linter
ruff check .
# Run formatter
ruff format .
# Run pre-commit checks manually
pre-commit run --all-files-
Create a branch
git checkout -b feat/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes
- Write code
- Add tests
- Update documentation
-
Commit your changes
We follow conventional commit format:
git commit -m "feat: add new telemetry feature" git commit -m "fix: resolve span closure issue" git commit -m "docs: update installation instructions"
Commit types:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test changesrefactor:Code refactoringchore:Build/tooling changes
-
Push and create PR
git push origin feat/your-feature-name
Then create a Pull Request on GitHub.
- Title: Use conventional commit format
- Description: Explain what and why, not just how
- Tests: Add tests for new features or bug fixes
- Documentation: Update docs if needed
- Pre-commit: Ensure all checks pass
- Start with tests - Write tests first (TDD approach)
- Keep it simple - Follow existing patterns
- Document it - Update docstrings and README
- Consider backwards compatibility - Don't break existing APIs
When developing telemetry features:
# Use pytest fixtures for mocking spans
def test_my_feature(mocker):
mock_span = mocker.MagicMock()
# ... test your featureSee existing tests in tests/ for examples.
If you add a feature, consider adding an example:
- Create a new file in
examples/ - Follow the pattern of existing examples
- Update
examples/README.md
claude_telemetry/
├── claude_telemetry/ # Main package code
│ ├── __init__.py # Package exports
│ ├── cli.py # CLI entry point
│ ├── hooks.py # Telemetry hooks
│ ├── logfire_adapter.py # Logfire integration
│ ├── runner.py # Agent runner
│ ├── sync.py # Sync wrappers
│ └── telemetry.py # OTEL configuration
├── tests/ # Test suite
├── examples/ # Usage examples
├── requirements/ # Dependency files
└── .github/workflows/ # CI/CD pipelines
- Issues: Open an issue on GitHub
- Discussions: Start a discussion for questions or ideas
By contributing, you agree that your contributions will be licensed under the MIT license.
Thank you for contributing! 💜 Your work helps the entire community! 🚀