PHPackages                             samuelnogueira/cache-datastore-newrelic - 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. [Caching](/categories/caching)
4. /
5. samuelnogueira/cache-datastore-newrelic

ActiveLibrary[Caching](/categories/caching)

samuelnogueira/cache-datastore-newrelic
=======================================

Reports calls to any psr/simple-cache or psr/cache implementation as a custom New Relic Datastore

1.2.0(1y ago)310.7k↓31.8%MITPHPPHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0CI failing

Since Aug 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/samuelnogueira/cache-datastore-newrelic)[ Packagist](https://packagist.org/packages/samuelnogueira/cache-datastore-newrelic)[ RSS](/packages/samuelnogueira-cache-datastore-newrelic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (8)Used By (0)

cache-datastore-newrelic
========================

[](#cache-datastore-newrelic)

[![Latest Stable Version](https://camo.githubusercontent.com/6932448b2571e149e7f8887b5f54599457892dd28a7baca42f400294213052c3/687474703a2f2f706f7365722e707567782e6f72672f73616d75656c6e6f6775656972612f63616368652d6461746173746f72652d6e657772656c69632f76)](https://packagist.org/packages/samuelnogueira/cache-datastore-newrelic)[![PHP Version Require](https://camo.githubusercontent.com/be0840bf37f53a405888dc08fe6114adc2a70f645f3940031cf1db4666f08fba/687474703a2f2f706f7365722e707567782e6f72672f73616d75656c6e6f6775656972612f63616368652d6461746173746f72652d6e657772656c69632f726571756972652f706870)](https://packagist.org/packages/samuelnogueira/cache-datastore-newrelic)

Report calls to any `psr/simple-cache` or `psr/cache` implementation as a custom New Relic Datastore.

Uses the [newrelic\_record\_datastore\_segment](https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_record_datastore_segment/) function to record calls to an unsupported database.

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

[](#requirements)

Requires New Relic PHP Agent version &gt;= 7.5.0.

Usage
-----

[](#usage)

Decorate your existing:

1. `\Psr\Cache\CacheItemPoolInterface`
2. `\Psr\SimpleCache\CacheInterface`

with respectively:

1. `\Samuelnogueira\CacheDatastoreNewrelic\CacheItemPoolDecorator`
2. `\Samuelnogueira\CacheDatastoreNewrelic\SimpleCacheDecorator`

Example with [PSR-6: Caching Interface](https://www.php-fig.org/psr/psr-6/):

```
use Psr\Cache\CacheItemPoolInterface;
use Samuelnogueira\CacheDatastoreNewrelic\CacheItemPoolDecorator;
use Samuelnogueira\CacheDatastoreNewrelic\DatastoreParams;

/** @var CacheItemPoolInterface $cache */

return new CacheItemPoolDecorator(
    $cache, // your cache adapter
    new DatastoreParams('My Database Product'),
);
```

Example with [PSR-16: Common Interface for Caching Libraries](https://www.php-fig.org/psr/psr-16/) (aka Simple Cache):

```
use Psr\SimpleCache\CacheInterface;
use Samuelnogueira\CacheDatastoreNewrelic\SimpleCacheDecorator;
use Samuelnogueira\CacheDatastoreNewrelic\DatastoreParams;

/** @var CacheInterface $cache */

return new SimpleCacheDecorator(
    $cache, // your cache adapter
    new DatastoreParams('My Database Product'),
);
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance40

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~208 days

Recently: every ~249 days

Total

7

Last Release

501d ago

Major Versions

0.2.0 → 1.0.02023-03-30

PHP version history (5 changes)0.1.0PHP ^7.3 || ^8.0

0.2.0PHP ~8.0.0 || ~8.1.0

1.0.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0

1.1.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

1.2.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5cf4b008b29254613aeed2755b5898a513e6762e1744792d0ea8ca230a938712?d=identicon)[samuelnogueira](/maintainers/samuelnogueira)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (27 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (26 commits)")[![samuelnogueira](https://avatars.githubusercontent.com/u/12846646?v=4)](https://github.com/samuelnogueira "samuelnogueira (7 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (1 commits)")

---

Tags

psrcacheSimpledatastorenewrelicnewrelic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/samuelnogueira-cache-datastore-newrelic/health.svg)

```
[![Health](https://phpackages.com/badges/samuelnogueira-cache-datastore-newrelic/health.svg)](https://phpackages.com/packages/samuelnogueira-cache-datastore-newrelic)
```

###  Alternatives

[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[cache/tag-interop

Framework interoperable interfaces for tags

10525.0M12](/packages/cache-tag-interop)[fig/cache-util

Useful utility classes and traits for implementing the PSR cache standard

3656.4k11](/packages/fig-cache-util)[infocyph/intermix

A Collection of useful PHP class functions.

136.4k1](/packages/infocyph-intermix)

PHPackages © 2026

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