• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

Go agent release notesRSS

January 31, 2019
Go agent v2.4

2.4.0 Notes

  • Introduced Transaction.Application method which returns the Application that started the Transaction. This method is useful since it may prevent having to pass the Application to code that already has access to the Transaction. Example use:
txn.Application().RecordCustomEvent("customerOrder", map[string]interface{}{
"numItems": 2,
"totalPrice": 13.75,
})
  • The Transaction.AddAttribute method no longer accepts nil values since our backend ignores them.

January 24, 2019
Go agent v2.3

2.3.0 Notes

func setResponseDemo(txn newrelic.Transaction) {
recorder := httptest.NewRecorder()
txn = txn.SetWebResponse(recorder)
txn.WriteHeader(200)
fmt.Println("response code recorded:", recorder.Code)
}
  • The Transaction's http.ResponseWriter methods may now be called safely if a http.ResponseWriter has not been set. This allows you to add a response code to the transaction without using a http.ResponseWriter. Example:
func transactionWithResponseCode(app newrelic.Application) {
txn := app.StartTransaction("hasResponseCode", nil, nil)
defer txn.End()
txn.WriteHeader(200) // Safe!
}
  • The agent will now collect environment variables prefixed by NEW_RELIC_METADATA_ and KUBERNETES_SERVICE_HOST. These will be added to Transaction events to provide context between your Kubernetes cluster and your services. For details on the benefits (currently in beta) see this blog post
  • The agent now collects the fully qualified domain name of the host and local IP addresses for improved linking with our Infrastructure product.

December 18, 2018
Go agent v2.2

2.2 Notes

  • The Transaction parameter to NewRoundTripper and StartExternalSegment is now optional: If it is nil, then a Transaction will be looked for in the request's context (using FromContext). Passing a nil transaction is STRONGLY recommended when using NewRoundTripper since it allows one http.Client.Transport to be used for multiple transactions. Example use:
client := &http.Client{}
client.Transport = newrelic.NewRoundTripper(nil, client.Transport)
request, _ := http.NewRequest("GET", "http://example.com", nil)
request = newrelic.RequestWithTransactionContext(request, txn)
resp, err := client.Do(request)
  • Introduced Transaction.SetWebRequest(WebRequest) method which marks the transaction as a web transaction. If the WebRequest parameter is non-nil, SetWebRequest will collect details on request attributes, url, and method. This method is useful if you don't have access to the request at the beginning of the transaction, or if your request is not an *http.Request (just add methods to your request that satisfy WebRequest). To use an *http.Request as the parameter, use the NewWebRequest transformation function. Example:
var request *http.Request = getInboundRequest()
txn.SetWebRequest(newrelic.NewWebRequest(request))
  • Fixed Debug in nrlogrus package. Previous versions of the New Relic Go Agent incorrectly logged to Info level instead of Debug. This has now been fixed. Thanks to @paddycarey for catching this.
  • nrgin.Transaction may now be called with either a context.Context or a *gin.Context. If you were passing a *gin.Context around your functions as a context.Context, you may access the Transaction by calling either nrgin.Transaction or FromContext. These functions now work nicely together. For example, FromContext will return the Transaction added by nrgin.Middleware. Thanks to @rodriguezgustavo for the suggestion.

August 28, 2018
Go agent v2.1

2.1.0 New

Go Agent now supports distributed tracing

Distributed tracing lets you see the path that a request takes as it travels through your distributed system. By showing the distributed activity through a unified view, you can troubleshoot and understand a complex system better than ever before.

Distributed tracing is available with an APM Pro or equivalent subscription. To see a complete distributed trace, you need to enable the feature on a set of neighboring services. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the transition guide before you enable this feature.

To enable distributed tracing, set the following fields in your config. Note that distributed tracing and cross application tracing cannot be used simultaneously.

config := newrelic.NewConfig("Your Application Name", "__YOUR_NEW_RELIC_LICENSE_KEY__")
config.CrossApplicationTracer.Enabled = false
config.DistributedTracer.Enabled = true

Please refer to the distributed tracing section of the guide for more detail on how to ensure you get the most out of the Go agent's distributed tracing support.

New distributed trace calls/functions

Added functions NewContext and FromContext for adding and retrieving the Transaction from a Context. Handlers instrumented by WrapHandle, WrapHandleFunc, and nrgorilla.InstrumentRoutes may use FromContext on the request's context to access the Transaction. Thanks to @caarlos0 for the contribution! Though NewContext and FromContext require Go 1.7+ (when context was added), RequestWithTransactionContext is always exported so that it can be used in all framework and library instrumentation.

May 15, 2018
Go agent v2.0

2.0.0 New

  • The End() functions defined on the Segment, DatastoreSegment, and ExternalSegment types now receive the segment as a pointer, rather than as a value. This prevents unexpected behaviour when a call to End() is deferred before one or more fields are changed on the segment.

    In practice, this is likely to only affect this pattern:

    defer newrelic.DatastoreSegment{
    // ...
    }.End()

    Instead, you will now need to separate the literal from the deferred call:

    ds := newrelic.DatastoreSegment{
    // ...
    }
    defer ds.End()

    When creating custom and external segments, we recommend using newrelic.StartSegment() and newrelic.StartExternalSegment(), respectively.

  • Added GoDoc badge to README. Thanks to @mrhwick for the contribution!

  • Config.UseTLS configuration setting has been removed to increase security. TLS will now always be used in communication with New Relic Servers.

November 29, 2017
Go agent v1.11

New Features

  • Added support for Cross Application Tracing (CAT). Please refer to the upgrading section of the guide for more detail on how to ensure you get the most out of the Go agent's new CAT support.
  • The agent now collects additional metadata when running within Amazon Web Services, Google Cloud Platform, Microsoft Azure, and Pivotal Cloud Foundry. This information is used to provide an enhanced experience when the agent is deployed on those platforms.

October 24, 2017
Go agent v1.10

New

  • Added new RecordCustomMetric method to Application. This functionality can be used to track averages or counters without using custom events. See Custom Metric Documentation
  • Fixed import needed for logrus. The import Sirupsen/logrus had been renamed to sirupsen/logrus. Thanks to @alfred-landrum for spotting this.
  • Added ErrorAttributer, an optional interface that can be implemented by errors provided to Transaction.NoticeError to attach additional attributes. These attributes are subject to attribute configuration.
  • Added Error, a type that allows direct control of error fields.
  • Updated license to address scope of usage.

April 18, 2017
Go agent v1.9

New

March 17, 2017
Go agent v1.8

Notes

  • Fixed incorrect metric rule application when the metric rule is flagged to terminate and matches but the name is unchanged.
  • Segment.End(), DatastoreSegment.End(), and ExternalSegment.End() methods now return an error which may be helpful in diagnosing situations where segment data is unexpectedly missing.

February 16, 2017
Go agent v1.6

Notes

Copyright © 2024 New Relic Inc.

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