Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sdk Laravel Package

open-telemetry/sdk

OpenTelemetry PHP SDK for generating traces, metrics, and logs. Implements the API and works with exporters to emit telemetry. Supports manual setup, an SDK builder, and optional auto-registration via environment variables during Composer autoload.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Observability Roadmap: Enables adoption of OpenTelemetry as a standardized, vendor-neutral observability framework for PHP/Laravel applications, aligning with industry trends (e.g., CNCF-backed). Justifies investment in distributed tracing, metrics, and logging as first-class observability pillars.
  • Build vs. Buy: Buy—avoids reinventing telemetry collection, instrumentation, and export logic. Leverages OpenTelemetry’s ecosystem (e.g., Jaeger, Prometheus, Zipkin) for backend integration.
  • Use Cases:
    • Debugging: Correlate requests across microservices (e.g., Laravel + queues + external APIs).
    • Performance: Identify bottlenecks via traces (e.g., slow database queries, external API calls).
    • Reliability: Monitor error rates, latency, and resource usage (CPU, memory) via metrics.
    • Compliance: Standardized logging with structured attributes for audit trails.
  • Feature Prioritization:
    • Phase 1: Instrument core Laravel components (HTTP requests, jobs, database queries) with auto-instrumentation.
    • Phase 2: Integrate with OTLP exporters (e.g., send traces to Grafana Tempo, metrics to Prometheus).
    • Phase 3: Add custom instrumentation for business-critical flows (e.g., payment processing).
  • Tech Stack Alignment:
    • Laravel-Specific: Replace ad-hoc logging (e.g., Log::channel()) with structured telemetry.
    • Cloud-Native: Enable seamless integration with AWS X-Ray, Google Cloud Trace, or Azure Monitor.

When to Consider This Package

  • Adopt if:

    • Your Laravel app is distributed (multiple services, microservices, or external dependencies).
    • You need standardized observability (avoid vendor lock-in; e.g., switch from New Relic to Datadog later).
    • You’re already using OpenTelemetry in other languages (Java, Go) and want consistency.
    • You require fine-grained control over sampling (e.g., cost optimization for high-throughput systems).
    • Your team prioritizes developer experience (auto-instrumentation reduces boilerplate).
  • Look elsewhere if:

    • Your app is monolithic with minimal external dependencies (simple Laravel logging may suffice).
    • You lack backend observability tools (e.g., no APM, metrics, or logging platforms).
    • Your team lacks DevOps/SRE expertise to configure exporters (e.g., OTLP, Jaeger).
    • You need real-user monitoring (RUM) (use dedicated tools like Sentry or Datadog APM).
    • You’re constrained by PHP version (e.g., <8.1; check compatibility with your Laravel version).

How to Pitch It (Stakeholders)

For Executives:

"OpenTelemetry is the industry-standard for observability, and this PHP SDK lets us instrument our Laravel apps with traces, metrics, and logs—without vendor lock-in. Think of it as ‘Google Analytics for backend systems’: we’ll track performance bottlenecks, debug distributed transactions, and reduce MTTR (mean time to resolve issues). Early adopters like Shopify and Comcast use it to cut costs and improve reliability. This is a strategic investment in scalability and operational excellence."

Key Outcomes: ✅ Proactive issue detection (e.g., slow API calls before users complain). ✅ Cost savings (avoid per-request APM tooling; self-host exporters if needed). ✅ Future-proofing (works with any backend tool; e.g., switch from Datadog to Prometheus later).


For Engineering:

*"This SDK gives us OpenTelemetry’s full power in PHP:

  • Auto-instrumentation: Trace HTTP requests, database queries, and jobs with minimal code.
  • Metrics: Track custom business KPIs (e.g., orders_processed, payment_failures).
  • Logs + Traces: Correlate logs to traces for debugging (e.g., find which user triggered a 500 error).
  • Sampling: Control telemetry volume to reduce costs (e.g., sample 1% of requests in production).

Implementation Plan:

  1. Pilot: Instrument a high-traffic Laravel service (e.g., API gateway).
  2. Export: Send data to OTLP-compatible backends (e.g., Grafana Tempo + Loki).
  3. Alerts: Set up dashboards for latency, error rates, and custom metrics.

Why Not [Alternative X]?

  • New Relic/Datadog: Vendor lock-in; higher cost at scale.
  • Custom Logging: No traces/metrics; harder to debug distributed systems.
  • Prometheus Client: Metrics only; lacks traces/logs correlation.

Next Steps:

  • Review examples.
  • Test auto-instrumentation with OTEL_PHP_AUTOLOAD_ENABLED=true.
  • Pair with Laravel Telescope for local debugging during development."*

Risk Mitigation:

  • Start with non-production environments.
  • Use OTLP’s file exporter for initial testing (no backend needed).
  • Monitor performance overhead (expect <5% latency increase)."
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi