https://github.com/miquido/request-data-collector-guzzle
The project was made by Miquido. https://www.miquido.com/
https://github.com/miquido/request-data-collector-guzzle
guzzle laravel monitoring php
Last synced: 2 months ago
JSON representation
The project was made by Miquido. https://www.miquido.com/
- Host: GitHub
- URL: https://github.com/miquido/request-data-collector-guzzle
- Owner: miquido
- License: apache-2.0
- Created: 2019-03-26T15:26:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-18T11:05:48.000Z (almost 5 years ago)
- Last Synced: 2025-01-04T06:16:48.015Z (over 1 year ago)
- Topics: guzzle, laravel, monitoring, php
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Request Data Collector - Guzzle collector
This package is an extension to the Request Data Collector. Allows collecting Guzzle requests.
[](https://github.com/miquido/request-data-collector-guzzle/blob/master/LICENSE)
[](https://github.com/miquido/request-data-collector-guzzle/actions?query=branch%3Amaster)
## Set up
### GuzzleCollector
This collector is being used to collect data about performed Guzzle requests.
```php
'guzzle' => [
'driver' => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::class,
'decorate' => [
'with' => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\Guzzle6ClientDecorator::class,
'abstracts' => [
abstract => [
'type' => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::TYPE_*,
'create' => boolean,
'collect' => [
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_BY,
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_VIA,
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_METHOD,
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_URI,
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_HEADERS,
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_OPTIONS,
],
],
// ...
],
],
],
```
#### decorate.with
Defines Guzzle Client decorator class responsible for collecting requests.
#### decorate.abstracts
Defines a list of Guzzle Clients registered in the container. All abstracts will be decorated with class defined in `decorate.with`.
Every abstract is being defined in following way:
```php
abstract => [
'type' => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::TYPE_*,
'create' => boolean,
'collect' => [
// \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_*
],
],
```
**abstract** is the name under which instance has been registered in the container (e.g. `my-guzzle-client` or `\GuzzleHttp\ClientInterface::class`).
**type** defines the type of abstract (see `\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::TYPE_*` constants).
**collect** defines list of request's information that should be logged (see `\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_*` constants). If missing, all information will be used. The `times` information will always be available.
Additionally, You can include and exclude headers (case-insensitive). Remember, that **inclusions have priority over exclusions**.
```php
abstract => [
// ...
'collect' => [
\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_HEADERS => [
// We don't want Authorization header to be present in logs
'excludes' => [
'Authorization'
],
// From all headers that has been sent, only those are interesting for us
'includes' => [
'Accept',
'content-type',
],
],
],
],
```
When **create** equals `true`, defines to add an instance to the container even if it does not exist.
## About
The project was made by Miquido: https://www.miquido.com