PHPackages                             jomashop/module-new-relic-monitoring-for-gql - 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. [API Development](/categories/api)
4. /
5. jomashop/module-new-relic-monitoring-for-gql

ActiveMagento2-module[API Development](/categories/api)

jomashop/module-new-relic-monitoring-for-gql
============================================

Send GraphQL transactions to New Relic

2.0.1(2mo ago)16153.6k↓30.8%3PHP

Since Jun 29Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/jomashopio/magento2-automatic-graphql-transaction-naming-for-new-relic)[ Packagist](https://packagist.org/packages/jomashop/module-new-relic-monitoring-for-gql)[ RSS](/packages/jomashop-module-new-relic-monitoring-for-gql/feed)WikiDiscussions master Synced 2d ago

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

Magento 2 - Automatic GraphQL transaction naming for New Relic
==============================================================

[](#magento-2---automatic-graphql-transaction-naming-for-new-relic)

New Relic's PHP agent has support for automatic transaction naming for REST and SOAP, but not GraphQL. Thus, this Magento 2 module is developed to support sending a GraphQL transaction name to New Relic automatically.

Details
-------

[](#details)

A transaction is named based on the service class and method that handled the request, `/GraphQl/Controller/GraphQl\{operation name|(query|mutation)}\{name|Multiple}`.

The logic is explained as follows:

1. If the `operationName` field is set, use the operation name.
2. If the `operationName` field is not set, use the name of the query or mutation.
3. If a GraphQL query consists of multiple queries or mutations, the transaction would be indicated as 'Multiple'. Note that in any cases, the `operationName` field takes the priority.

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

[](#installation)

```
composer require jomashop/module-new-relic-monitoring-for-gql

```

Examples
--------

[](#examples)

1. Operation name is set

```
mutation createCustomerTest{
  createCustomer(
    input: {
      firstname: "Bob"
      lastname: "Loblaw"
      email: "test@example.com"
      password: "b0bl0bl@w"
      is_subscribed: true
    }
  ) {
    customer {
      firstname
      lastname
      email
      is_subscribed
    }
  }
}
```

In New Relic, the transaction name would be: `/GraphQl/Controller/GraphQl/Mutation/createCustomerTest`

2. Operation name is not set and only 1 query/mutation is requested

```
mutation {
  createCustomer(
    input: {
      firstname: "Bob"
      lastname: "Loblaw"
      email: "test@example.com"
      password: "b0bl0bl@w"
      is_subscribed: true
    }
  ) {
    customer {
      firstname
      lastname
      email
      is_subscribed
    }
  }
}
```

In NR, the transaction name would be `/GraphQl/Controller/GraphQl/Mutation/createCustomer`

3. Operation name is not set and multiple queries/mutations are requested

```
query {
  cmsBlocks(identifiers: "footer_links_block") {
    items {
      identifier
      title
      content
    }
  },
  storeConfig {
    id
    code
    website_id
    locale
    base_currency_code
    default_display_currency_code
    timezone
    weight_unit
    base_url
    base_link_url
    base_static_url
    base_media_url
    secure_base_url
    secure_base_link_url
    secure_base_static_url
    secure_base_media_url
    store_name
  }
}
```

In NR, the transaction name would be `/GraphQl/Controller/GraphQl/Query/Multiple`

---

### Other features

[](#other-features)

This module also supports using `newrelic_add_custom_parameter` instead of `newrelic_notice_error`.

- See ErrorHandler and ReportErrorEvaluatorInterface
- This can be used to reduce the number of `GraphQlInputException` / `GraphQlAuthorizationException` / `GraphQlAuthenticationException` which are logged as errors
- Data is set to ExceptionIsSkipReportError / ExceptionClass / ExceptionMessage

Error extraction:

- If the error is an `AggregateExceptionInterface` the module tries to use the inner error.
- If the error is a `LocalizedException` then ExceptionRawMessage is set as a custom parameter

If the header `x-client-version` is set then ClientVersion is set as a custom parameter

- This can be used to track the Frontend Version sending the GQL request

Core Magento logging from 2.4.4 is disabled as running both is does not provide extra value

If Magento &gt;= 2.4.7 is used the extracted data changes

- The AST is parsed to extract various data
- &lt;2.4.7 parses the string

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

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

Every ~531 days

Total

5

Last Release

70d ago

Major Versions

1.1.1 → 2.0.02026-04-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/05abbed121ec9bce2195e77844cbcf38805e937cafc61baa10bcb2a549eeedbc?d=identicon)[jomashop\_packagist](/maintainers/jomashop_packagist)

---

Top Contributors

[![steven-hoffman-jomashop](https://avatars.githubusercontent.com/u/71793894?v=4)](https://github.com/steven-hoffman-jomashop "steven-hoffman-jomashop (14 commits)")[![captain-mel](https://avatars.githubusercontent.com/u/61065256?v=4)](https://github.com/captain-mel "captain-mel (4 commits)")[![captain-melanie](https://avatars.githubusercontent.com/u/20979257?v=4)](https://github.com/captain-melanie "captain-melanie (2 commits)")[![nuzil](https://avatars.githubusercontent.com/u/1667889?v=4)](https://github.com/nuzil "nuzil (1 commits)")

---

Tags

graphqlgraphql-transactionmagentomagento2newrelictransactionname

### Embed Badge

![Health badge](/badges/jomashop-module-new-relic-monitoring-for-gql/health.svg)

```
[![Health](https://phpackages.com/badges/jomashop-module-new-relic-monitoring-for-gql/health.svg)](https://phpackages.com/packages/jomashop-module-new-relic-monitoring-for-gql)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8064.7M49](/packages/smile-elasticsuite)[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[graycore/magento2-cors

A Magento 2 module that enables CORS on the GraphQL and REST Apis

102597.4k](/packages/graycore-magento2-cors)[magmodules/magento2-channable

Channable integration for Magento 2

311.5M](/packages/magmodules-magento2-channable)[elgentos/module-prismicio

Magento 2 - Prismic.io integration

39119.0k3](/packages/elgentos-module-prismicio)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1328.7k](/packages/zepgram-module-rest)

PHPackages © 2026

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