Download the PHP package slick/telemetry without Composer

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

Slick JSON API implementation package

GitHub release (latest SemVer) GitHub Workflow Status Quality Score Total Downloads

slick/telemetry is a small library that uses a PSR-3 compliant logger to send HTTP/Application telemetry metrics to a given log service/system. It abstracts the concepts of a metric, dependency, exception, PSR-14 slick implementation of an event and HTTP requests. It also implements PSR-3LoggerInterface allowing its usage as a regular logger.

This package is compliant with PSR-12 code standards and PSR-4 autoload standards. It also applies the semantic version 2.0.0 specification.

Install

Via Composer

If you need to use slick/telemetry with version 7.4.x of PHP please do de following

Usage

To start using the telemetry logger you will need a PSR-3 implementation that will deliver the information to your preferred log system.
We recommend monolog\monolog package, developed by Jordi Boggiano with one of its handlers. Please visit Monolog project site on GitHub for more information.

To add monolog\monolog to you project run the following:

Create a telemetry client

With a PSR-3 logger we are now ready to create our client:

Register a metric

There are 2 types of metric telemetry: single measurement and pre-aggregated metric. Single measurement is just a name and value. Pre-aggregated metric specifies minimum and maximum value of the metric in the aggregation interval and standard deviation of it.

Register a dependency

Dependency represents an interaction of the application with a remote component such as SQL or an HTTP endpoint.

Register an exception

Exception represents a handled or unhandled exception that occurred during execution of the monitored application.

Register an event

Event telemetry represent an event that occurred in your application. Typically it is a user interaction such as button click or order checkout. It can also be an application life cycle event like initialization or configuration update.

Semantically, events may or may not be correlated to requests. However, if used properly, event telemetry is more important than requests. Events represent business telemetry.

In order to use this telemetry item, you need to create events with slick/event, witch is a required dependency for this library. slick/event is a simple PSR-14 event handling implementation library. We also recommend that event objects should implement the JsonSerializable interface so that the data can be passed as context to the log service.

Register a HTTP request

An HTTP request can be used to register information of a request: path, duration, post data or headers can be registered here.

Single call
Request factory methods

With these methods we can let the telemetry client calculate time and duration for us. This is done by registering the difference between beginRequest() and endRequest() method calls.

Let's see an example:

This code as the same effect as the one make with a single call to TelemetryClient::trackRquest() method

Other features

Message interpolation

In all calls to TelemetryClient::track() or TelemetryClient::log() methods you set placeholders in the message parameter so that they can be replaced by values from the context array. You need to follow these rules:

Log level override

All methods have a logLevel assign by default. For all the default is LogLevel::INFO except for TrackableException where the default is LogLevel::ERROR.

In addition Dependency and Request can have LogLevel::WARNING if its isSuccessfull property is false.

You can change this log level if you pass the level key to the context parameter: ``

Testing

We use PHPSpec for unit testing.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of telemetry with dependencies

PHP Build Version
Package Version
Requires php Version >=8
psr/event-dispatcher Version ^1.0||^2.0||^3.0
psr/http-message Version ^1.0||^2.0||^3.0
psr/log Version ^1.0||^2.0||^3.0
slick/event Version 1.1.x-dev
ext-json Version *
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 slick/telemetry contains the following files

Loading the files please wait ....