Download the PHP package troopers/metrics-bundle without Composer

On this page you can find all versions of the php package troopers/metrics-bundle. 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 metrics-bundle

Troopers

License Version Packagist DL Build Status SensioLabsInsight Twitter Follow

MetricsBundle

Synopsis

This bundle works with Monolog and is used to improve monitoring or metric logging process thanks to ELK (Elasticsearch, Logstash, Kibana).

Install

composer require troopers/metrics-bundle and registrer in AppKernel

Be sure some serializer is enabled:

Processors

UserProcessor

This processor will automatically add user informations to every log. Among availables informations, we can know if the user is authenticated (authenticated: true/false), when appropriate his id and username. Furthermore, this processor will check if you defined some serializer groups in the metrics.serializer_user_groups config.

The config below will tell the symfony serializer to serialize the authenticated user by using the profile group:

By default, this processor, is only available for the app channel, you can add an other or ovveride the service declaration to use on other handler or channel.

The results will be prefixed by user_ (user_id, user_city...) and you don't need to give any additional context.

ContextSerializerProcessor

This processor stands for serializing objects in order to avoid you to pass serializer every where you need to log something. To communicate with this processor and tell it to do its job, you'll need to wrap your objects in a ContextSerializerProcessor and give them to the contexts like below:

The processor'll handle the context and start to work when it'll find your SerializeContextItems and add the serialized objects to the context by using the groups given in 2nd constructor argument. If an alias is given, it will use it to store the property, else it will prefix with the class name.

AlterDateTimeProcessor

For some reason, you may want to log an event in the past (or future why not ?). The AlterDateTimeProcessor will do it for you, all you need to do is to define the @datetime context property with the wanted \DateTime value.

By default, this processor, is only available for the app channel, you can add an other or ovveride the service declaration to use on other handler or channel.

DomainProcessor

In some case, you need to add some extra information to improve your logs: application name, environment... You can add them in extra_fields

Only scalarvalues are allowed. (string, integer, boolean, float, null)

This processor also add request Uri when she his defined

By default, this processor is available for all channels.

GitProcessor

This processor try to find git revision with git command or in REVISION file at the root of application

By default, this processor is available for all channels.

Log sandbox

Sometime, we just want to send log to test something, this log sandbox to help you to accomplish this small thing.

Check the metrics routes are registered (in your app/config/routing.yml or routing_dev.yml):

and go to /metrics/sandbox/newLog to get your console: Log console sandbox

Dashboard and time filter

Once you finished to build your dashboard in kibana, you'll be able to get an iframe to embed it in your website. To handle dashboard in your admin with a time filter, add a row in the database like this:

Then, embed the MetricsBundle:Dashboard:show and override (or not) the available blocks:

Time filters

Kibana doesn't integrate its time filter in embed dashboard. The TimeFilter and TimeFilterForm is here to navigate into dashboards.

Although, TimeFilter is an entity, so you can add some relations between your user and some dashboard.

Here are the available time filters:


All versions of metrics-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
doctrine/common Version ~2.3
elasticsearch/elasticsearch Version ~2.1
graylog2/gelf-php Version ^1.5
monolog/monolog Version 1.*
symfony/framework-bundle Version ~2.7|~3.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 troopers/metrics-bundle contains the following files

Loading the files please wait ....