Skip to content

DO NOT MERGE: Ready for REVIEW Update go-agent-configuration.mdx #20908

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
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
Expand Up @@ -639,6 +639,7 @@ NEW_RELIC_APP_NAME="Your Application Name"
NEW_RELIC_CODE_LEVEL_METRICS_ENABLED="true"
NEW_RELIC_CODE_LEVEL_METRICS_PATH_PREFIX="myproject/src"
NEW_RELIC_LABELS="Env:Dev;Label2:label2;Label3:label3;Label4:label4"
NEW_RELIC_APPLICATION_LOGGING_FORWARDING_CUSTOM_ATTRIBUTES="key1:val1;key2:val2;key3:val3"
```

then the following code:
Expand Down Expand Up @@ -770,6 +771,40 @@ Not all possible configuration options may be set via environment variables. The
</td>
</tr>

<tr>
<td>
`CustomInsightsEvents.CustomAttributesEnabled`
</td>

<td>
`ConfigAppLogForwardingEnabled`

(See [note 1](#table-note-one) below)
</td>

<td>
`NEW_RELIC_APPLICATION_LOGGING_FORWARDING_CUSTOM_ATTRIBUTES_ENABLED`
</td>
</tr>

<tr>
<td>
`CustomInsightsEvents.CustomAttributesValues`
</td>

<td>
`ConfigAppLogForwardingEnabled`

`ConfigCustomInsightsCustomAttributesEnabled`

(See [note 1](#table-note-one) below)
</td>

<td>
`NEW_RELIC_APPLICATION_LOGGING_FORWARDING_CUSTOM_ATTRIBUTES`
</td>
</tr>

<tr>
<td>
`ApplicationLogging.LocalDecorating.Enabled`
Expand Down Expand Up @@ -1742,6 +1777,7 @@ Not all possible configuration options may be set via environment variables. The
* `ConfigAppLogDecoratingEnabled(false)` sets `ApplicationLogging.LocalDecorating.Enabled=false` but does not affect `ApplicationLogging.Enabled`.
* `ConfigAppLogMetricsEnabled(true)` sets `ApplicationLogging.Metrics.Enabled=true` but also sets `ApplicationLogging.Enabled=true`.
* `ConfigAppLogMetricsEnabled(false)` sets `ApplicationLogging.Metrics.Enabled=false` but does not affect `ApplicationLogging.Enabled`.
* `ConfigAppLogForwardingEnabled(false)` sets `CustomInsightsEvents.CustomAttributesEnabled=false` but also sets `CustomInsightsEvents.CustomAttributesValues=nil`.

### Table note 2: [#table-note-two]

Expand All @@ -1766,8 +1802,9 @@ This section includes Go agent configurations for setting up AI monitoring.
</Callout>

<Callout variant="important">
When enabled, AI monitoring records a streaming copy of inputs and outputs sent to and from the models you choose to monitor, including any personal information contained therein.
You're responsible for obtaining consent from your model users that their interactions may be recorded by a third party (New Relic) for the purpose of providing the AI monitoring feature.
When enabled, AI monitoring records a streaming copy of inputs and outputs sent to and from the models you choose to monitor. This includes any personal information contained within those inputs and outputs.

You're responsible for obtaining consent from your model users, informing them that their interactions may be recorded
</Callout>

<CollapserGroup>
Expand Down Expand Up @@ -1982,6 +2019,112 @@ You can create custom events and make them available for querying and analysis.
)
```
</Collapser>

<Collapser
id="custom-insights-events.custom-attributes-enabled"
title="CustomInsightsEvents.CustomAttributesEnabled"
>
<table>
<tbody>
<tr>
<th>
Type
</th>

<td>
Boolean
</td>
</tr>

<tr>
<th>
Default
</th>

<td>
`false`
</td>
</tr>

<tr>
<th>
[Set in](#options)
</th>

<td>
`newrelic.Config` struct
</td>
</tr>
</tbody>
</table>

If `true`, the agent captures custom attributes related to the log lines being sent up by your application. `ApplicationLogging.Enabled` must also be `true` for this setting to take effect.

Configure `CustomInsightsEvents.CustomAttributesEnabled` by calling `ConfigCustomInsightsCustomAttributesEnabled()`.

```go
app, err := newrelic.NewApplication(
newrelic.ConfigCustomInsightsCustomAttributesEnabled(true),
)
```
</Collapser>

<Collapser
id="custom-insights-events-custom-attributes-values"
title="CustomInsightsEvents.CustomAttributesValues"
>
<table>
<tbody>
<tr>
<th>
Type
</th>

<td>
Map
</td>
</tr>

<tr>
<th>
Default
</th>

<td>
`nil`
</td>
</tr>

<tr>
<th>
[Set in](#options)
</th>

<td>
`newrelic.Config` struct
</td>
</tr>
</tbody>
</table>

A map with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1:val1;key2:val2;key3:val3"

Configure `CustomInsightsEvents.CustomAttributesValues` by calling `ConfigCustomInsightsCustomAttributesValues()`.

```go
app, err := newrelic.NewApplication(
newrelic.ConfigAppName("Your Application Name"),
newrelic.ConfigLicense(os.Getenv("NEW_RELIC_LICENSE_KEY")),
func(config *newrelic.Config) {
config.CustomInsightsEvents.CustomAttributesValues = map[string]string{
"key1": "val1",
"key2": "val2",
"key3": "val3",
}
},
)
```
</Collapser>
</CollapserGroup>

## Transaction events configuration [#transaction-events-settings]
Expand Down