VOOZH about

URL: https://pypi.org/project/pytest-otel/1.6.0/

โ‡ฑ pytest-otel ยท PyPI


Skip to main content

pytest-otel 1.6.0

pip install pytest-otel==1.6.0

Newer version available (2.3.0)

Released:

OpenTelemetry plugin for Pytest

Navigation

Verified details

These details have been verified by PyPI
Maintainers
๐Ÿ‘ Avatar for kuisathaverat from gravatar.com
kuisathaverat

Unverified details

These details have not been verified by PyPI
Meta
  • License: Apache Software License (Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR U...)
  • Author: Ivan Fernandez Calvo (kuisathaverat)
  • Tags pytest , otel , opentelemetry , debug
  • Requires: Python >=3.8

Project description

pytest_otel

Features

pytest-otel plugin for reporting OpenTelemetry spans of tests executed.

OpenTelemetry

Requirements

  • opentelemetry-api
  • opentelemetry-exporter-otlp
  • opentelemetry-sdk
  • pytest

Installation

You can install "pytest-otel" via pip or using the setup.py script.

pipinstallpytest-otel

Usage

pytest_otel is configured by adding some parameters to the pytest command line. Below are the descriptions:

  • --otel-endpoint: URL for the OpenTelemetry server. (Required). Env variable: OTEL_EXPORTER_OTLP_ENDPOINT
  • --otel-headers: Additional headers to send (i.e.: key1=value1,key2=value2). Env variable: OTEL_EXPORTER_OTLP_HEADERS
  • --otel-service-name: Name of the service. Env variable: OTEL_SERVICE_NAME
  • --otel-session-name: Name for the main span.
  • --otel-traceparent: Trace parent ID. Env variable: TRACEPARENT. See https://www.w3.org/TR/trace-context-1/#trace-context-http-headers-format
  • --otel-insecure: Disables TLS. Env variable: OTEL_EXPORTER_OTLP_INSECURE
pytest--otel-endpointhttps://otelcollector.example.com:4317\
--otel-headers"authorization=Bearer ASWDCcCRFfr"\
--otel-service-namepytest_otel\
--otel-session-name='My_Test_cases'\
--otel-traceparent=00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\
--otel-insecure=False

IMPORTANT: If you use --otel-headers the transaction metadata might expose those arguments with their values. In order to avoid any credentials to be exposed, it's recommended to use the environment variables. For instance, given the above example, a similar one with environment variables can be seen below:

OTEL_EXPORTER_OTLP_ENDPOINT=https://apm.example.com:8200\
OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer ASWDCcCRFfr"\
OTEL_SERVICE_NAME=pytest_otel\
TRACEPARENT=00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\
OTEL_EXPORTER_OTLP_INSECURE=False\
pytest--otel-session-name='My_Test_cases'

Demos

License

Distributed under the terms of the Apache License Version 2.0_ license, "pytest-otel" is free and open source software

Project details

Verified details

These details have been verified by PyPI
Maintainers
๐Ÿ‘ Avatar for kuisathaverat from gravatar.com
kuisathaverat

Unverified details

These details have not been verified by PyPI
Meta
  • License: Apache Software License (Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR U...)
  • Author: Ivan Fernandez Calvo (kuisathaverat)
  • Tags pytest , otel , opentelemetry , debug
  • Requires: Python >=3.8

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

pytest_otel-1.6.0.tar.gz (17.7 kB view details)

Uploaded Source

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

pytest_otel-1.6.0-py2.py3-none-any.whl (14.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest_otel-1.6.0.tar.gz.

File metadata

  • Download URL: pytest_otel-1.6.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pytest_otel-1.6.0.tar.gz
Algorithm Hash digest
SHA256 e20bd42807564944d8621b175ab32c476dbb8f532e19b1209b32fb16c73c3ddc
MD5 d77b85eb187372e0bcb03e6d45604164
BLAKE2b-256 3448c6e1668bfdeb6fcac83b3a7d24ece10dc312f0dbceeb16c64289bc58e610

See more details on using hashes here.

File details

Details for the file pytest_otel-1.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_otel-1.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pytest_otel-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 82e2220b92af6ad8585b1b62478563f7f0ccf598735e313e83a41563aaaeeb98
MD5 41ace45679913cf4a97131087a4fbc30
BLAKE2b-256 14c0d37c0651f65950397668d0e52afa78ca34403b775f7ac677978a68b71c32

See more details on using hashes here.

Supported by

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