Download the PHP package laratel/opentelemetry without Composer

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

OpenTelemetry Laravel Package

Latest Version on Packagist Total Downloads

OpenTelemetry Laravel is a Laravel package that integrates OpenTelemetry for automatic HTTP request tracing, query tracing, metrics collection, and enhanced logging with contextual trace information.


Features


Requirements


Installation

1. Install via Composer


2. Register the Service Provider

Add the service provider to the providers array in config/app.php (this step is optional if your package uses auto-discovery):


3. Publish the Configuration File

Publish the configuration file to your application:

This will create a configuration file at config/opentelemetry.php. Update the settings as needed, such as the OTLP endpoint, excluded routes, and logging configuration.


Configuration

OpenTelemetry Configuration

The config/opentelemetry.php file allows you to configure:


Log Channel Configuration

Add the following configuration to config/logging.php for enhanced OpenTelemetry logging:


Usage

Middleware

The package provides two middleware for automatic tracing and metrics collection:

  1. opentelemetry.metrics: Collects HTTP and system metrics.
  2. opentelemetry.trace: Captures tracing information for HTTP requests and database queries.

Register Middleware in Kernel

To apply middleware globally, add them to the $middleware array in app/Http/Kernel.php:

Register Middleware Aliases

Alternatively, register middleware aliases in the Kernel class:

Use Middleware in Routes

Once aliases are registered, use them in your routes:


Logging

Use the otel log channel for enhanced logging with trace context:

Logs will include trace information and be sent to the configured OpenTelemetry collector.


Automatic Query Tracing

The package automatically traces database queries. Traces include:

You can customize which queries to exclude using the config/opentelemetry.php file.


Custom Instrumentation

Custom Traces

Use the TraceService to create custom traces:

Custom Metrics

Use the MetricsService to create and record custom metrics:


Environment Variables

To configure OpenTelemetry via environment variables, include the following in your .env file:


Example

Here’s an example of integrating the package in a Laravel application:

This will automatically collect traces and metrics for requests to /api/example and send them to the configured OTLP endpoint.


Repository for Related Tools and Configurations

Find a complete repository containing Docker Compose file, configuration files for OpenTelemetry Collector, Prometheus, Tempo, Loki, Promtail and Grafana here.


Contributing

Contributions are welcome! Please fork the repository, create a feature branch, and submit a pull request.


License

This package is open-source software licensed under the MIT license.


All versions of opentelemetry with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
open-telemetry/exporter-otlp Version ^1.1
open-telemetry/sdk Version ^1.1
open-telemetry/transport-grpc Version ^1.1
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.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 laratel/opentelemetry contains the following files

Loading the files please wait ....