Download the PHP package tzabzlat/yii2-sentry without Composer

On this page you can find all versions of the php package tzabzlat/yii2-sentry. 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 yii2-sentry

Yii2 Sentry

Latest Stable Version License PHP Version Require

Read this in other languages: Русский

Complete Sentry integration for Yii2 framework: logging, tracing and profiling.

Features

Installation

Install the package via composer:

For using performance profiling features, you need to install the PHP Excimer extension.

Configuration

Basic Configuration

Add to your application configuration (not common):

Built-in Collectors

The package includes four main collectors, each responsible for its own monitoring area:

1. LogCollector

Collects and sends Yii2 logs with error and warning levels to Sentry. Allows configuring which logs should be sent and which should be ignored.

2. DbCollector

Tracks SQL queries, measures their performance, and creates spans in Sentry for analysis. Automatically marks slow queries. Also tracks database transactions.

3. HttpClientCollector

Tracks outgoing HTTP requests made through Yii2 HttpClient. Measures response time, records response status, and creates spans for visualizing HTTP dependencies.

4. RequestCollector

Tracks incoming HTTP requests to your application. Creates the main transaction for each request and collects information about the controller, action, processing time, and response status.

Usage

Manual Spans for Custom Operations

To create spans manually, use the trace method:

Collector Configuration

You can configure each collector separately through the collectorsConfig parameter:

Disabling Collectors

To disable a specific collector, set its configuration to false:

How Collectors Work

LogCollector

Connects a special LogTarget that intercepts logs with specified levels and sends them to Sentry. Processes exceptions as a separate type of event. Also supports filtering by categories and message patterns.

DbCollector

Overrides the standard Yii2 DbCommand and connects to query profiling events. Measures the execution time of each SQL query, determines the query type (SELECT, INSERT, etc.), and creates spans for visualization in Sentry. Tracks transactions through Connection events.

HttpClientCollector

Subscribes to request sending events through HttpClient. For each request, it creates a span with details of URL, method, headers, and request body (with sanitization of sensitive data). Measures response time and adds information about the response status.

RequestCollector

Creates the main transaction for each incoming HTTP request. Collects information about the route, controller, action, request parameters, and response. Measures the total request processing time and peak memory usage.

Creating a Custom Collector

You can create your own collector by implementing the CollectorInterface or extending the BaseCollector class:

Then add your collector to the configuration:

Contributing

If you found a bug or have suggestions for improvement, feel free to:

License

MIT


All versions of yii2-sentry with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
yiisoft/yii2 Version ~2.0.14
sentry/sentry Version ^4.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 tzabzlat/yii2-sentry contains the following files

Loading the files please wait ....