• English日本語한국어
  • Log inStart now

Go agent attributes

Attributes are key-value pairs containing information for transaction events, error events, and traced errors. You can adjust the destinations of default attributes and create custom attributes for the attributes collected by New Relic's Go language agent, including:

  • Error traces
  • Transaction events
  • Page views

For an extra level of monitoring detail, create custom attributes.

Go agent attributes

The Go agent receives the following default attributes from your app. You can adjust these default settings and turn attributes on or off for certain destinations.

Span and segment attributes

If you have Go agent v2.6.0 or higher, you can configure attributes on spans and segments. The Go agent receives the following default attributes from your app. These attributes are only found on span events and transaction trace segments. You can adjust these default settings and turn attributes on or off for certain destinations.

Change attribute destination

Use these options to change attribute destinations:

Create custom attributes

Add custom attributes by using this method in a transaction:

txn.AddAttribute("key", "value")

The txn variable is the one instrumented for the Go transaction. For example:

txn.AddAttribute("product", "widget")
txn.AddAttribute("price", 19.99)
txn.AddAttribute("importantCustomer", true)

Default settings for custom attribute destinations:

  • Error collector (traced errors): Enabled
  • Transaction events: Enabled
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.