Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daily release/08/27/2024/evening #18504

Merged
merged 24 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
08dab10
feat(APM): Add go-easy instrumentation
rhetoric101 Aug 14, 2024
c9ff0e0
feat(APM): Add preview callout and link to GitHub
rhetoric101 Aug 14, 2024
613a665
feat(APM): Correct feature name and add link.
rhetoric101 Aug 15, 2024
d1fd312
fix(Go Agent): Remove branding from name and fix some typos
rhetoric101 Aug 22, 2024
d6a42e7
fix(Go agent): Remove colon
rhetoric101 Aug 22, 2024
66d419e
fix(Go agent): Incorporate peer writing feedback
rhetoric101 Aug 22, 2024
bb45b4e
fix(Node.js agent): Restore name to "Go easy instrumentation" tool
rhetoric101 Aug 27, 2024
b1c0fa4
fix(Go agent): Fix indentations
rhetoric101 Aug 27, 2024
a3386b2
fix(Go agent): Drop "tool" reference in title
rhetoric101 Aug 27, 2024
34799a3
chore: Adds Drupal 11.x to PHP compatibility
mfulb Aug 27, 2024
8f0a25c
chore: Adds Node.js agent v12.3.0 release notes.
newrelic-node-agent-team Aug 27, 2024
07614ee
fix: correct addToTrace documentation
patrickhousley Aug 27, 2024
aa7bcca
fix(Go agent): Clarify recommendation
rhetoric101 Aug 27, 2024
427525d
fix(Go agent): Clarify directory name
rhetoric101 Aug 27, 2024
9642918
fix(Go agent): Accepting new instructions
rhetoric101 Aug 27, 2024
7e788ef
fix(Go agent): Accept new URL for contributions
rhetoric101 Aug 27, 2024
f47bc1f
fix(Go agent): Accept new file name
rhetoric101 Aug 27, 2024
9a3eb94
fix(Go agent): Accept new URL
rhetoric101 Aug 27, 2024
a61ec5e
fix(Go agent): Accept new directory name
rhetoric101 Aug 27, 2024
742a308
fix(Go agent): Accept new URL
rhetoric101 Aug 27, 2024
1c6f453
Merge pull request #18386 from newrelic/rhs-new-go-automation
rhetoric101 Aug 27, 2024
b127077
Merge pull request #18500 from newrelic/add-node-v12.3.0
rhetoric101 Aug 27, 2024
1354df8
Merge pull request #18498 from mfulb/chore/php-drupal-11-compatibility
rhetoric101 Aug 27, 2024
52a9b4c
Merge pull request #18501 from patrickhousley/fix-addtotrace
rhetoric101 Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: 'Go easy instrumentation'
tags:
- Agents
- Go agent
- Installation
metaDescription: How to use a script to get code suggestions to instrument your Golang apps and services.
freshnessValidatedDate: 2024-08-20
---
<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

This feature is currently provided as part of a preview program pursuant to our [pre-release policies](/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy).
</Callout>

Go is a compiled language with an opaque runtime, making it unable to support automatic instrumentation like other languages. For this reason, the New Relic Go agent is designed as an SDK. Since the Go agent is an SDK, it requires more manual work to set up than agents for languages that support automatic instrumentation.

In an effort to make instrumentation easier, the Go agent team created the Go easy instrumentation tool that is currently in preview. This tool does most of the work for you by suggesting changes to your source code that instrument your application with the New Relic Go agent.

To get started, check out this [four-minute video](https://asciinema.org/a/r0Il7o2eMiZaLKHIlew3IL2nx), or skip down to [How it works](#how-it-works).

## Preview notice [#preview-notice]
<CollapserGroup>
<Collapser
id="preview-usage-details"
title="What you can expect from this preview"
>
This feature is currently provided as part of a product preview and is subject to our New Relic Experimental policies. Recommended code changes are suggestions only and should be subject to human review for accuracy, applicability, and appropriateness for your environment. This feature should only be used in non-critical, non-production environments that do not contain sensitive data.

This project, its code, and the UX are under heavy development, so you should expect it to change. Please take this into consideration when participating in this preview. If you encounter any issues, please report them using [Github issues](https://github.com/newrelic/go-easy-instrumentation) and fill out as much of the issue template as you can so we can improve this tool.
</Collapser>
</CollapserGroup>


## How it works [#how-it-works]

This tool doesn't interfere with your application's operation, and it doesn't make any changes to your code directly. Here's what happens:

* It analyzes your code and suggests changes that allow the Go agent to capture telemetry data.
* You review the changes in the `.diff` file and decide which changes to add to your source code.

As part of the analysis, this tool may invoke `go get` or other Go language toolchain commands which may modify your `go.mod` file, but not your actual source code.

<Callout variant="important">
This tool can't detect if you already have New Relic instrumentation. Please only use this tool on applications without any instrumentation.
</Callout>

## What is instrumented? [#what-is-instrumented]

The scope of what this tool can instrument in your application is limited to these actions:

* Capturing errors in any function wrapped or traced by a transaction
* Tracing locally defined functions that are invoked in the application's `main()` method with a transaction
* Tracing async functions and function literals with an async segment
* Wrapping HTTP handlers
* Injecting distributed tracing into external traffic

Only the following Go packages and libraries are currently supported:

* standard library
* net/http

## Installation [#go-easy-install]

Before you start the installation steps below, make sure you have a version of Go installed that is within the support window for the current [Go programming language lifecycle](https://endoflife.date/go).

1. Clone the [Go instrumentation repository](https://github.com/newrelic/go-easy-instrumentation) to a directory on your system. For example:
```sh
git clone https://github.com/newrelic/go-easy-instrumentation.git
```
2. Go into that directory:
```sh
cd go-easy-instrumentation
```
3. Resolve any third-party dependencies:
```sh
go mod tidy
```
## Generate instrumentation suggestions [#generate-suggestions]

This tool works best with Git. We recommend you verify your application is on a branch without any unstaged changes before applying any of the generated changes to it. After checking that, follow these steps to generate and apply the changes that install the New Relic Go agent in an application:

1. Run the following CLI command to create a file named `new-relic-instrumentation.diff` in your working directory:
```sh
go run . -path ../my-application/
```
2. Open the `.diff` file and verify or correct the contents.
3. When you are satisfied with the instrumentation suggestions, save the file, and then apply the changes:
```sh
mv new-relic-instrumentation.diff ../my-application/
cd ../my-application
git apply new-relic-instrumentation.diff
```

Once the changes are applied, the application should run with the New Relic Go agent installed. If the agent installation is not working the way you want it to, you can easily recover by using common Git commands. For example, you could try one of the following:

* Stash the changes with `git stash`
* Revert the code to a previous commit

## What's next? [#what-is-next]

If you have any suggestions or find issues, please create a [Github issue](https://github.com/newrelic/go-easy-instrumentation).
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ The following frameworks are supported:
Drupal
</td>
<td>
7.x, 8.x, 9.x, 10.x
7.x, 8.x, 9.x, 10.x, 11.x
</td>
<td>
[Drupal specific functionality](/docs/apm/agents/php-agent/frameworks-libraries/drupal-specific-functionality)<br></br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ Note that the number of events shared this way is limited by the Browser agent h
Required. Supply a JavaScript object with these required and optional name/value pairs:

* Required name/value pairs: `name`, `start`
* Optional name/value pairs: `end`, `origin`, `type`

If you are sending the same event object to New Relic as a [`PageAction`](/docs/insights/explore-data/attributes/browser-default-attributes-insights#pageaction-list), omit the `TYPE` attribute. (`type` is a string to describe what type of event you are marking inside of a session trace.) If included, it will override the event type and cause the `PageAction` event to be sent incorrectly. Instead, use the `name` attribute for event information.
* Optional name/value pairs: `end`, `origin`
</td>
</tr>
</tbody>
Expand All @@ -102,7 +100,5 @@ var obj = {
// Time in ms since epoch. Defaults to same as start resulting in trace object with a duration of zero.
origin: 'Origin of event',
// Defaults to empty string
type: 'What type of event was this'
// Defaults to empty string
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
subject: Node.js agent
releaseDate: '2024-08-27'
version: 12.3.0
downloadLink: 'https://www.npmjs.com/package/newrelic'
security: []
bugs: ["Improved AWS Lambda event detection"]
features: ["Added new API method `withLlmCustomAttributes` to run a function in a LLM context"]
---

## Notes

#### Features

* Added new API method `withLlmCustomAttributes` to run a function in a LLM context ([#2437](https://github.com/newrelic/node-newrelic/pull/2437)) ([57e6be9](https://github.com/newrelic/node-newrelic/commit/57e6be9f4717fde3caada0e3ca3680959180f928))
* The context will be used to assign custom attributes to every LLM event produced within the function

#### Bug fixes

* Improved AWS Lambda event detection ([#2498](https://github.com/newrelic/node-newrelic/pull/2498)) ([5e8b260](https://github.com/newrelic/node-newrelic/commit/5e8b2608d9914e2a4282f7c9c42ff17dfa9f793e))

#### Documentation

* Updated compatibility report ([#2493](https://github.com/newrelic/node-newrelic/pull/2493)) ([0448927](https://github.com/newrelic/node-newrelic/commit/0448927a49254b5b3c7ed9ff072cec24449fc558))

#### Miscellaneous chores
* Fixed linting scripts ([#2497](https://github.com/newrelic/node-newrelic/pull/2497)) ([c395779](https://github.com/newrelic/node-newrelic/commit/c395779f499cca0ec7f915342c23b2d2381b0163))
* Removed examples/shim ([#2484](https://github.com/newrelic/node-newrelic/pull/2484)) ([40d1f5c](https://github.com/newrelic/node-newrelic/commit/40d1f5ccc50d49805fc68946806fc9f74179673b))
* Updated test-utils dependency and added matrix-count only ([#2494](https://github.com/newrelic/node-newrelic/pull/2494)) ([5e04c76](https://github.com/newrelic/node-newrelic/commit/5e04c76600b8e6b7bfe331c2bec1b6cfa05ab922))

#### Tests

* Converted the api unit tests to `node:test` ([#2516](https://github.com/newrelic/node-newrelic/pull/2516)) ([ab91576](https://github.com/newrelic/node-newrelic/commit/ab91576fa949161f902b1604752a7fc38e7f2a74))
* Converted context-manager unit tests to `node:test` ([#2508](https://github.com/newrelic/node-newrelic/pull/2508)) ([9363eb0](https://github.com/newrelic/node-newrelic/commit/9363eb08ce8a13e67f94e5378ca95f32a562d504))

#### Continuous integration

* Updated codecov action sha to post coverage from forks. Added flag to fail ci if it fails to upload report ([#2490](https://github.com/newrelic/node-newrelic/pull/2490)) ([12fbe56](https://github.com/newrelic/node-newrelic/commit/12fbe56ca2581b3dd5cc5e2c1eceade46a8d191d))


### Support statement:

We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date. (https://docs.newrelic.com/docs/new-relic-solutions/new-relic-one/install-configure/update-new-relic-agent/)

See the New Relic Node.js agent EOL policy for information about agent releases and support dates. (https://docs.newrelic.com/docs/apm/agents/nodejs-agent/getting-started/nodejs-agent-eol-policy/)
2 changes: 2 additions & 0 deletions src/nav/apm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pages:
path: /docs/apm/agents/go-agent/installation/install-new-relic-go
- title: Install in GAE flex
path: /docs/apm/agents/go-agent/installation/install-go-agent-gae-flexible-environment
- title: Try Go easy instrumentation (experimental)
path: /docs/apm/agents/go-agent/installation/install-automation-new-relic-go
- title: Update the Go agent
path: /docs/apm/agents/go-agent/installation/update-go-agent
- title: Uninstall the Go agent
Expand Down
Loading