Download the PHP package keepsuit/laravel-opentelemetry without Composer

On this page you can find all versions of the php package keepsuit/laravel-opentelemetry. 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 laravel-opentelemetry

OpenTelemetry integration for laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

OpenTelemetry is a collection of tools, APIs, and SDKs. Use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior.

This package allow to integrate OpenTelemetry in a Laravel application.

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Traces

This package provides a set of integrations to automatically trace common operations in a Laravel application. You can disable or customize each integration in the config file in the instrumentations section.

Provided tracing integrations

Http server requests

Http server requests are automatically traced by injecting \Keepsuit\LaravelOpenTelemetry\Support\HttpServer\TraceRequestMiddleware::class to the global middlewares. You can disable it by setting OT_INSTRUMENTATION_HTTP_SERVER to false or removing the HttpServerInstrumentation::class from the config file.

Configuration options:

Http client

To trace an outgoing http request call the withTrace method on the request builder.

You can disable it by setting OT_INSTRUMENTATION_HTTP_CLIENT to false or removing the HttpClientInstrumentation::class from the config file.

Configuration options:

Database

Database queries are automatically traced. You can disable it by setting OT_INSTRUMENTATION_QUERY to false or removing the QueryInstrumentation::class from the config file.

Redis

Redis commands are automatically traced. You can disable it by setting OT_INSTRUMENTATION_REDIS to false or removing the RedisInstrumentation::class from the config file.

Queue jobs

Queue jobs are automatically traced. It will automatically create a parent span with kind PRODUCER when a job is dispatched and a child span with kind CONSUMER when the job is executed. You can disable it by setting OT_INSTRUMENTATION_QUEUE to false or removing the QueueInstrumentation::class from the config file.

Logs context

When starting a trace with provided instrumentation, the trace id is automatically injected in the log context. This allows to correlate logs with traces.

If you are starting the root trace manually, you should call Tracer::updateLogContext() to inject the trace id in the log context.

[!NOTE] When using the OpenTelemetry logs driver (otlp), the trace id is automatically injected in the log context without the need to call Tracer::updateLogContext().

Manual traces

Spans can be manually created with the newSpan method on the Tracer facade. This method returns a SpanBuilder instance that can be used to customize and start the span.

The simplest way to create a custom trace is with measure method:

Alternatively you can manage the span manually:

With measure the span is automatically set to active (so it will be used as parent for new spans). With start you have to manually set the span as active:

Other utility methods are available on the Tracer facade:

Logs

This package provides a custom log channel that allows to process logs with OpenTelemetry instrumentation. This packages injects a log channel named otlp that can be used to send logs to OpenTelemetry using laravel default log system.

As an alternative, you can use the Logger facade to send logs directly to OpenTelemetry:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-opentelemetry with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0 || ^11.0
illuminate/support Version ^10.0 || ^11.0
open-telemetry/context Version ^1.0.1
open-telemetry/exporter-otlp Version ^1.0
open-telemetry/sdk Version ^1.0.1
open-telemetry/sem-conv Version ^1.23
spatie/laravel-package-tools Version ^1.16
thecodingmachine/safe Version ^2.0
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 keepsuit/laravel-opentelemetry contains the following files

Loading the files please wait ....