OpenTelemetry instrumentation for PyEQX
Project description
esbm-dis-dfts-pyeqx-opentelemetry
This is part of pyeqx with opentelemetry packages. (package: pyeqx-opentelemetry)
Pre-requisites
Python: 3.12
Dependencies:
- opentelemetry-api
- opentelemetry-sdk
- opentelemetry-exporter-otlp
- opentelemetry-exporter-prometheus
- azure-monitor-opentelemetry-exporter
# setup virtual env
python3.12 -m venv .venv
# activate virtual env
source .venv/bin/activate
# install dependencies
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-exporter-prometheus azure-monitor-opentelemetry-exporter==1.0.0b35
# or
pip install -e .[dev]
# install dependencies (If you want to publish)
pip install twine
Environement variables
Create .env file with content below
PYEQX_OTLP_METRICS_ENDPOINT=localhost:4317
PYEQX_OTLP_TRACES_ENDPOINT=localhost:4317
OTLP_METRICS_HTTP_ENDPOINT=http://localhost:4318/v1/metrics
OTLP_TRACES_HTTP_ENDPOINT=http://localhost:4318/v1/traces
Tests
By default, just using pytest will run the test with coverage.
pytest
To execute unit test run this command at root of the project
python3 -m unittest discover test -p "**.py"
# or
pytest test/ --cov=src --cov-report=term-missing
To execute test with coverage
pytest test/ --cov=src
[!NOTE] Additional commands for pytest to generate coverage report in another format, you can use this command
pytest --cov-report=xml:coverage/coverage.xmlto enable watch mode and rerun test when file changes, you can use this commandpytest --looponfailto run and with stdout output, you can use this commandpytest -s
Build
python3 -m build
Publish
To pypi
python3 -m twine upload --config-file .pypirc dist/*
Remark
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyeqx_opentelemetry-0.1.3.tar.gz.
File metadata
- Download URL: pyeqx_opentelemetry-0.1.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7801096d104e12cbd302c0128379a680ae28e5acff9404dc2ed96abbfe787eaf
|
|
| MD5 |
e6f5463282fde7264f2221a55ece47a7
|
|
| BLAKE2b-256 |
b8874d03f6a639ac89ada2a55b55b97bcd99f18f7a90dfb471a236df5d14407a
|
File details
Details for the file pyeqx_opentelemetry-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pyeqx_opentelemetry-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54b6ec8fd28c81acf9ae35e89725ddda1795a7509763c355520f84d6ec748c6d
|
|
| MD5 |
f47450b342d13ae0b5f3f8eb74ea6fc3
|
|
| BLAKE2b-256 |
2a8a2fb09f3df4bb18c46b533b9624f6718bd6b7375ccc62c9daf439cda3dea1
|