PHPackages                             manomano-tech/correlation-ids - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. manomano-tech/correlation-ids

Abandoned → not maintained any moreArchivedLibrary[Utility &amp; Helpers](/categories/utility)

manomano-tech/correlation-ids
=============================

Giving request correlation capabilities to your project

1.0.0(7y ago)224.1k14MITPHPPHP ^7.1.3

Since Sep 29Pushed 3y agoCompare

[ Source](https://github.com/ManoManoTech/correlation-ids)[ Packagist](https://packagist.org/packages/manomano-tech/correlation-ids)[ RSS](/packages/manomano-tech-correlation-ids/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (3)Used By (4)

Inactive
========

[](#inactive)

**📢 Note:** This repository is not maintained any more.

Correlation identifiers
=======================

[](#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:

```
+-------+  current: 3b5263fa-1644-4750-8f11-aaf61e58cd9e
| App A |  parent: NULL
+---+---+  root: NULL
    |
    |
    v
+-------+  current: 3fc044d9-90fa-4b50-b6d9-3423f567155f
| App B |  parent: 3b5263fa-1644-4750-8f11-aaf61e58cd9e
+---+---+  root: 3b5263fa-1644-4750-8f11-aaf61e58cd9e
    |
    |
    v
+-------+  current: 6a051d24-aa5b-4c57-bcb4-bbbb7eda1c16
| App C |  parent: 3fc044d9-90fa-4b50-b6d9-3423f567155f
+-------+  root: 3b5263fa-1644-4750-8f11-aaf61e58cd9e

```

Use cases
---------

[](#use-cases)

1. You have multiple applications calling each other and you want to keep track of which is calling which.
2. Your application produces logs and you want to know which logs come from the same process.

Installation
------------

[](#installation)

```
composer require manomano-tech/correlation-ids
```

Generator
---------

[](#generator)

A generator is used to generate unique correlation ids for the current running application.

This library provides one default generator (see [RamseyUuidGenerator](/src/Generator/RamseyUuidGenerator.php)) but you can create your own by implementing the [UniqueIdGeneratorInterface](/src/Generator/UniqueIdGeneratorInterface.php).

> **Note:** In order to use the [RamseyUuidGenerator](/src/Generator/RamseyUuidGenerator.php) generator, you need to install the [ramsey/uuid](https://packagist.org/packages/ramsey/uuid) package.

Usage
-----

[](#usage)

You have two possibilities:

1. extracting correlation identifiers from HTTP headers
2. specifying parent and root correlation identifiers manually

### Extracting correlation identifiers from HTTP headers

[](#extracting-correlation-identifiers-from-http-headers)

```
use ManomanoTech\CorrelationId\Factory\HeaderCorrelationIdContainerFactory;
use ManomanoTech\CorrelationId\Generator\RamseyUuidGenerator;
use ManomanoTech\CorrelationId\CorrelationEntryName;

// We specify which generator will be responsible for generating the
// identification of the current process
$generator = new RamseyUuidGenerator();

// We define what are the http header names to look for
$correlationEntryNames = new CorrelationEntryName(
    'Current-Correlation-id',
    'Parent-Correlation-id',
    'Root-Correlation-id'
);

$factory = new HeaderCorrelationIdContainerFactory(
    $generator,
    $correlationEntryNames
);
$correlationIdContainer = $factory->create(getallheaders());
```

### Specify parent and root correlation identifiers manually

[](#specify-parent-and-root-correlation-identifiers-manually)

```
use ManomanoTech\CorrelationId\Factory\CorrelationIdContainerFactory;
use ManomanoTech\CorrelationId\Generator\RamseyUuidGenerator;
use ManomanoTech\CorrelationId\CorrelationEntryName;

// We specify which generator will be responsible for generating the
// identification of the current process
$generator = new RamseyUuidGenerator();

$factory = new CorrelationIdContainerFactory($generator);
$correlationIdContainer = $factory->create(
    '3fc044d9-90fa-4b50-b6d9-3423f567155f',
    '3b5263fa-1644-4750-8f11-aaf61e58cd9e'
);
```

> **Note:** parent and root correlation id may be null

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2781d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbbe3750e8a096e36b66917148ab246fbe1b5abdce72c3dd2c5e4c6e2c0c1695?d=identicon)[ManoManoTech](/maintainers/ManoManoTech)

---

Top Contributors

[![juliendufresne](https://avatars.githubusercontent.com/u/1397529?v=4)](https://github.com/juliendufresne "juliendufresne (10 commits)")[![edouard-lopez](https://avatars.githubusercontent.com/u/1212392?v=4)](https://github.com/edouard-lopez "edouard-lopez (2 commits)")[![greg0ire](https://avatars.githubusercontent.com/u/657779?v=4)](https://github.com/greg0ire "greg0ire (1 commits)")

---

Tags

tracingcorrelation-idcorrelation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/manomano-tech-correlation-ids/health.svg)

```
[![Health](https://phpackages.com/badges/manomano-tech-correlation-ids/health.svg)](https://phpackages.com/packages/manomano-tech-correlation-ids)
```

###  Alternatives

[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)[whitemerry/phpkin

PHP Zipkin implementation

7726.5k3](/packages/whitemerry-phpkin)[astrotomic/laravel-webmentions

215.7k](/packages/astrotomic-laravel-webmentions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
