-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Python Telemetry * Add span function * update ci * add sample test
- Loading branch information
Showing
31 changed files
with
2,370 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# Custom | ||
.vscode/ | ||
.superinvoke_cache/ | ||
.idea/ | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
*.sublime-workspace | ||
.DS_Store | ||
*.env | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
- | ||
|
||
# pdm | ||
.pdm.toml | ||
|
||
# PEP 582 | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
venv/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# Ruff | ||
.ruff_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.9.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Latitude Telemetry for Python | ||
|
||
```sh | ||
pip install latitude-telemetry | ||
``` | ||
|
||
Requires Python `3.9` or higher. | ||
|
||
Go to the [documentation](TODO) to learn more. | ||
|
||
## Usage | ||
|
||
```python | ||
TODO | ||
``` | ||
|
||
Find more [examples](TODO). | ||
|
||
## Development | ||
|
||
Requires uv `0.5.10` or higher. | ||
|
||
- Install dependencies: `uv venv && uv sync --all-extras --all-groups` | ||
- Add [dev] dependencies: `uv add [--dev] <package>` | ||
- Run linter: `uv run scripts/lint.py` | ||
- Run formatter: `uv run scripts/format.py` | ||
- Run tests: `uv run scripts/test.py` | ||
- Build package: `uv build` | ||
- Publish package: `uv publish` | ||
|
||
## License | ||
|
||
The Telemetry is licensed under the [LGPL-3.0 License](https://opensource.org/licenses/LGPL-3.0) - read the [LICENSE](/LICENSE) file for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
[project] | ||
name = "latitude-telemetry" | ||
version = "0.1.0-beta.1" | ||
description = "Latitude Telemetry for Python" | ||
authors = [{ name = "Latitude Data SL", email = "[email protected]" }] | ||
maintainers = [{ name = "Latitude Data SL", email = "[email protected]" }] | ||
readme = "README.md" | ||
license = "LGPL-3.0" | ||
urls.repository = "https://github.com/latitude-dev/latitude-llm/tree/main/packages/telemetry/python" | ||
urls.homepage = "https://github.com/latitude-dev/latitude-llm/tree/main/packages/telemetry/python#readme" | ||
urls.documentation = "https://github.com/latitude-dev/latitude-llm/tree/main/packages/telemetry/python#readme" | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"opentelemetry-api>=1.29.0", | ||
"opentelemetry-sdk>=1.29.0", | ||
"opentelemetry-instrumentation-alephalpha>=0.36.0", | ||
"opentelemetry-instrumentation-anthropic>=0.36.0", | ||
"opentelemetry-instrumentation-bedrock>=0.36.0", | ||
"opentelemetry-instrumentation-cohere>=0.36.0", | ||
"opentelemetry-instrumentation-google-generativeai>=0.36.0", | ||
"opentelemetry-instrumentation-groq>=0.36.0", | ||
"opentelemetry-instrumentation-haystack>=0.36.0", | ||
"opentelemetry-instrumentation-langchain>=0.36.0", | ||
"openinference-instrumentation-litellm>=0.1.5", | ||
"opentelemetry-instrumentation-llamaindex>=0.36.0", | ||
"opentelemetry-instrumentation-mistralai>=0.36.0", | ||
"opentelemetry-instrumentation-ollama>=0.36.0", | ||
"opentelemetry-instrumentation-openai>=0.36.0", | ||
"opentelemetry-instrumentation-replicate>=0.36.0", | ||
"opentelemetry-instrumentation-sagemaker>=0.36.0", | ||
"opentelemetry-instrumentation-together>=0.36.0", | ||
"opentelemetry-instrumentation-threading>=0.50b0", | ||
"opentelemetry-instrumentation-transformers>=0.36.0", | ||
"opentelemetry-instrumentation-vertexai>=0.36.0", | ||
"opentelemetry-instrumentation-watsonx>=0.36.0", | ||
"httpx>=0.27.2", | ||
"pydantic>=2.10.3", | ||
"typing-extensions>=4.12.2", | ||
] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"pytest-asyncio>=0.24.0", | ||
"pytest-xdist>=3.6.1", | ||
"pytest>=8.3.4", | ||
"respx>=0.22.0", | ||
"pyright>=1.1.392", | ||
"ruff>=0.8.3", | ||
"sh>=1.14.3", | ||
] | ||
|
||
[tool.pyright] | ||
pythonVersion = "3.9" | ||
typeCheckingMode = "strict" | ||
reportMissingTypeStubs = false | ||
reportUnnecessaryIsInstance = false | ||
reportPrivateUsage = false | ||
|
||
[tool.ruff] | ||
target-version = "py39" | ||
line-length = 120 | ||
indent-width = 4 | ||
|
||
[tool.ruff.lint] | ||
select = ["B", "C4", "E", "F", "I", "W", "UP"] | ||
ignore = [ | ||
"F401", | ||
"F403", | ||
# Needed because unnecessary str() on field aliases are needed | ||
# https://docs.pydantic.dev/2.8/concepts/fields/#field-aliases | ||
"UP018", | ||
# Needed because typing.List and typing.Dict are semi-deprecated | ||
# in new Python versions but we want to maintain compatibility | ||
"UP006", | ||
"UP035", | ||
] | ||
|
||
[tool.ruff.format] | ||
quote-style = "double" | ||
indent-style = "space" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "-p no:warnings -n auto" | ||
xfail_strict = true | ||
asyncio_mode = "auto" | ||
asyncio_default_fixture_loop_scope = "function" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import sys | ||
|
||
from sh import ruff # type: ignore | ||
|
||
files = sys.argv[1:] or ["."] | ||
|
||
ruff("check", "--fix", *files, _out=sys.stdout) | ||
ruff("format", *files, _out=sys.stdout) |
Oops, something went wrong.