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

Laravel Open Telemetry Laravel Package

spatie/laravel-open-telemetry

Add OpenTelemetry tracing to Laravel to measure performance and follow requests across dispatched jobs and services. Export traces to tools like Jaeger or Aspecto for end-to-end visibility and debugging. (Package still in development.)

View on GitHub
Deep Wiki
Context7

title: Using drivers weight: 1

Collected Open Telemetry metrics need to be sent to an external service to be collected, aggregated and displayed. How they are sent is handled by different drivers. By default, we use the Http driver, which is configured in the drivers key of the config/open-telemetry.php config file.

/*
 * A driver is responsible for transmitting any measurements.
 */
'drivers' => [
    Spatie\OpenTelemetry\Drivers\HttpDriver::class => [
        'url' => 'http://localhost:9412/api/v2/spans',
    ],
],

Other drivers that are available are the \Spatie\OpenTelemtry\Drivers\MemoryDriver and the \Spatie\OpenTelemetry\Drivers\MultiDriver.

Creating a custom driver

For fine-grained control or crafty ideas, you can use a custom driver. A driver is any class that implements Spatie\OpenTelemetry\Drivers\Driver. This is what this interface looks like:

namespace Spatie\OpenTelemetry\Drivers;

use Spatie\OpenTelemetry\Support\Span;

interface Driver
{
    /**
     * All options set for this driver in the config file will be passed
     * to this method.
     *
     * [@param](https://github.com/param) array<string, string> $options
     *
     * [@return](https://github.com/return) $this
     */
    public function configure(array $options): self;

    public function sendSpan(Span $span);
}

The configure method will be called when the driver is instantiated. All options set in the config file, will be passed to the driver. The sendSpan method will be called whenever a span (measurement) should be sent to the reporting backend.

As example, you can look at the source of the HttpDriver which ships with this package.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport