PHPackages                             aubes/correlation-core - 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. aubes/correlation-core

ActiveSymfony-bundle

aubes/correlation-core
======================

Core bundle for correlation ID management: storage, generator and shared contracts

v0.1.0(2d ago)08↑650%MITPHPPHP ^8.2CI passing

Since Apr 6Pushed yesterdayCompare

[ Source](https://github.com/aubes/correlation-core)[ Packagist](https://packagist.org/packages/aubes/correlation-core)[ Docs](https://github.com/aubes/correlation-core)[ RSS](/packages/aubes-correlation-core/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (9)Versions (2)Used By (0)

Correlation-core
================

[](#correlation-core)

Core bundle for correlation ID management: storage, generator, and shared interfaces.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Symfony 6.4 / 7.4 / 8.x

Interfaces
----------

[](#interfaces)

### `CorrelationIdProviderInterface`

[](#correlationidproviderinterface)

Read-only access to the current correlation ID. Inject this in your services when you only need to read the ID.

```
use Aubes\CorrelationCore\Storage\CorrelationIdProviderInterface;

class MyService
{
    public function __construct(private readonly CorrelationIdProviderInterface $provider) {}

    public function doSomething(): void
    {
        $correlationId = $this->provider->get(); // returns ?string
    }
}
```

### `CorrelationIdStorageInterface`

[](#correlationidstorageinterface)

Full access: read, write, and reset. Extends `CorrelationIdProviderInterface` and Symfony's `ResetInterface`.

```
public function get(): ?string;          // current ID, or null if not yet resolved
public function set(string $id): void;  // idempotent - no-op if an ID is already stored
public function getOrGenerate(): string; // returns current ID, or generates and stores one
public function reset(): void;          // clears the stored ID (called between contexts)
```

`set()` is intentionally idempotent: once a correlation ID is stored for a context, it cannot be overwritten. This prevents accidental ID changes mid-request.

### `CorrelationIdGeneratorInterface`

[](#correlationidgeneratorinterface)

```
public function generate(): string;
```

One implementation is provided:

ClassOutputUse case`UuidCorrelationIdGenerator`UUID v7 stringDefault - human-readable, time-orderedCustom generator
----------------

[](#custom-generator)

```
use Aubes\CorrelationCore\Generator\CorrelationIdGeneratorInterface;

class MyGenerator implements CorrelationIdGeneratorInterface
{
    public function generate(): string
    {
        return bin2hex(random_bytes(16));
    }
}
```

```
# config/packages/correlation_core.yaml
correlation_core:
    generator: App\MyGenerator
```

Console commands
----------------

[](#console-commands)

A correlation ID is generated automatically at the start of every console command and cleared when it terminates. No configuration required.

### `--correlation-id` option

[](#--correlation-id-option)

Any command can receive a specific correlation ID via the global `--correlation-id` option:

```
php bin/console app:process-orders --correlation-id=01JQWXYZ...
```

If provided, the value is validated (printable ASCII, max 255 chars) before being stored. If omitted, a UUID v7 is generated.

Worker / long-running processes
-------------------------------

[](#worker--long-running-processes)

`CorrelationIdStorage` implements Symfony's `ResetInterface`. The kernel calls `reset()` automatically between HTTP requests (FrankenPHP), ensuring the ID from one context never leaks into the next.

For console workers (Messenger consumers), the console listener resets the ID after each command terminates - the correlation ID from one job never leaks into the next.

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

2d ago

### Community

Maintainers

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

---

Top Contributors

[![aubes](https://avatars.githubusercontent.com/u/3941035?v=4)](https://github.com/aubes "aubes (4 commits)")

---

Tags

symfonybundletracingcorrelation-idobservability

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aubes-correlation-core/health.svg)

```
[![Health](https://phpackages.com/badges/aubes-correlation-core/health.svg)](https://phpackages.com/packages/aubes-correlation-core)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M643](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M151](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[cmsig/seal-symfony-bundle

An integration of CMS-IG SEAL search abstraction into Symfony Framework.

15195.8k5](/packages/cmsig-seal-symfony-bundle)

PHPackages © 2026

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