Download the PHP package napp/xray-laravel without Composer

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

Aws X-Ray for Laravel

Latest Version on Packagist

The package automatically trace your laravel application and sends to AWS X-Ray.

What is X-Ray?

X-Ray is a distributed tracing system for production apps. AWS X-Ray traces user requests as they travel through your entire application. It aggregates the data generated by the individual services and resources that make up your application, providing you an end-to-end view of how your application is performing.

X-Ray for Laravel

This package enables automatic tracing of important parts of your application, such as http request, database queries, views and queue jobs. Those parts are being traced and sent to AWS X-Ray for you to improve performance.

Below is a simple example of a http request with a database query. This query is quite slow and could maybe be optimized or cached.

timeline

Each element has extra information, such as the database query stack trace.

db-stack

Installation

  1. Install the package via composer:

  2. Add middleware to the top of the global middleware in App\Http\Kernel.php.

  3. Add XrayServiceProvider to the very top of providers in config/app.php.

Optionally, you can add the facade in config/app.php.

  1. Edit the AWS Execution role to include X-Ray permissions.

Either add the preexisting policy from AWS AWSXrayWriteOnlyAccess, or create your own:

  1. Head over to AWS Console, to Lambda and find your function. Activate X-Ray Tracing.

Activate

Manually use the Tracer

Lets say you want to trace a specific piece of your code to deeply understand the impact on performance.

Another use case is to inspect some heavy php side parsing of data.

The above results in:

XML-example

Request filtering

There might be some requests you wish not to track in Amazon X-Ray. In order to filter out those requests, you can call the addRequestFilterCallback function, on the Xray facade. This function takes a callback as a parameter. The callback takes a Symfony\Component\HttpFoundation\Request as a parameter and is expected to return a boolean.

Please note that this function call needs to be done in the register function of your AppServiceProvider. You should, also, keep the checks relatively simple, since most of the application service providers won't be booted when calling the filtering callbacks.

When LaravelXray is booting, the request is checked against each registered callbacks. If none returns false, the request is captured. Otherwise, it is not.

Daemon support

The X-Ray daemon is automatically run in a Lambda environment. Use this over the default Napp\Xray\Submission\APISegmentSubmitter to relay requests to Amazon X-Ray.

Firstly, publish the X-Ray config and then update the submitter in config/xray.php to \Napp\Xray\Submission\DaemonSegmentSubmitter::class

The daemon submitter will pick up the _AWS_XRAY_DAEMON_ADDRESS _AWS_XRAY_DAEMON_PORT. These environment variables are injected for you if using a service like Laravel Vapor

Disable Tracer

If you want to disable the Tracer, just add to the .env file.

What Tracers are supported

LICENSE

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


All versions of xray-laravel with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
php Version ^7.2|^8.0|^8.1
illuminate/console Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
pkerrigan/xray Version ^1.2
aws/aws-sdk-php Version ^3.133
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 napp/xray-laravel contains the following files

Loading the files please wait ....