Download the PHP package waffle-commons/telemetry-otel without Composer

On this page you can find all versions of the php package waffle-commons/telemetry-otel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telemetry-otel

Discord PHP Version Require PHP CI codecov Latest Stable Version Packagist License

Waffle Telemetry β€” OpenTelemetry Bridge

Release: 0.1.0-beta6  |  CHANGELOG.md RFC: RFC-005 (OBS-02) β€” OpenTelemetry SDK bridge

OpenTelemetry SDK bridge for the Waffle Commons framework. It implements Waffle\Commons\Contracts\Telemetry\TracerInterface on top of the audited OpenTelemetry PHP SDK and propagates W3C Trace Context on outbound HTTP calls β€” isolating the vendor SDK in this adapter so the core packages stay vendor-free. The SDK-free defaults, the Prometheus endpoint, and the metric collectors live in the companion waffle-commons/telemetry package.

πŸ“¦ Installation

Pulls in open-telemetry/api + open-telemetry/sdk as runtime dependencies β€” this package is the only place in the Waffle ecosystem where the OTel SDK is allowed.

🧱 Surface

Class Role
Waffle\Commons\TelemetryOtel\Trace\OtelTracer final readonly adapter of an OTel TracerInterface to the framework's Contracts\Telemetry\TracerInterface. Activates each started span so nested spans compose through OTel's own context stack.
Waffle\Commons\TelemetryOtel\Trace\OtelSpan final readonly adapter of an OTel span (plus its active ScopeInterface) to Contracts\Telemetry\SpanInterface. end() detaches the scope, then ends the span.
Waffle\Commons\TelemetryOtel\Trace\OtelSpanContext final readonly adapter of an OTel span context to Contracts\Telemetry\SpanContextInterface; renders a W3C traceparent string via toTraceparent().
Waffle\Commons\TelemetryOtel\Propagation\W3CTraceContextPropagator final readonly TextMapPropagatorInterface β€” inject() serialises the Waffle span context as traceparent/tracestate; extract() delegates to OTel's audited TraceContextPropagator for parsing.
Waffle\Commons\TelemetryOtel\Factory\OtelTracerFactory Static factory assembling a ready-to-use OtelTracer from any SpanExporterInterface, or console() for a zero-dependency JSON exporter to php://stdout.

πŸš€ Usage

Registered as shared services, $tracer and $propagator are consumed unmodified by waffle-commons/telemetry's TracingMiddleware (per-request server span + inbound traceparent extraction) and by waffle-commons/http-client's Client (outbound traceparent propagation) β€” one end-to-end trace across both directions of a request, with zero code in either package aware that OpenTelemetry exists.

πŸ”€ Span-kind mapping

OtelTracer::startSpan() translates the framework's Contracts\Telemetry\Enum\SpanKind 1:1 onto the OTel API's SpanKind constants:

Contracts\Telemetry\Enum\SpanKind OTel SpanKind
Internal KIND_INTERNAL
Server KIND_SERVER
Client KIND_CLIENT
Producer KIND_PRODUCER
Consumer KIND_CONSUMER

When an explicit $parent span context is supplied β€” typically one extracted from an inbound traceparent by W3CTraceContextPropagator::extract() β€” the new span continues that remote trace via OtelApiSpanContext::createFromRemoteParent(); otherwise it parents off OTel's own active context, so nested startSpan() calls compose naturally without threading a context object through every call site.

🐘 PHP 8.5 features used

🧭 Perimeter

The only Waffle package permitted to require the OpenTelemetry SDK (open-telemetry/*) β€” mago guard's [guard.perimeter] in mago.toml allows the OpenTelemetry\** namespace here and nowhere else in the ecosystem. Otherwise depends only on waffle-commons/contracts; production code under Waffle\Commons\TelemetryOtel may depend only on itself, Contracts\**, the OTel SDK, Psr\**, and PHP core / Psl\**. Test code under WaffleTests\Commons\TelemetryOtel is unrestricted (@all).

Contract-first, component-agnostic by construction: components compose through waffle-commons/contracts, never directly through one another.

🧡 Worker safety

Every adapter (OtelTracer, OtelSpan, OtelSpanContext, W3CTraceContextPropagator) is final readonly and holds no per-request mutable state of its own β€” the OpenTelemetry SDK owns the active-context stack internally, and a SimpleSpanProcessor exports each span synchronously on end() so nothing is buffered across requests waiting on a background flush. There is nothing here for a FrankenPHP worker to leak between requests (wfl igor 0 KO).

πŸ§ͺ Testing

πŸ“š Documentation

Central framework docs (DiΓ‘taxis) for this component:

πŸ“„ License

MIT β€” see LICENSE.md.


All versions of telemetry-otel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
waffle-commons/contracts Version self.version
open-telemetry/api Version ^1.0
open-telemetry/sdk Version ^1.0
symfony/http-client Version ^8.1
nyholm/psr7 Version ^1.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package waffle-commons/telemetry-otel contains the following files

Loading the files please wait ...