Skip to main content

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.xml to enable watch mode and rerun test when file changes, you can use this command pytest --looponfail to run and with stdout output, you can use this command pytest -s

Build

python3 -m build

Publish

To pypi

python3 -m twine upload --config-file .pypirc dist/*

Remark

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyeqx_opentelemetry-0.1.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyeqx_opentelemetry-0.1.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pyeqx_opentelemetry-0.1.2.tar.gz.

File metadata

  • Download URL: pyeqx_opentelemetry-0.1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pyeqx_opentelemetry-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6a762620f1ceb9fb7338a873784bc449410e1430a5b7f31ae328fb63257b3b2d
MD5 918cfabdd31212a2c5179d0a4b3cf326
BLAKE2b-256 ffe3ee6ecbe63626e3f34d2c8437973aaf67595a2f392049650cbf61750014b7

See more details on using hashes here.

File details

Details for the file pyeqx_opentelemetry-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyeqx_opentelemetry-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 39c2723c5debeaea68ac9a354e19f8dc02fab11792b3e808b8f6932f32e26419
MD5 41fe487cc72fbb6d5140c3b4053ebfd7
BLAKE2b-256 7eab4fcd2ba42823eb6e217e04d78a1846ad8d88d837e3e8aa81614d6a418459

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page