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:
As of Go agent v3.0.0, this attribute has been marked deprecated and been renamed to http.statusCode. The v3.x agent will continue to produce this attribute, but it will be removed in v4.0.0.
The type as read from the HTTP request's Accept header, called with newrelic.AttributeRequestAccept
As of Go agent v3.0.0, this attribute has been marked deprecated and been renamed to request.headers.userAgent. The v3.x agent will continue to produce this attribute, but it will be removed in v4.0.0.
The contents of the User-Agent HTTP header, called with newrelic.AttributeRequestUserAgent
This attribute was added in v3.0.0 of the agent and the original request.headers.User-Agent will eventually be removed. Therefore the v3.x agents will produce two attributes representing the the contents of the User-Agent HTTP header. To completely exclude the attribute when using the v3.x agent, you must include both the old and new attributes. For example:
This attribute was added in v3.0.0 of the agent and the original httpResponseCode will eventually be removed. Therefore the v3.x agents will produce two attributes representing the response status code for a web request. To completely exclude the attribute when using the v3.x agent, you must include both the old and new attributes. For example:
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.
For datastore segments, this is the collection used and represents the table or group, called with newrelic.SpanAttributeDBCollection.
For datastore segments this is the database name and represents the name of the database where the query is being executed, called with newrelic.SpanAttributeDBInstance.
For datastore segments this is the parameterized query being executed and represents the query being performed, called with newrelic.SpanAttributeDBStatement.