Metadata-Version: 2.2
Name: domprob
Version: 0.1.0a1
Summary: Python package to implement observability domain probes
License: MIT
Project-URL: Documentation, https://domprob.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/tenyo-app/pydomprob
Project-URL: Issues, https://github.com/tenyo-app/pydomprob/issues
Keywords: logging,observability,domain-probe
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# domprob 🛰️
Inspired by [this blog post](https://martinfowler.com/articles/domain-oriented-observability.html), domprob is designed
to be a Python package to implement observability domain probes. View the documentation
[here](https://domprob.readthedocs.io/en/latest/).

## Overview

Keep your business logic tidy and abstract the observability code away.

**Turn this:**

```python
class Order:
    def checkout(self):
        self.logger.log(f"Attempting to checkout order {self.order}")
        try:
            self.checkout_service.checkout_order(self.order)
        except CheckoutError as e:
            self.logger.error(f"Checkout for order {self.order} failed: {e}")
            self.metrics.increment('checkout-failed', ('failed_orders': 1))
            return
        self.logger.log(f"Order checkout completed successfully")
        self.metrics.increment('checkout-successful', ('successful_orders': 1))
```

**Into ✨this✨:**

```python
class Order:
    def checkout(self):
        self.probe.announce(AttemptingCheckoutObservation())
        try:
            self.checkout_service.checkout_order(self.order)
        except CheckoutError as e:
            self.probe.announce(CheckoutFailedObservation())
            return
        self.probe.announce(CheckoutSuccessfulObservation())
```

## Installation

Install using uv:

```shell
uv add domprob
```

Using pip:

```shell
pip install domprob
```

Using poetry:

```shell
poetry add domprob
```

## Usage
