Metadata-Version: 2.4
Name: openinference-instrumentation-codex
Version: 0.5.1
Summary: OpenInference traces for persisted Codex sessions and native OTLP telemetry
Author: OpenInference
License: Apache-2.0
License-File: LICENSE
Keywords: codex,openinference,opentelemetry,tracing
Requires-Python: <3.14,>=3.10
Requires-Dist: openinference-semantic-conventions>=0.1.0
Requires-Dist: opentelemetry-api>=1.25.0
Provides-Extra: otlp
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.25.0; extra == 'otlp'
Requires-Dist: opentelemetry-sdk>=1.25.0; extra == 'otlp'
Provides-Extra: test
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.25.0; extra == 'test'
Requires-Dist: opentelemetry-sdk>=1.25.0; extra == 'test'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
Requires-Dist: pytest>=8.0.0; extra == 'test'
Requires-Dist: ruff>=0.5.0; extra == 'test'
Description-Content-Type: text/markdown

# openinference-instrumentation-codex

This PyPI package exports Codex activity as OpenInference `codex.turn` traces from persisted sessions or native OTLP telemetry

## Install

```bash
python -m pip install "openinference-instrumentation-codex[otlp]"
```

## Quick Start

### Persisted Sessions

```bash
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:6006/v1/traces

codex-jsonl-forwarder --codex-home "${CODEX_HOME:-$HOME/.codex}" \
  --state-path .run/codex-jsonl-forwarder-state.json
```

### Native OTLP

Create the receiver configuration in [docs/AGENTS.details.md](docs/AGENTS.details.md#native-otlp-configuration), then run

```bash
codex-otlp-interceptor --config codex-interceptor.toml
curl --fail http://127.0.0.1:4318/readyz
```

## Surface Map

| Surface | Input | Output |
| --- | --- | --- |
| `codex-jsonl-forwarder` | `$CODEX_HOME/sessions/**/*.jsonl` | Standalone OpenInference turn traces |
| `codex-otlp-interceptor` | Native OTLP logs and traces | Native-timed OpenInference turn traces |

## Repo Map

| Path | Purpose |
| --- | --- |
| `src/openinference/instrumentation/codex/` | Package implementation |
| `tests/` | Unit, integration, end-to-end, and evidence coverage |
| `tests/fixtures/native_otlp/` | Reviewed native telemetry summaries |
| `scripts/` | Capture, smoke, and artifact helpers |
| `examples/` | Minimal Python examples |
| `docs/` | Detailed guidance and diagrams |
| `.github/` | CI and package publishing workflows |

## Documentation

| Document | Purpose |
| --- | --- |
| [AGENTS.md](AGENTS.md) | Repo routing and quick start |
| [docs/AGENTS.details.md](docs/AGENTS.details.md) | Contracts, configuration, evidence, and validation |
| [docs/DIAGRAMS.md](docs/DIAGRAMS.md) | Package data-flow diagrams |
| [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) | Contribution guide |
| [docs/SECURITY.md](docs/SECURITY.md) | Security reporting |
| [CHANGELOG.md](CHANGELOG.md) | Release history |
