open-telemetry/contrib-aws
AWS integrations for OpenTelemetry PHP: provides an AWS X-Ray propagator and trace ID generator so PHP services can join X-Ray traces and correlate telemetry across AWS services. Install via Composer to add AWS-aware context propagation to your instrumentation.
Architecture fit
open-telemetry/sdk, open-telemetry/exporter-otlp, and open-telemetry/opentelemetry-logger-monolog rather than replacing any of them. That means it inherits contrib-tier stability guarantees, not core-tier ones.X-Amzn-Trace-Id header (Root/Parent/Sampled), and (2) AWS SDK instrumentation helpers — typically middleware that opens a span per AWS API call and injects the trace header so downstream services (Lambda, SQS consumers, ECS tasks, API Gateway) continue the trace.PropagatorInterface chain. The SDK middleware is the higher-risk piece because it attaches to Aws\Sdk/Aws\AwsClient handler stacks and changes the call path for every AWS request.X-Amzn-Trace-Id. Fit is weakest when the trace backend is OTLP-only (Tempo, Jaeger, Datadog, Honeycomb) and AWS services are not in the request path — in that case only the propagator has residual value.Integration feasibility
PropagatorInterface and/or decorate the AWS SDK client in a TelemetryServiceProvider. That is a known and manageable pattern, but it is custom code the team owns.open-telemetry/sdk major/minor constraint (contrib packages routinely lag core by a release cycle), AWS SDK for PHP v3 presence, and whether AsyncAws clients are in use — the latter will likely not be covered and would need separate instrumentation.traceparent. Trace ID widths, the epoch-timestamp prefix, and sample-flag semantics differ. A composite propagator (tracecontext,baggage,xray) is the standard answer, but ordering and the lossy conversion are the most likely source of "trace broken in one direction only" bugs.Technical risk
Key questions
Aws\Sdk calls in request path) or asynchronous (SQS/SNS fan-out, Lambda handlers)?Aws\Sdk v3 exclusively, or are there AsyncAws / raw cURL / presigned-URL paths that will bypass the middleware?open-telemetry/sdk version, and does this package's constraint intersect with it without a downgrade?Stack fit
open-telemetry/sdk ^1.x, aws/aws-sdk-php ^3.x. The package slots in as an additive dependency with no framework coupling.config/telemetry.php plus env (OTEL_PROPAGATORS, OTEL_TRACES_SAMPLER, OTEL_EXPORTER_OTLP_ENDPOINT), consistent with the OTel spec so that non-Laravel services in the estate behave identically.TelemetryServiceProvider; use singleton bindings for the propagator and a decorated client factory. Avoid touching AppServiceProvider — this keeps the blast radius of a rollback to one file.Migration path
X-Amzn-Trace-Id flows inbound on requests originating from AWS edge services (ALB, API Gateway, Lambda) without altering outbound behavior.Compatibility
composer require open-telemetry/contrib-aws:x.y.z) and commit the lockfile. Do not use a caret range on a 0.x contrib package.open-telemetry/sdk constraint on every core SDK bump; a contrib package lagging one minor behind is normal and will block core upgrades.Sequencing
AsyncAws usage, Octane usage) and a spike in a non-production service.Maintenance
Support
#otel-php). No Laravel-specific documentation, no recipes, no Stack Overflow corpus — every integration question is a first-principles question.Scaling
BatchSpanProcessor queue size and flush interval against the worker runtime, not the request runtime.Failure modes
S3Client::putObject and fails a real operation. Wrap defensively; never let instrumentation throw into the call path.Ramp-up
How can I help you explore Laravel packages today?