Download the PHP package manomano-tech/correlation-ids without Composer
On this page you can find all versions of the php package manomano-tech/correlation-ids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manomano-tech/correlation-ids
More information about manomano-tech/correlation-ids
Files in manomano-tech/correlation-ids
Package correlation-ids
Short Description Giving request correlation capabilities to your project
License MIT
Informations about the package correlation-ids
Inactive
📢 Note: This repository is not maintained any more.
Correlation identifiers
Purpose: giving request/process correlation capabilities to your project.
This library provides a simple class that will contain three correlation identifiers:
- One for the current process (see generator section below)
- One for the parent application that calls your application, if any. This value can be extracted from an HTTP header or provided manually
- One for the root application from which all the calls originate in the first place. This value can also be extracted from an HTTP header or provided manually
In other words, if we have three applications A, B and C and A calls B which in turn calls application C, within application C, we'll have:
- the root correlation id coming from the process of application A
- the parent correlation id coming from the process of application B
- the current correlation id which is an identification of the current process in application C
A little graph is worth a thousand words, so here is how this might look like:
Use cases
- You have multiple applications calling each other and you want to keep track of which is calling which.
- Your application produces logs and you want to know which logs come from the same process.
Installation
Generator
A generator is used to generate unique correlation ids for the current running application.
This library provides one default generator (see RamseyUuidGenerator) but you can create your own by implementing the UniqueIdGeneratorInterface.
Note: In order to use the RamseyUuidGenerator generator, you need to install the ramsey/uuid package.
Usage
You have two possibilities:
- extracting correlation identifiers from HTTP headers
- specifying parent and root correlation identifiers manually
Extracting correlation identifiers from HTTP headers
Specify parent and root correlation identifiers manually
Note: parent and root correlation id may be null