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

Api Laravel Package

open-telemetry/api

OpenTelemetry API for PHP: vendor-neutral interfaces for tracing, metrics, and context propagation. Use it to instrument libraries/apps and connect to any OpenTelemetry SDK/exporter. Part of the OpenTelemetry PHP project (subtree split).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Observability Roadmap: Enables standardized instrumentation for distributed tracing, metrics, and logging across PHP/Laravel applications, aligning with OpenTelemetry’s vendor-neutral ecosystem. Critical for teams adopting SRE/DevOps practices or migrating from legacy monitoring tools (e.g., New Relic, Datadog).
  • Build vs. Buy: Buy—avoids reinventing observability infrastructure. The package provides interoperable APIs for traces (spans), metrics, and logs, reducing vendor lock-in while integrating with backends like Jaeger, Prometheus, or Honeycomb.
  • Use Cases:
    • Performance Debugging: Track latency in microservices (e.g., Laravel queues, API calls) with distributed traces.
    • Resource Optimization: Monitor CPU/memory usage via metrics (e.g., Meter API) for auto-scaling decisions.
    • Context Propagation: Correlate logs, traces, and metrics across services using baggage and W3C Trace Context.
    • Compliance/Audit: Log structured events (e.g., Logger::logRecordBuilder()) for security/regulatory needs.
  • Tech Debt Reduction: Replaces ad-hoc logging/tracing (e.g., Monolog + custom spans) with a standardized, future-proof API. Deprecations (e.g., InstrumentationInterface) signal active maintenance.
  • Multi-Cloud/Hybrid: Enables portable telemetry for Laravel apps deployed across AWS, GCP, or on-premises.

When to Consider This Package

Adopt If:

  • Your Laravel app has ≥3 microservices or external dependencies (e.g., queues, APIs) requiring end-to-end tracing.
  • You need metrics (e.g., request rates, error budgets) for SLO-based alerting (integrates with Prometheus/Grafana).
  • Logs and traces must be correlated (e.g., debug a failed payment flow spanning Laravel, Stripe, and a database).
  • You’re migrating from proprietary tools (e.g., New Relic) or need vendor-neutral observability.
  • Your team uses PHP 8.1+ (dropped PHP 7.4/8.0 support in v1.1.0beta1).
  • You want to future-proof instrumentation (OpenTelemetry is a CNCF project with broad industry adoption).

Look Elsewhere If:

  • You only need basic logging (use Monolog or Laravel’s built-in logger).
  • Your app is monolithic with no distributed components (overhead may not justify benefits).
  • You’re constrained by legacy PHP versions (<8.1) or lack composer/PHP 8.0+ support.
  • Your observability stack is fully proprietary (e.g., Datadog APM) with no OpenTelemetry integration plans.
  • You prioritize real-time dashboards over trace analysis (consider Prometheus + Grafana directly).

How to Pitch It (Stakeholders)

For Executives:

"This is the ‘PostgreSQL of observability’ for our Laravel stack. By adopting OpenTelemetry’s PHP API, we standardize how we collect traces, metrics, and logs—just like we standardized our database layer. This gives us:

  • Cost savings: Avoid vendor lock-in (e.g., New Relic) and reduce tooling sprawl.
  • Scalability: Instrument microservices uniformly, whether in AWS, GCP, or on-prem.
  • Compliance: Structured logs and traces simplify audits (e.g., GDPR, SOC2).
  • Future-proofing: OpenTelemetry is backed by Google, IBM, and Microsoft—our telemetry data will work with any modern backend. We’re not just adding features; we’re building a foundational layer that will pay dividends as we scale."

For Engineering:

"This package gives us:

  • Distributed Tracing: Track requests across Laravel, queues, and external APIs with spans (e.g., Span::start()).
  • Metrics First: Define custom metrics (e.g., Meter::createCounter()) for SLOs without reinventing wheels.
  • Context Propagation: Automatically correlate logs, traces, and metrics using W3C Trace Context (no more manual X-Request-ID headers).
  • Laravel Integration: Works alongside existing tools (e.g., Horizon for queues) via auto-instrumentation hooks.
  • No Black Box: OpenTelemetry is vendor-neutral; we control where data goes (e.g., Jaeger, Datadog, or our own backend). Implementation: Add open-telemetry/api to composer.json, configure a backend (e.g., OTLP exporter), and instrument critical paths. The team can start with traces for APIs and expand to metrics/logs later."*

For DevOps/SRE:

"This solves:

  • Debugging Latency: Pinpoint slow queries or external API calls in distributed traces (e.g., Laravel + Stripe).
  • Alerting: Define metrics (e.g., http.server.duration) for SLO-based alerts (integrates with Prometheus).
  • Log Correlation: Attach traces to logs (e.g., Logger::logRecordBuilder()) to debug production issues faster.
  • Cost Control: Export data to cheaper backends (e.g., Thanos for Prometheus) instead of proprietary tools. Example: If our payment service fails, we’ll see the full trace from the Laravel API → queue → Stripe → database, not just logs."*
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
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata