Metadata-Version: 2.4
Name: pico-otel
Version: 0.1.0
Summary: OpenTelemetry auto-instrumentation for the Pico ecosystem: tracing, metrics and log correlation wired by entry points.
Author-email: David Perez Cabrera <dperezcabrera@gmail.com>
License: MIT License
        
        Copyright (c) 2025 David Pérez Cabrera
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/dperezcabrera/pico-otel
Project-URL: Documentation, https://dperezcabrera.github.io/pico-otel/
Project-URL: Repository, https://github.com/dperezcabrera/pico-otel
Project-URL: Changelog, https://github.com/dperezcabrera/pico-otel/blob/main/CHANGELOG.md
Project-URL: Issue Tracker, https://github.com/dperezcabrera/pico-otel/issues
Keywords: opentelemetry,otel,tracing,metrics,observability,ioc,spring boot
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pico-ioc>=2.2.0
Requires-Dist: opentelemetry-sdk>=1.25
Provides-Extra: otlp
Requires-Dist: opentelemetry-exporter-otlp; extra == "otlp"
Provides-Extra: prometheus
Requires-Dist: opentelemetry-exporter-prometheus; extra == "prometheus"
Requires-Dist: prometheus-client; extra == "prometheus"
Provides-Extra: fastapi
Requires-Dist: opentelemetry-instrumentation-fastapi; extra == "fastapi"
Provides-Extra: sqlalchemy
Requires-Dist: opentelemetry-instrumentation-sqlalchemy; extra == "sqlalchemy"
Provides-Extra: celery
Requires-Dist: opentelemetry-instrumentation-celery; extra == "celery"
Provides-Extra: logging
Requires-Dist: opentelemetry-instrumentation-logging; extra == "logging"
Provides-Extra: all
Requires-Dist: pico-otel[celery,fastapi,logging,otlp,prometheus,sqlalchemy]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# 📦 pico-otel

[![PyPI](https://img.shields.io/pypi/v/pico-otel.svg)](https://pypi.org/project/pico-otel/)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/dperezcabrera/pico-otel)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![CI (tox matrix)](https://github.com/dperezcabrera/pico-otel/actions/workflows/ci.yml/badge.svg)
[![codecov](https://codecov.io/gh/dperezcabrera/pico-otel/branch/main/graph/badge.svg)](https://codecov.io/gh/dperezcabrera/pico-otel)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dperezcabrera_pico-otel&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dperezcabrera_pico-otel)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=dperezcabrera_pico-otel&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=dperezcabrera_pico-otel)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=dperezcabrera_pico-otel&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=dperezcabrera_pico-otel)
[![PyPI Downloads](https://img.shields.io/pypi/dm/pico-otel)](https://pypi.org/project/pico-otel/)
[![Docs](https://img.shields.io/badge/Docs-pico--otel-blue?style=flat&logo=readthedocs&logoColor=white)](https://dperezcabrera.github.io/pico-otel/)
[![Interactive Lab](https://img.shields.io/badge/Learn-online-green?style=flat&logo=python&logoColor=white)](https://dperezcabrera.github.io/pico-learn/)

**OpenTelemetry auto-instrumentation** for the [Pico](https://github.com/dperezcabrera/pico-ioc) ecosystem. Install it and your [pico-boot](https://github.com/dperezcabrera/pico-boot) app gets distributed tracing, log correlation and Prometheus metrics — wired by entry points, zero integration code.

## Install

```bash
pip install pico-otel[all]      # or pick: [otlp] [prometheus] [fastapi] [sqlalchemy] [celery] [logging]
```

## What you get

- **Tracing**: FastAPI requests, SQLAlchemy queries and Celery tasks become spans — whichever libraries are present get instrumented, the rest are skipped silently.
- **Metrics**: the OTel meter provider exports to `prometheus_client`'s default registry — the same one [pico-actuator](https://github.com/dperezcabrera/pico-actuator) serves at `/actuator/metrics`. Installing both = probes + metrics + tracing with zero config.
- **Log correlation**: trace/span ids injected into log records.

```yaml
# application.yaml (optional — sensible defaults without it)
otel:
  service_name: my-service
  endpoint: http://otel-collector:4317   # switches export to OTLP
  traces_sample_ratio: 1.0
```

`traces_exporter`: `auto` (OTLP if `endpoint` is set, console otherwise), `otlp`, `console` or `none`. Setup is idempotent per process.

## Documentation

Full docs at **[dperezcabrera.github.io/pico-otel](https://dperezcabrera.github.io/pico-otel/)**.

## License

MIT
