Contributing¶
Contributions are welcome. Here's how to get started.
Contributions from humans and LLM agents¶
If you or an LLM agent finds a reproducible bug, provider gap, documentation error, or test shortcoming, please turn it into a maintainer-actionable issue or focused pull request. Search first for duplicates and include the affected version or commit, reproduction, expected versus observed behavior, exact file/symbol references, validation results, and known limitations.
Use an issue when the fix needs discussion or cannot yet be safely validated; use a PR when the fix is implemented with tests and documentation. An agent must have explicit authorization and working GitHub access before creating an issue or PR. Otherwise it should provide a complete copy-paste-ready draft and must not claim that a remote issue, PR, release, or deployment exists.
See the full human and LLM agent contribution guide.
Development Setup¶
git clone https://github.com/Mandark-droid/genai_otel_instrument.git
cd genai_otel_instrument
pip install -e ".[dev,all]"
Running Tests¶
# All tests with coverage
pytest tests/ -v --cov=genai_otel --cov-report=term
# Specific test file
pytest tests/test_config.py -v
# Specific instrumentor
pytest tests/instrumentors/test_openai_instrumentor.py -v
Code Quality¶
black genai_otel tests # Format (line length: 100)
isort genai_otel tests # Sort imports
pylint genai_otel # Lint
mypy genai_otel # Type check
Adding a New Instrumentor¶
- Create
genai_otel/instrumentors/{provider}_instrumentor.py - Inherit from
BaseInstrumentorand implementinstrument()and_extract_usage() - Add to
INSTRUMENTORSdict inauto_instrument.py - Add optional dependency to
pyproject.toml - Create tests in
tests/instrumentors/test_{provider}_instrumentor.py - Update
DEFAULT_INSTRUMENTORSinconfig.pyif enabled by default - Add pricing to
llm_pricing.json
Commit Messages¶
Use conventional commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentationtest:- Test changesrefactor:- Code refactoringchore:- Maintenance