Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-13766] Bump newrelic dependency (#6809)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13766" title="TT-13766" target="_blank">TT-13766</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Bump newrelic dependency</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Code Review</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This PR bumps the dependency with supposedly minimal changes, following the extensive upgrading guide. Needs an e2e test with newrelic (see ticket). https://tyktech.atlassian.net/browse/TT-13766 ___ ### **PR Type** Enhancement, Dependencies ___ ### **Description** - Migrated New Relic integration to use the updated v3 library. - Introduced a new `internal/service/newrelic` package for centralized New Relic functionality. - Refactored middleware, server, and proxy muxer to use the new context-based transaction handling. - Removed the old `gateway/newrelic.go` file and its outdated implementation. - Updated `go.mod` and `go.sum` to include the new New Relic v3 library and `nrgorilla` integration. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Refactor middleware to use updated New Relic context-based API</code></dd></summary> <hr> gateway/middleware.go <li>Replaced direct usage of <code>newrelic.Transaction</code> with a new context-based <br>approach using <code>newrelic.Context</code>.<br> <li> Updated middleware logic to use the new <code>StartSegment</code> method from the <br>updated New Relic library.<br> <li> Adjusted imports to use the new internal <code>service/newrelic</code> package.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+3/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>newrelic.go</strong><dd><code>Remove old New Relic setup and instrumentation logic</code> </dd></summary> <hr> gateway/newrelic.go <li>Removed the old implementation of New Relic setup and instrumentation.<br> <li> Deprecated the file as its functionality has been moved to the new <br><code>internal/service/newrelic</code> package.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-5e962a38f6108a1954500d7e078fdafe5d53f22c6ba058af7afa4dee4b99a1e2">+0/-100</a> </td> </tr> <tr> <td> <details> <summary><strong>proxy_muxer.go</strong><dd><code>Update proxy muxer to use new New Relic context handling</code> </dd></summary> <hr> gateway/proxy_muxer.go <li>Updated transaction handling to use the new <code>newrelic.Context</code> for <br>setting and retrieving transactions.<br> <li> Adjusted imports to use the new <code>service/newrelic</code> package.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-89fb6731880400cb95ba8860c935a308de5f55aaa41aa2c76abf3ee4773d7a87">+7/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>server.go</strong><dd><code>Refactor server New Relic setup to use updated library</code> </dd></summary> <hr> gateway/server.go <li>Refactored <code>SetupNewRelic</code> to use the updated New Relic library and <br>configuration options.<br> <li> Updated the global <code>NewRelicApplication</code> variable to use the new <br><code>*newrelic.Application</code> type.<br> <li> Integrated the new <code>service/newrelic</code> package for New Relic <br>functionality.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-4652d1bf175a0be8f5e61ef7177c9666f23e077d8626b73ac9d13358fa8b525b">+31/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>newrelic.go</strong><dd><code>Add new service package for New Relic integration</code> </dd></summary> <hr> internal/service/newrelic/newrelic.go <li>Introduced a new package for handling New Relic integration.<br> <li> Added context-based transaction management and logging utilities.<br> <li> Implemented a new sink for emitting custom events and metrics to New <br>Relic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-7c791ca90be92a2cab3f0b458e287d89da843e75aa60147f1cad613a5debb56e">+99/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update dependencies for New Relic v3 and integrations</code> </dd></summary> <hr> go.mod <li>Updated New Relic dependency to version 3.<br> <li> Added <code>nrgorilla</code> integration for New Relic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+2/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update dependency checksums for New Relic v3</code> </dd></summary> <hr> go.sum <li>Updated checksums for the new New Relic v3 and <code>nrgorilla</code> dependencies.<br> <br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+4/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
- Loading branch information