Skip to content

Add OpenAI Responses API instrumentation - #80

Merged
piotrekno1 merged 1 commit into
develfrom
feat/openai-responses
Oct 20, 2026
Merged

piotrekno1 merged 1 commit into
develfrom
feat/openai-responses

Conversation

@piotrekno1

Copy link
Copy Markdown
Collaborator

The OpenAI integration currently instruments only Chat Completions, so applications using client.responses.create() produce no inference telemetry. This adds Responses instrumentation for sync and async clients, with and without streaming, while preserving support for older SDK versions that lack a Responses resource.

Records input/output usage, cached and reasoning tokens, resolved model metadata, response status or incomplete reason, and unsuccessful failed responses. Streaming TTFT measures the first nonempty output delta rather than lifecycle events such as response.created. Input iterables are not consumed by instrumentation.

Includes a runnable example covering all four paths, provider documentation, unit tests, and compatibility tests using the real OpenAI SDK with mocked HTTP.

Validation

  • Ruff lint and formatting pass.
  • Full suite: 726 passed, 28 skipped. OpenAI compatibility suite: 8 passed against openai 3.35.1.
  • Ran the example's four paths against the process-compose local WildEdge stack with deterministic mocked OpenAI HTTP responses: ingest accepted 8 events, rejected 0; queried Iceberg and confirmed four inference events and four parent spans, one trace, correct input/output usage, cached/reasoning tokens, and TTFT on both streamed calls. Run ID: responses-local-e2e-c5b6cd894065.
  • Live OpenAI requests were not tested; fixture token counts and timings do not represent real model behavior.

Scope

This PR covers responses.create(). Embeddings, individual tool spans, background response polling, early stream closure, and cancellation are follow-up work. Streams must be consumed to exhaustion to record their terminal response and usage.

@github-actions

Copy link
Copy Markdown

Coverage report

  • Total: 88% (10182/11601 lines)

Top uncovered files

  • wildedge/integrations/mlx.py: 28.7% (122 lines missed)
  • wildedge/integrations/transformers.py: 62.9% (112 lines missed)
  • wildedge/integrations/ultralytics.py: 67.7% (86 lines missed)
  • wildedge/integrations/pytorch.py: 57.5% (79 lines missed)
  • wildedge/platforms/macos.py: 56.8% (67 lines missed)

@piotrekno1
piotrekno1 merged commit 0ede5c6 into devel Oct 20, 2026
14 checks passed
@piotrekno1
piotrekno1 deleted the feat/openai-responses branch October 20, 2026 15:59
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant