Skip to main content

Pip.Services Logo
Observability Components for Python

This module is a part of the Pip.Services polyglot microservices toolkit.

The Observability module contains observability component definitions that can be used to build applications and services.

The module contains the following packages:

  • Count - performance counters
  • Log - basic logging components that provide console and composite logging, as well as an interface for developing custom loggers
  • Trace - tracing components

Quick links:

Use

Install the Python package as

pip install pip_services4_observability

Example how to use Logging and Performance counters. Here we are going to use CompositeLogger and CompositeCounters components. They will pass through calls to loggers and counters that are set in references.

class MyComponent(IConfigurable, IReferenceable):
    __logger = CompositeLogger()
    __counters = CompositeCounters()

    def configure(self, config):
        self.__logger.configure(config)

    def set_references(self, references):
        self.__logger.set_references(references)
        self.__counters.set_references(references)

    def my_method(self, context, param1):
        try:
            self.__logger.trace(context, "Executed method mycomponent.mymethod")
            self.__counters.increment("mycomponent.mymethod.exec_count", 1)
            timing = self.__counters.begin_timing("mycomponent.mymethod.exec_time")
            # ...
            timing.end_timing()
        except Exception as ex:
            self.__logger.error(context, ex, "Failed to execute mycomponent.mymethod")
            self.__counters.increment("mycomponent.mymethod.error_count", 1)

Develop

For development you shall install the following prerequisites:

  • Python 3.7+
  • Visual Studio Code or another IDE of your choice
  • Docker

Install dependencies:

pip install -r requirements.txt

Run automated tests:

python test.py

Generate API documentation:

./docgen.ps1

Before committing changes run dockerized build and test as:

./build.ps1
./test.ps1
./clear.ps1

Contacts

The initial implementation is done by Sergey Seroukhov. Pip.Services team is looking for volunteers to take ownership over Python implementation in the project.

Metadata

Release files for pip-services4-observability 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pip-services4-observability 0.0.5
File Size Uploaded Provenance
pip_services4_observability-0.0.5.tar.gz 22.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pip-services4-observability 0.0.5
File Interpreter ABI Platform
pip_services4_observability-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 60.9 kB

Release files / pip_services4_observability-0.0.5.tar.gz

Download URL pip_services4_observability-0.0.5.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
93262ff745e25b5a91f6e1b19ff37415907257d036db8a3f6bee0e684d4deec9
BLAKE2b-256 checksum
How to use checksums
e0f8e679c96ec56ba1fe59bcc8b561d9cf6770a7c597e4a16a5cc04e2911b6c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / pip_services4_observability-0.0.5-py3-none-any.whl

Download URL pip_services4_observability-0.0.5-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c28d0d8ca9474a1c1513863ce581f53e8f8896b4344d6e46912711d8188e825
BLAKE2b-256 checksum
How to use checksums
5b32774ec5bfcf2a6f7fc2233586b3d25d99927e44ccc3a07f3afe99724d9ac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for pip-services4-observability 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page