PHPackages                             cognesy/instructor-telemetry - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cognesy/instructor-telemetry

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cognesy/instructor-telemetry
============================

Backend-neutral telemetry core for Instructor PHP

v2.3.1(2mo ago)007MITPHPPHP ^8.3

Since Mar 30Pushed 2mo agoCompare

[ Source](https://github.com/cognesy/instructor-telemetry)[ Packagist](https://packagist.org/packages/cognesy/instructor-telemetry)[ Docs](https://instructorphp.com)[ RSS](/packages/cognesy-instructor-telemetry/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (10)Versions (3)Used By (7)

Telemetry Package
=================

[](#telemetry-package)

Backend-neutral telemetry core for Instructor PHP.

Use it to correlate spans across runtimes and export them to OTEL, Logfire, or Langfuse.

Live Interop Tests
------------------

[](#live-interop-tests)

The package now includes env-gated live backend interop tests under `packages/telemetry/tests/Integration`.

Use them to prove both:

- write-path export to Logfire or Langfuse
- read-path queryback through the backend API

Run from the monorepo root:

```
TELEMETRY_INTEROP_ENABLED=1 composer test:telemetry-interop
```

Required env:

- Logfire: `LOGFIRE_TOKEN`, `LOGFIRE_OTLP_ENDPOINT`, `LOGFIRE_READ_TOKEN`
- Langfuse: `LANGFUSE_BASE_URL`, `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`
- inference, streaming, and agent runtime smoke tests also require `OPENAI_API_KEY`
- AgentCtrl smoke tests also require a usable `codex` CLI in `PATH`and a working Codex authentication/configuration state

The suite is opt-in by design. Without `TELEMETRY_INTEROP_ENABLED=1`, the integration tests skip cleanly.

Example
-------

[](#example)

```
