Skip to main content

OpenInference traces for persisted Codex sessions and native OTLP telemetry

Project description

openinference-instrumentation-codex

This package exports Codex activity as OpenInference codex.turn traces from persisted session files or native OTLP telemetry.

Prerequisites

Goal Requirements
Install and run the package Python >=3.10,<3.14 and an OTLP trace destination
Forward persisted sessions Read access to $CODEX_HOME/sessions/**/*.jsonl
Receive native telemetry A Codex producer configured to send OTLP logs and traces
Run development workflows make, uv, and Docker for container or Phoenix checks

Quick Start

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

export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:6006/v1/traces
export OTEL_RESOURCE_ATTRIBUTES='openinference.project.name=codex-local'

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

Persisted-session forwarding can include prompts, responses, and tool results. Restrict the destination or configure the relevant OPENINFERENCE_CODEX_CAPTURE_* values before processing sensitive sessions.

Surfaces

Surface Primary use
codex-jsonl-forwarder Export existing or watched persisted sessions
codex-otlp-interceptor Receive native Codex OTLP logs and traces
codex-session-enricher Add persisted-session content to an existing native turn

Repo Map

Path Use it for
src/openinference/instrumentation/codex/ Package implementation and CLI entrypoints
tests/ Unit, integration, end-to-end, and evidence-backed coverage
scripts/ Capture, smoke, and artifact-validation helpers
examples/ Example package usage
docs/ Detailed contracts, diagrams, and human project docs

Documentation

Document Use it for
AGENTS.md Concise file routing
docs/AGENTS.details.md Surface contracts, mappings, evidence, tooling, and validation
docs/DIAGRAMS.md Visual package-flow orientation
docs/CONTRIBUTING.md Contribution expectations
docs/SECURITY.md Vulnerability reporting
CHANGELOG.md Release history

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openinference_instrumentation_codex-0.4.0.tar.gz (117.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file openinference_instrumentation_codex-0.4.0.tar.gz.

File metadata

File hashes

Hashes for openinference_instrumentation_codex-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5ea3cd712e0dfe90e8c908c8c9983685db4c789f465b5db59ab88836ca972c6e
MD5 35215496a3aeeafe4f6e8fbffffc1ec5
BLAKE2b-256 23ac7a32fc99e662d3f597a97fbfa1d44ae06577a0214b19dc16e5666164ac46

See more details on using hashes here.

Provenance

The following attestation bundles were made for openinference_instrumentation_codex-0.4.0.tar.gz:

Publisher: publish-package.yaml on openai-codex-demo/openinference-instrumentation-codex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openinference_instrumentation_codex-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openinference_instrumentation_codex-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa3c4bfbf3ad61f1a8da8e6754258c36ba27001f1b94bbd62b9f0d91a8a166f8
MD5 119b17700b5909345f13baed1e35800a
BLAKE2b-256 49f82dbad36c0e7035004793976231c4088ffec4402a2495a84fbcecf9f42a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for openinference_instrumentation_codex-0.4.0-py3-none-any.whl:

Publisher: publish-package.yaml on openai-codex-demo/openinference-instrumentation-codex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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