github.com/TykTechnologies/newrelic-go-agent@v0.0.0-20230823062834-3c80ff5627f6/CHANGELOG.md (about)

     1  ## 3.24.1
     2  ### Fixed
     3   * Performance improvement around calls to security agent. In some cases, unnecessary setup operations were being performed even if there was no security agent present to use that. These are now conditional on the security agent being present in the application (note that this will enable the setup code if the security agent is *present* in the application, regardless of whether it's currently enabled to run). This affects:
     4      * Base agent code (updated to v3.24.1)
     5      * `nrmongo` integration (updated to v1.1.1)
     6  
     7   * Fixed unit tests for integrations which were failing because code level metrics are enabled by default now:
     8      * `nrawssdk-v1` (updated to v1.1.2)
     9      * `nrawssdk-v2` (updated to v1.2.2)
    10      * `nrecho-v3` (updated to v1.0.2)
    11      * `nrecho-v4` (updated to v1.0.4)
    12      * `nrhttprouter` (updated to 
    13      * `nrlambda` (updated to v1.2.2)
    14      * `nrnats` (updated to v1.1.5)
    15      * `nrredis-v8` (updated to v1.0.1)
    16  
    17  
    18  ### Changed
    19   * Updated all integration `go.mod` files to reflect supported Go language versions.
    20  
    21  ### Support statement
    22  
    23  We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves (i.e., Go versions 1.19 and later are supported).
    24  
    25  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/)
    26  
    27  See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.
    28  
    29  ## 3.24.0
    30  
    31  ### Added
    32  * Turned Code Level Metrics on by default
    33  * Added new test case to check if the nrsecurityagent is enabled in the gRPC integration
    34  * Added new test case for InfoInterceptorStatusHandler function in the gRPC integration
    35  * Added Name() method for Transaction values to get the current transaction name.
    36  
    37  
    38  ### Fixed
    39  * Bumped gin from 1.9.0 to 1.9.1
    40  * Bumped gosnowflake from 1.6.16 to 1.6.19
    41  * Bumped nrsecurityagent to 1.1.0 with improved reporting of gRPC protocol versions.
    42  * Fixed a bug where expected errors weren't being properly marked as expected on new relic dashboards
    43  
    44  ### Support statement
    45  
    46  We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves (i.e., Go versions 1.19 and later are supported).
    47  
    48  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/)
    49  
    50  See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.
    51  
    52  
    53  
    54  ## 3.23.1
    55  
    56  ## Added
    57  * Added newrelic.ConfigDatastoreRawQuery(true) configuration option to allow raw SQL queries to appear in new relic dashboards
    58  * Added license file to nrsecurityagent integration
    59  * Added enriched serverless debug logging for faster debugging
    60  
    61  ## Fixed
    62  * Removed timeouts on two tests in trace_observer_test.go
    63  * Bumped nrnats test to go1.19
    64  * Bumped graphql-go to v1.3.0 in the nrgraphgophers integration
    65  
    66  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/)
    67  
    68  See the [Go agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.
    69  
    70  ## 3.23.0
    71  ### Added
    72   * Adds the `nrsecurityagent` integration for performing Interactive Application Security Testing (IAST) of your application.
    73   * This action increments the version numbers of the following integrations:
    74     * `nrgin` v1.2.0
    75     * `nrgrpc` v1.4.0
    76     * `nrmicro` v1.2.0
    77     * `nrmongo` v1.2.0
    78     * `nrsqlite3` v1.2.0
    79  
    80   To learn how to use IAST with the New Relic Go Agent, [check out our documentation](https://docs.newrelic.com/docs/iast/use-iast/).
    81  
    82  ### Support statement
    83  
    84   We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves (i.e., Go versions 1.19 and later are supported).
    85  
    86   See the [Go agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.
    87  
    88  
    89  ## 3.22.1
    90   * Corrects an error in the release process for 3.22.0.
    91  
    92  ### Support statement
    93  
    94   We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves.
    95  
    96   See the [Go agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.
    97  
    98  ## 3.22.0
    99  
   100   ### Added
   101   * New Apache Kafka integration nrsarama that instruments the Sarama library https://github.com/Shopify/sarama
   102   * New logs in context integration logcontext-v2/nrzap that instruments the zap logging framework https://github.com/uber-go/zap
   103   * Integration tests created for the nrlogrus and nrzapintegrations
   104   * Updated integration tests for nrlogxi
   105  
   106   ### Security Fixes
   107   * Bumped sys package to v0.1.0 in the nrmssql integration
   108   * Bumped net package to v0.7.0 in the nrgrpc, nrmssql , and nrnats integrations
   109   * Bumped aws-sdk-go package to v1.34.0 in the nrawssdk-v1 integration
   110   * Bumped text  package to v0.3.8 in the nrnats,  and nrpgx integrations
   111   * Bumped gin package to v1.9.0 in the nrgin integration
   112   * Bumped crypto package to v0.1.0 in the nrpgx  integration
   113   * Fixed integration tests in nrnats package not correctly showing code coverage
   114  
   115   ### Support statement
   116  
   117   We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves.
   118  
   119   See the [Go agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go agent and third-party components.
   120  
   121  ## 3.21.1
   122  
   123  ### Added
   124  * nrredis-v9: automatic instrumentation for Go redis v9
   125  
   126  ### Fixed
   127  * Agent now requires Go version 1.18 or higher.
   128  * Removed support for Go version 1.17. This version of Go is outside of the support window.
   129  
   130  ### Support Statement
   131  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   132  
   133  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   134  
   135  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   136  
   137  ## 3.21.0
   138  
   139  ### Added
   140  * New Errors inbox features:
   141    * User tracking: You can now see the number of users impacted by an error group. Identify the end user with the setUser method.
   142    * Error fingerprint: Are your error occurrences grouped poorly? Set your own error fingerprint via a callback function.
   143  * Ability to disable reporting parameterized query in nrpgx-5
   144  
   145  ### Fixed
   146  * Improved test coverage for gRPC integration, nrgrpc
   147  
   148  ### Support Statement
   149  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   150  
   151  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   152  
   153  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   154  
   155  ## 3.20.4
   156  
   157  ### Fixed
   158  * nrmssql driver updated to use version maintained by Microsoft
   159  * bug where error messages were not truncated to the maximum size, and would get dropped if they were too large
   160  * bug where number of span events was hard coded to 1000, and config setting was being ignored
   161  
   162  ### Added
   163  * improved performance of ignore error code checks in agent
   164  * HTTP error codes can be set as expected by adding them to ErrorCollector.ExpectStatusCodes in the config
   165  
   166  ### Support Statement
   167  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   168  
   169  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   170  
   171  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   172  
   173  ## 3.20.3
   174  
   175  Please note that the v2 go agent is no longer supported according to our EOL policy. 
   176  
   177  ### Fixed
   178  * Performance Improvements for compression
   179  * nrsnowflake updated to golang 1.17 versions of packages
   180  
   181  ### Support Statement
   182  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   183  
   184  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   185  
   186  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   187  
   188  
   189  ## 3.20.2
   190  
   191  ### Added
   192  * New `NoticeExpectedError()` method allows you to capture errors that you are expecting to handle, without triggering alerts
   193  
   194  ### Fixed
   195  * More defensive harvest cycle code that will avoid crashing even in the event of a panic.
   196  * Update `nats-server` version to avoid known zip-slip exploit
   197  * Update `labstack/echo` version to mitigate known open redirect exploit
   198  
   199  ### Support Statement
   200  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   201  
   202  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   203  
   204  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   205  
   206  ## 3.20.1
   207  
   208  ### Added
   209  * New integration `nrpgx5` v1.0.0 to instrument `github.com/jackc/pgx/v5`. 
   210  
   211  ### Changed
   212  
   213  * Changed the following `TraceOption` function to be consistent with their usage and other related identifier names. The old names remain for backward compatibility, but new code should use the new names. 
   214     * `WithIgnoredPrefix` -> `WithIgnoredPrefixes`
   215     * `WithPathPrefix` -> `WithPathPrefixes`
   216  * Implemented better handling of Code Level Metrics reporting when the data (e.g., function names) are excessively long, so that those attributes are suppressed rather than being reported with truncated names. Specifically:
   217     * Attributes with values longer than 255 characters are dropped.
   218     * No CLM attributes at all will be attached to a trace if the `code.function` attribute is empty or is longer than 255 characters.
   219     * No CLM attributes at all will be attached to a trace if both `code.namespace` and `code.filepath` are longer than 255 characters.
   220  
   221  ### Support Statement
   222  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   223  
   224  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   225  
   226  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   227  
   228  ## 3.20.0
   229  
   230  **PLEASE READ** these changes, and verify your config settings to ensure your application behaves how you intend it to. This release changes some default behaviors in the go agent.
   231  
   232  ### Added
   233  * The Module Dependency Metrics feature was added. This collects the list of modules imported into your application, to aid in management of your application dependencies, enabling easier vulnerability detection and response, etc.
   234     * This feature is enabled by default, but may be disabled by explicitly including `ConfigModuleDependencyMetricsEnable(false)` in your application, or setting the equivalent environment variable or `Config` field direclty.
   235     * Modules may be explicitly excluded from the report via the `ConfigModuleDependencyMetricsIgnoredPrefixes` option.
   236     * Excluded module names may be redacted via the `ConfigModuleDependencyMetricsRedactIgnoredPrefixes` option. This is enabled by default.
   237  * Application Log Forwarding will now be **ENABLED** by default
   238     * Automatic application log forwarding is now enabled by default. This means that logging frameworks wrapped with one of the [logcontext-v2 integrations](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-compatibility-requirements/) will automatically send enriched application logs to New Relic with this version of the agent. To learn more about this feature, see the [APM logs in context documentation](https://docs.newrelic.com/docs/logs/logs-context/logs-in-context/). For additional configuration options, see the [Go logs in context documentation](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-go). To learn about how to toggle log ingestion on or off by account, see our documentation to [disable automatic](https://docs.newrelic.com/docs/logs/logs-context/disable-automatic-logging) logging via the UI or API.
   239     * If you are using a logcontext-v2 extension, but don't want the agent to automatically forward logs, please configure `ConfigAppLogForwardingEnabled(false)` in your application.
   240     * Environment variables have been added for all application logging config options:
   241     	* `NEW_RELIC_APPLICATION_LOGGING_ENABLED`
   242  	* `NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED`
   243  	* `NEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED`
   244  	* `NEW_RELIC_APPLICATION_LOGGING_METRICS_ENABLED`
   245  	* `NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED`
   246  * Custom Event Limit Increase
   247     * This version increases the **DEFAULT** limit of custom events from 10,000 events per minute to 30,000 events per minute. In the scenario that custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable **MAXIMUM** limit of 100,000 events per minute. To change the limits, set `ConfigCustomInsightsEventsMaxSamplesStored(limit)` to the limit you want in your application. To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub [post](https://discuss.newrelic.com/t/send-more-custom-events-with-the-latest-apm-agents/190497).
   248     * New config option `ConfigCustomInsightsEventsEnabled(false)` can be used to disable the collection of custom events in your application.
   249  
   250  ### Changed
   251  * Changed the following names to be consistent with their usage and other related identifier names. The old names remain for backward compatibility, but new code should use the new names.
   252     * `ConfigCodeLevelMetricsIgnoredPrefix` -> `ConfigCodeLevelMetricsIgnoredPrefixes`
   253     * `ConfigCodeLevelMetricsPathPrefix` -> `ConfigCodeLevelMetricsPathPrefixes`
   254     * `NEW_RELIC_CODE_LEVEL_METRICS_PATH_PREFIX` -> `NEW_RELIC_CODE_LEVEL_METRICS_PATH_PREFIXES`
   255     * `NEW_RELIC_CODE_LEVEL_METRICS_IGNORED_PREFIX` -> `NEW_RELIC_CODE_LEVEL_METRICS_IGNORED_PREFIXES`
   256  
   257  * When excluding information reported from CodeLevelMetrics via the `IgnoredPrefixes` or `PathPrefixes` configuration fields (e.g., by specifying `ConfigCodeLevelMetricsIgnoredPrefixes` or `ConfigCodeLevelMetricsPathPrefixes`), the names of the ignored prefixes and the configured path prefixes may now be redacted from the agent configuration information sent to New Relic.
   258     * This redaction is enabled by default, but may be disabled by supplying a `false` value to `ConfigCodeLevelMetricsRedactPathPrefixes` or `ConfigCodeLevelMetricsRedactIgnoredPrefixes`, or by setting the corresponding `Config` fields or environment variables to `false`.
   259  
   260  ### Fixed
   261  * [#583](https://github.com/TykTechnologies/newrelic-go-agent/issues/583): fixed a bug in zerologWriter where comma separated fields in log message confused the JSON parser and could cause panics.
   262  
   263  ### Support Statement
   264  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   265  
   266  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   267  
   268  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   269  
   270  ## 3.19.2
   271  
   272  ### Changed
   273  * Updated nrgin integration to more accurately report code locations when code level metrics are enabled.
   274  * The Go Agent and all integrations now require Go version 1.17 or later.
   275  * Updated minimum versions for third-party modules.
   276    * nrawssdk-v2, nrecho-v4, nrgrpc, nrmongo, nrmysql, nrnats, and nrstan now require Go Agent 3.18.2 or later
   277    * the Go Agent now requires protobuf 1.5.2 and grpc 1.49.0
   278  * Internal dev process and unit test improvements.
   279  
   280  ### Support Statement
   281  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   282  
   283  We also recommend using the latest version of the Go language. At minimum, you should at least be using no version of Go older than what is supported by the Go team themselves.
   284  
   285  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   286  
   287  
   288  ## 3.19.1 - Hotfix Release
   289  
   290  ### Changed
   291  * Moved the v3/internal/logcontext/nrwriter module to v3/integrations/logcontext-v2/nrwriter
   292  
   293  ### Support Statement
   294  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   295  
   296  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   297  
   298  ## 3.19.0
   299  
   300  ### Added
   301  * `logcontext-v2/logWriter` plugin: a new logs in context plugin that supports the standard library logging package.
   302  * `logcontext-v2/zerologWriter` plugin: a new logs in context plugin for zerolog that will replace the old logcontext-v2/zerolog plugin. This plugin is more robust, and will be able to support a richer set of features than the previous plugin.
   303  * see the updated [logs in context documentation](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-go) for information about configuration and installation.
   304  
   305  ### Changed
   306  * the logcontext-v2/zerolog plugin will be deprecated once the 3.17.0 release EOLs.
   307  
   308  ### Support Statement
   309  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   310  
   311  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   312  
   313  ## 3.18.2
   314  
   315  ### Added
   316  * Added `WithDefaultFunctionLocation` trace option. This allows the caller to indicate a fall-back function to use for CLM in case no other location was found first.
   317  * Added caching versions of the code-level metrics functions `ThisCodeLocation` and `FunctionLocation` , and trace options `WithThisCodeLocation`  and  `WithFunctionLocation`. These improve performance by caching the result of computing the source code location, and reuse that cached result on all subsequent calls.
   318  * Added a `WithCodeLevelMetrics` trace option to force the collection of CLM data even if it would have been excluded as being out of the configured scope. (Note that CLM data are _never_ collected if CLM is turned off globally or if the `WithoutCodeLevelMetrics` option was specified for the same transaction.)
   319  * Added an exported `CodeLevelMetricsScopeLabelToValue` function to convert a list of strings describing CLM scopes in the same manner as the `NEW_RELIC_CODE_LEVEL_METRICS_SCOPE` environment variable (but as individual string parameters), returning the `CodeLevelMetricsScope` value which corresponds to that set of scopes.
   320  * Added a new `CodeLevelMetricsScopeLabelListToValue` function which takes a comma-separated list of scope names exactly as the `NEW_RELIC_CODE_LEVEL_METRICS_SCOPE` environment variable does, and returns the `CodeLevelMetrics` value corresponding to that set of scopes.
   321  * Added text marshaling and unmarshaling for the `CodeLevelMetricsScope` value, allowing the `CodeLevelMetrics` field of the configuration `struct` to be converted to or from JSON or other text-based encoding representations.
   322  
   323  ### Changed
   324  * The `WithPathPrefix` trace option now takes any number of `string` parameters, allowing multiple path prefixes to be recognized rather than just one.
   325  * The `FunctionLocation` function now accepts any number of function values instead of just a single one. The first such parameter which indicates a valid function, and for which CLM data are successfully obtained, is the one which will be reported.
   326  * The configuration `struct` field `PathPrefix` is now deprecated with the introduction of a new `PathPrefixes` field. This allows for multiple path prefixes to be given to the agent instead of only a single one. 
   327  * The `NEW_RELIC_CODE_LEVEL_METRICS_SCOPE` environment variable now accepts a comma-separated list of pathnames.
   328  
   329  ### Fixed
   330  * Improved the implementation of CLM internals to improve speed, robustness, and thread safety.
   331  * Corrected the implementation of the `WrapHandle` and `WrapHandleFunc` functions so that they consistently report the function being invoked by the `http` framework, and improved them to use the new caching functions and ensured they are thread-safe.
   332  
   333  This release fixes [issue #557](https://github.com/TykTechnologies/newrelic-go-agent/issues/557).
   334  
   335  ### Compatibility Notice
   336  As of release 3.18.0, the API was extended by allowing custom options to be added to calls to the `Application.StartTransaction` method and the `WrapHandle`  and `WrapHandleFunc` functions. They are implemented as variadic functions such that the new option parameters are optional (i.e., zero or more options may be added to the end of the function calls) to be backward-compatible with pre-3.18.0 usage of those functions. This prevents the changes from breaking existing code for typical usage of the agent. However, it does mean those functions' call signatures have changed:
   337   * `StartTransaction(string)` -> `StartTransaction(string, ...TraceOption)`
   338   *  `WrapHandle(*Application, string, http.Handler)` -> `WrapHandle(*Application, string, http.Handler, ...TraceOption)`
   339   *  `WrapHandleFunc(*Application, string, func(http.ResponseWriter, *http.Request))`    -> `WrapHandleFunc(*Application, string, func(http.ResponseWriter, *http.Request), ...TraceOption)`
   340     
   341  If, for example, you created your own custom interface type which includes the `StartTransaction` method or something that depends on these functions' exact  call semantics, that code will need to be updated accordingly before using version 3.18.0 (or later) of the Go Agent.
   342  
   343  ### Support Statement
   344  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   345  
   346  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   347  
   348  
   349  ## 3.18.1
   350  ### Added
   351  * Extended the `IgnoredPrefix` configuration value for Code-Level Metrics so that multiple such prefixes may be given instead of a single one. This deprecates the `IgnoredPrefix` configuration field of `Config.CodeLevelMetrics` in favor of a new slice field `IgnoredPrefixes`. The corresponding configuration option-setting functions `ConfigCodeLevelMetricsIgnoredPrefix` and `WithIgnoredPrefix` now take any number of string parameters to set these values. Since those functions used to take a single string value, this change is backward-compatible with pre-3.18.1 code.  Accordingly, the `NEW_RELIC_CODE_LEVEL_METRICS_IGNORED_PREFIX` environment variable is now a comma-separated list of prefixes.  Fixes [Issue #551](https://github.com/TykTechnologies/newrelic-go-agent/issues/551).
   352  
   353  ### Fixed
   354  * Corrected some small errors in documentation of package features. Fixes [Issue #550](https://github.com/TykTechnologies/newrelic-go-agent/issues/550)
   355  
   356  ### Compatibility Notice
   357  As of release 3.18.0, the API was extended by allowing custom options to be added to calls to the `Application.StartTransaction` method and the `WrapHandle` and `WrapHandleFunc` functions. They are implemented as variadic functions such that the new option parameters are optional (i.e., zero or more options may be added to the end of the function calls) to be backward-compatible with pre-3.18.0 usage of those functions. This prevents the changes from breaking existing code for typical usage of the agent. However, it does mean those functions' call signatures have changed:
   358   * `StartTransaction(string)` -> `StartTransaction(string, ...TraceOption)`
   359   *  `WrapHandle(*Application, string, http.Handler)` -> `WrapHandle(*Application, string, http.Handler, ...TraceOption)`
   360   *  `WrapHandleFunc(*Application, string, func(http.ResponseWriter, *http.Request))`	-> `WrapHandleFunc(*Application, string, func(http.ResponseWriter, *http.Request), ...TraceOption)`
   361     
   362  If, for example, you created your own custom interface type which includes the `StartTransaction` method or something that depends on these functions' exact call semantics, that code will need to be updated accordingly before using version 3.18.0 (or later) of the Go Agent.
   363  
   364  ### Support Statement
   365  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   366  
   367  See the [Go Agent EOL Policy](https://docs.newrelic.com/docs/apm/agents/go-agent/get-started/go-agent-eol-policy/) for details about supported versions of the Go Agent and third-party components.
   368  
   369  ## 3.18.0
   370  ### Added
   371  * Code-Level Metrics are now available for instrumented transactions. This is off by default but once enabled via `ConfigCodeLevelMetricsEnabled(true)` transactions will include information about the location in the source code where `StartTransaction` was invoked.
   372     * Adds information about where in your source code transaction traces originated.
   373     * See the Go Agent documentation for details on [configuring](https://docs.newrelic.com/docs/apm/agents/go-agent/configuration/go-agent-code-level-metrics-config) Code-Level Metrics and how to [instrument](https://docs.newrelic.com/docs/apm/agents/go-agent/instrumentation/go-agent-code-level-metrics-instrument) your code using them.
   374  * New V2 logs in context plugin is available for Logrus, packed with all the features you didn't know you wanted:
   375     * Automatic Log Forwarding
   376     * Log Metrics
   377     * Capture logs anywhere in your code; both inside or outside of a transaction.
   378     * Use the Logrus formatting package of your choice
   379     * Local Log Decorating is now available for the new logcontext-v2/nrlogrus plugin only. This is off by default but can be enabled with `ConfigAppLogForwardingEnabled(true)`.
   380  
   381  ### Fixed
   382   * Fixed issue with custom event limits and number of DT Spans to more accurately follow configured limits.
   383  
   384  ### Compatibility Notice
   385  This release extends the API by allowing custom options to be added to calls to the `Application.StartTransaction` method and the `WrapHandle` and `WrapHandleFunc` functions. They are implemented as variadic functions such that the new option parameters are optional (i.e., zero or more options may be added to the end of the function calls) to be backward-compatible with pre-3.18.0 usage of those functions.
   386  This prevents the changes from breaking existing code for typical usage of the agent. However, it does mean those functions' call signatures have changed:
   387   * `StartTransaction(string)` -> `StartTransaction(string, ...TraceOption)`
   388   * `WrapHandle(*Application, string, http.Handler)` -> `WrapHandle(*Application, string, http.Handler, ...TraceOption)`
   389   * `WrapHandleFunc(*Application, string, func(http.ResponseWriter, *http.Request))` -> `WrapHandleFunc(*Application, string, func(http.ResponseWriter, *http.Request), ...TraceOption)`
   390  
   391  If, for example, you created your own custom interface type which includes the `StartTransaction` method or something that depends on these functions' exact call semantics, that code will need to be updated accordingly before using version 3.18.0 of the Go Agent.
   392  
   393  ### Support Statement
   394  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   395  * Note that the oldest supported version of the Go Agent is 3.6.0.
   396  
   397  ## 3.17.0
   398  ### Added
   399  * Logs in context now supported for zerolog.
   400  * This is a quick way to view logs no matter where you are in the platform.
   401  	* Adds support for logging metrics which shows the rate of log messages by severity in the Logs chart in the APM Summary view. This is enabled by default in this release.
   402  	* Adds support for forwarding application logs to New Relic. This automatically sends application logs that have been enriched to power APM logs in context. This is disabled by default in this release. This will be on by default in a future release.
   403  	* To learn more about APM logs in context see the documentation [here](https://docs.newrelic.com/docs/logs/logs-context/logs-in-context).
   404  	* Includes the `RecordLog` function for recording log data from a single log entry
   405  	* An integrated plugin for zerolog to automatically ingest log data with the Go Agent.
   406  	* Resolves [issue 178](https://github.com/TykTechnologies/newrelic-go-agent/issues/178), [issue 488](https://github.com/TykTechnologies/newrelic-go-agent/issues/488), [issue 489](https://github.com/TykTechnologies/newrelic-go-agent/issues/489), [issue 490](https://github.com/TykTechnologies/newrelic-go-agent/issues/490), and [issue 491](https://github.com/TykTechnologies/newrelic-go-agent/issues/491) .
   407  * Added integration for MS SQL Server ([PR 425](https://github.com/TykTechnologies/newrelic-go-agent/pull/425); thanks @ishahid91!)
   408  	* This introduces the `nrmssql` integration v1.0.0.
   409  * Added config function `ConfigCustomInsightsEventsMaxSamplesStored` for limiting the number of samples stored in a custom insights event. Fixes [issue 476](https://github.com/TykTechnologies/newrelic-go-agent/issues/476)
   410  
   411  ### Fixed
   412  * Improved speed of building distributed trace header JSON payload. Fixes [issue 505](https://github.com/TykTechnologies/newrelic-go-agent/issues/505).
   413  * Renamed the gRPC attribute names from  `GrpcStatusLevel`, `GrpcStatusMessage`, and `GrpcStatusCode` to `grpcStatusLevel`, `grpcStatusMessage`, and `grpcStatusCode` respectively, to conform to existing naming conventions for New Relic agents. Fixes [issue 492](https://github.com/TykTechnologies/newrelic-go-agent/issues/492).
   414  * Updated `go.mod` for the `nrgin` integration to mitigate security issue in 3rd party dependency.
   415  * Updated `go.mod` for the `nrawssdk-v1` integration to properly reflect its dependency on version 3.16.0 of the Go Agent.
   416  * Updated `go.mod` for the `nrlambda` integration to require `aws-lambda-go` version 1.20.0. ([PR 356](https://github.com/TykTechnologies/newrelic-go-agent/pull/356); thanks MattWhelan!)
   417  
   418  ### Support Statement
   419  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   420  * Note that the oldest supported version of the Go Agent is 3.6.0.
   421  
   422  # ChangeLog
   423  ## 3.16.1
   424  ### Fixed
   425  * Changed dependency on gRPC from v1.27.0 to v1.39.0. This in turn changes gRPC's dependency on `x/crypto` to v0.0.0-20200622213623-75b288015ac9, which fixes a security vulnerability in the `x/crypto` standard library module. Fixes [issue #451](https://github.com/TykTechnologies/newrelic-go-agent/issues/451).
   426  * Incremented version number of the `nrawssdk-v1` integration from v1.0.1 to v1.1.0 to resolve an incompatibility issue due to changes to underlying code. Fixes [issue #499](https://github.com/TykTechnologies/newrelic-go-agent/issues/499)
   427  
   428  ### Support Statement
   429  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   430  
   431  ## 3.16.0
   432  ### Added
   433  * Distributed Tracing is now the default mode of operation. It may be disabled by user configuration if so desired. [PR #495](https://github.com/TykTechnologies/newrelic-go-agent/pull/495)
   434     * To disable DT, add `newrelic.ConfigDistributedTracerEnabled(false)` to your application configuration.
   435     * To change the reservoir limit for how many span events are to be collected per harvest cycle from the default, add `newrelic.ConfigDistributedTracerReservoirLimit(`*newlimit*`)` to your application configuration.
   436     * The reservoir limit's default was increased from 1000 to 2000.
   437     * The maximum reservoir limit supported is 10,000.
   438  * Note that Cross Application Tracing is now deprecated.
   439  * Added support for gathering memory statistics via `PhysicalMemoryBytes` functions for OpenBSD.
   440  
   441  ### Fixed
   442  * Corrected some example code to be cleaner.
   443  * Updated version of nats-streaming-server. [PR #458](https://github.com/TykTechnologies/newrelic-go-agent/pull/458)
   444  * Correction to nrpkgerrors so that `nrpkgerrors.Wrap`  now checks if the error it is passed has attributes, and if it does, copies them into the New Relic error it creates.
   445  This fixes [issue #409](https://github.com/TykTechnologies/newrelic-go-agent/issues/409) via [PR #441](https://github.com/TykTechnologies/newrelic-go-agent/pull/441).
   446     * This increments the `nrpkgerrors` version to v1.1.0.
   447  
   448  ### Support Statement
   449  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   450  
   451  
   452  ## 3.15.2
   453  ### Added
   454  * Strings logged via the Go Agent's built-in logger will have strings of the form `license_key=`*hex-string* changed to `license_key=[redacted]` before they are output, regardless of severity level, where *hex-string* means a sequence of upper- or lower-case hexadecimal digits and dots ('.'). This incorporates [PR #415](https://github.com/TykTechnologies/newrelic-go-agent/pull/415).
   455  
   456  ### Support Statement
   457  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   458  
   459  ## 3.15.1
   460  
   461  ### Fixed
   462  
   463  * Updated support for SQL database instrumentation across the board for the Go Agent’s database integrations to more accurately extract the database table name from SQL queries. Fixes [Issue #397](https://github.com/TykTechnologies/newrelic-go-agent/issues/397).
   464  
   465  * Updated the `go.mod` file in the `nrecho-v4` integration to require version 4.5.0 of the `github.com/labstack/echo` package. This addresses a security concern arising from downstream dependencies in older versions of the echo package, as described in the [release notes](https://github.com/labstack/echo/releases/tag/v4.5.0) for `echo` v4.5.0.
   466  
   467  ### ARM64 Compatibility Note
   468  
   469  The New Relic Go Agent is implemented in platform-independent Go, and supports (among the other platforms which run Go) ARM64/Graviton2 using Go 1.17+.
   470  
   471  ### Support Statement
   472  
   473  New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   474  
   475  
   476  
   477  ## 3.15.0
   478  
   479  ### Fixed
   480  * Updated mongodb driver version to 1.5.1 to fix security issue in external dependency. Fixes [Issue #358](https://github.com/TykTechnologies/newrelic-go-agent/issues/358) and [Issue #370](https://github.com/TykTechnologies/newrelic-go-agent/pull/370).
   481  
   482  * Updated the `go.mod` file in the `nrgin` integration to require version 1.7.0 of the `github.com/gin-gonic/gin` package. This addresses [CVE-2020-28483](https://github.com/advisories/GHSA-h395-qcrw-5vmq) which documents a vulnerability in versions of `github.com/gin-gonic/gin` earlier than 1.7.0. 
   483  
   484  
   485  ### Added
   486  * New integration `nrpgx` added to provide the same functionality for instrumenting Postgres database queries as the existing `nrpq` integration, but using the [pgx](https://github.com/jackc/pgx) driver instead. This only covers (at present) the use case of the `pgx` driver with the standard library `database/sql`. Fixes [Issue #142](https://github.com/TykTechnologies/newrelic-go-agent/issues/142) and [Issue #292](https://github.com/TykTechnologies/newrelic-go-agent/issues/292)
   487  
   488  ### Changed
   489  * Enhanced debugging logs so that New Relic license keys are redacted from the log output. Fixes [Issue #353](https://github.com/TykTechnologies/newrelic-go-agent/issues/353).
   490  
   491  * Updated the advice in `GUIDE.md` to have correct `go get` commands with explicit reference to `v3`. 
   492  
   493  ### Support Statement
   494  New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   495  
   496  ## 3.14.1
   497  
   498  ### Fixed
   499  * A typographical error in the nrgrpc unit tests was fixed. Fixes [Issue #344](https://github.com/TykTechnologies/newrelic-go-agent/issues/344).
   500    This updates the nrgrpc integration to version 1.3.1.
   501  
   502  ### Support Statement
   503  New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   504  
   505  
   506  ## 3.14.0
   507  
   508  ### Fixed
   509  * Integration tags and `go.mod` files for integrations were updated so that [pkg.go.dev]() displays the documentation for each integration correctly.
   510  * The `nrgrpc` server integration was reporting all non-`OK` grpc statuses as errors. This has now been changed so that only selected grpc status codes will be reported as errors. Others are shown (via transaction attributes) as "warnings" or "informational" messages. There is a built-in set of defaults as to which status codes are reported at which severity levels, but this may be overridden by the caller as desired. Also supports custom grpc error handling functions supplied by the user.
   511     * This is implemented by adding `WithStatusHandler()` options to the end of the `UnaryServerInterceptor()` and `StreamServerInterceptor()` calls, thus extending the capability of those functions while retaining the existing functionality and usage syntax for backward compatibility.
   512  * Added advice on the recommended usage of the `app.WaitForConnection()` method. Fixes [Issue #296](https://github.com/TykTechnologies/newrelic-go-agent/issues/296)
   513  
   514  ### Added
   515  * Added a convenience function to build distributed trace header set from a JSON string for use with the `AcceptDistributedTraceHeaders()` method. Normally, you must create a valid set of HTTP headers representing the trace identification information from the other trace so the new trace will be associated with it. This needs to be in a Go `http.Header` type value.
   516     * If working only in Go, this may be just fine as it is. However, if the other trace information came from another source, possibly in a different language or environment, it is often the case that the trace data is already presented to you in the form of a JSON string.
   517     * This new function, `DistributedTraceHeadersFromJSON()`, creates the required `http.Header` value from the JSON string without requiring manual effort on your part. 
   518     * We also provide a new all-in-one method `AcceptDistributedTraceHeadersFromJSON()` to be used in place of `AcceptDistributedTraceHeaders()`. It accepts a JSON string rather than an `http.Header`, adding its trace info to the new transaction in one step.
   519     * Fixes [Issue #331](https://github.com/TykTechnologies/newrelic-go-agent/issues/331)
   520  
   521  ### Changed
   522  * Improved the NR AWS SDK V2 integration to use the current transaction rather than the one passed in during middleware creation, if `nil` is passed into nrawssdk-v2.AppendMiddlewares. Thanks to @HenriBeck for noticing and suggesting improvement, and thanks to @nc-wittj for the fantastic PR! [#328](https://github.com/TykTechnologies/newrelic-go-agent/pull/328)
   523  
   524  ### Support Statement
   525  New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
   526  
   527  ## 3.13.0
   528  
   529  ### Fixed
   530  * Replaced the NR AWS SDK V2 integration for the v3 agent with a new version that works. See the v3/integrations/nrawssdk-v2/example/main.go file for an example of how to use it. Issues [#250](https://github.com/TykTechnologies/newrelic-go-agent/issues/250) and [#288](https://github.com/TykTechnologies/newrelic-go-agent/issues/288) are fixed by this PR. [#309](https://github.com/TykTechnologies/newrelic-go-agent/pull/309)
   531  
   532  * Fixes issue [#221](https://github.com/TykTechnologies/newrelic-go-agent/issues/221): grpc errors reported in code watched by `UnaryServerInterceptor()` or `StreamServerInterceptor()` now create error events which are reported to the UI with the error message string included.  [#317](https://github.com/TykTechnologies/newrelic-go-agent/pull/317)
   533  
   534  * Fixes documentation in `GUIDE.md` for `txn.StartExternalSegment()` to reflect the v3 usage. Thanks to @abeltay for calling this to our attention and submitting PR [#320](https://github.com/TykTechnologies/newrelic-go-agent/pull/320).
   535  
   536  ### Changes
   537  * The v3/examples/server/main.go example now uses `newrelic.ConfigFromEnvironment()`, rather than explicitly pulling in the license key with `newrelic.ConfigLicense(os.Getenv("NEW_RELIC_LICENSE_KEY"))`. The team is starting to use this as a general systems integration testing script, and this facilitates testing with different settings enabled.
   538  
   539  ### Support Statement
   540  * New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach [end-of-life](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/notification-changes-new-relic-saas-features-distributed-software).
   541  
   542  ## 3.12.0
   543  
   544  ### Changes
   545  * Updated `CHANGELOG.md` release notes language, to correct typographical errors and
   546  clean up grammar. [#289](https://github.com/TykTechnologies/newrelic-go-agent/issues/289)
   547  
   548  ### Fixed
   549  * When using DAX to query a dynamodb table, the New Relic instrumentation
   550  panics with a `nil dereference` error. This was due to the way that the
   551  request is made internally such that there is no `HTTPRequest.Header` 
   552  defined, but one was expected. This correction checks for the existence
   553  of that header and takes an appropriate course of action if one is not
   554  found. [#287](https://github.com/TykTechnologies/newrelic-go-agent/issues/287) Thanks to
   555  @odannyc for reporting the issue and providing a pull request with a suggested
   556  fix.
   557  
   558  ### Support Statement
   559  * New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach [end-of-life](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/notification-changes-new-relic-saas-features-distributed-software).
   560  
   561  ## 3.11.0
   562  
   563  ### New Features
   564  * Aerospike is now included on the list of recognized datastore names. Thanks @vkartik97 for your PR! [#233](https://github.com/TykTechnologies/newrelic-go-agent/pull/233)
   565  * Added support for verison 8 of go-redis. Thanks @ilmimris for adding this instrumentation! [#251](https://github.com/TykTechnologies/newrelic-go-agent/pull/251)
   566  
   567  ### Changes
   568  * Changed logging level for messages resulting from Infinite Tracing load balancing operations. These were previously logged as errors, and now they are debugging messages. [#276](https://github.com/TykTechnologies/newrelic-go-agent/pull/276)
   569  
   570  ### Fixed
   571  * When the agent is configured with `cfg.ErrorCollector.RecordPanics` set to `true`, panics would be recorded by New Relic, but stack traces would not be logged as the Go Runtime usually does. The agent now logs stack traces from within its panic handler, providing similar functionality. [#278](https://github.com/TykTechnologies/newrelic-go-agent/pull/278)
   572  * Added license files to some integrations packages to ensure compatibility with package.go.dev. Now the documentation for our integrations shows up again on go.docs.
   573  
   574  ### Support statement
   575  * New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach [end-of-life](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/notification-changes-new-relic-saas-features-distributed-software).
   576  
   577  ## 3.10.0
   578  
   579  ### New Features
   580  * To keep up with the latest security protocols implemented by Amazon Web
   581    Services, the agent now uses [AWS
   582    IMDSv2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html)
   583    to find utilization data. [#249](https://github.com/TykTechnologies/newrelic-go-agent/pull/249)
   584  
   585  ### Changes
   586  * Updated the locations of our license files so that Go docs https://pkg.go.dev 
   587    will display our agent. Thanks @tydavis for your PR to fix this! [#254](https://github.com/TykTechnologies/newrelic-go-agent/pull/254)
   588  * Added an Open Source repo linter GitHub action that runs on push. [#262](https://github.com/TykTechnologies/newrelic-go-agent/pull/262)
   589  * Updated the README.md file to correctly show the support resources from New Relic. [#255](https://github.com/TykTechnologies/newrelic-go-agent/pull/255)
   590  
   591  ### Support statement
   592  * New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach [end-of-life](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/notification-changes-new-relic-saas-features-distributed-software).
   593  
   594  ## 3.9.0
   595  
   596  ### Changes
   597  * When sending Serverless telemetry using the `nrlambda` integration, support an externally-managed named pipe.
   598  
   599  ## 3.8.1
   600  
   601  ### Bug Fixes
   602  
   603  * Fixed an issue that could cause orphaned Distributed Trace spans when using
   604    SQL instrumentation like `nrmysql`.
   605  
   606  ## 3.8.0
   607  
   608  ### Changes
   609  * When marking a transaction as a web transaction using 
   610  [Transaction.SetWebRequest](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#Transaction.SetWebRequest), 
   611  it is now possible to include a `Host` field in the 
   612  [WebRequest](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#WebRequest)
   613   struct, which defaults to the empty string.
   614  
   615  ### Bug Fixes
   616  
   617  * The `Host` header is now being correctly captured and recorded in the 
   618   `request.headers.host` attribute, as described 
   619   [here](https://docs.newrelic.com/docs/agents/go-agent/instrumentation/go-agent-attributes#requestHeadersHost).
   620  *  Previously, the timestamps on Spans and Transactions were being written
   621     using different data types, which sometimes caused rounding errors that
   622     could cause spans to be offset incorrectly in the UI. This has been fixed.
   623  
   624  ## 3.7.0
   625  
   626  ### Changes
   627  
   628  * When `Config.Transport` is nil, no longer use the `http.DefaultTransport`
   629    when communicating with the New Relic backend.  This addresses an issue with
   630    shared transports as described in https://github.com/golang/go/issues/33006.
   631  
   632  * If a timeout occurs when attempting to send data to the New Relic backend,
   633    instead of dropping the data, we save it and attempt to send it with the
   634    next harvest.  Note data retention limits still apply and the agent will
   635    still start to drop data when these limits are reached. We attempt to keep
   636    the highest priority events and traces.
   637  
   638  ## 3.6.0
   639  
   640  ### New Features
   641  
   642  * Added support for [adding custom attributes directly to
   643    spans](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#Segment.AddAttribute).
   644    These attributes will be visible when looking at spans in the Distributed
   645    Tracing UI.
   646  
   647    Example:
   648    ```go
   649    txn := newrelic.FromContext(r.Context())
   650    sgmt := txn.StartSegment("segment1")
   651    defer sgmt.End()
   652    sgmt.AddAttribute("mySpanString", "hello")
   653    sgmt.AddAttribute("mySpanInt", 123)
   654    ```
   655  
   656  * Custom attributes added to the transaction with `txn.AddAttribute` are now
   657    also added to the root Span Event and will be visible when looking at the
   658    span in the Distributed Tracing UI. These custom attributes can be disabled
   659    from all destinations using `Config.Attributes.Exclude` or disabled from Span
   660    Events specifically using `Config.SpanEvents.Attributes.Exclude`.
   661  
   662  * Agent attributes added to the transaction are now also added to the root Span
   663    Event and will be visible when looking at the span in the Distributed Tracing
   664    UI. These attributes include the `request.uri` and the `request.method` along
   665    with all other attributes listed in the [attributes section of our
   666    godocs](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#pkg-constants).
   667    These agent attributes can be disabled from all destinations using
   668    `Config.Attributes.Exclude` or disabled from Span Events specifically using
   669    `Config.SpanEvents.Attributes.Exclude`.
   670  
   671  ### Bug Fixes
   672  
   673  * Fixed an issue where it was impossible to exclude the attributes
   674    `error.class` and `error.message` from the root Span Event. This issue has
   675    now been fixed. These attributes can now be excluded from all Span Events
   676    using `Config.Attributes.Exclude` or `Config.SpanEvents.Attributes.Exclude`.
   677    
   678  * Fixed an issue that caused Go's data race warnings to trigger in certain situations 
   679    when using the `newrelic.NewRoundTripper`. There were no reports of actual data corruption, 
   680    but now the warnings should be resolved. Thank you to @blixt for bringing this to our 
   681    attention!
   682  
   683  ## 3.5.0
   684  
   685  ### New Features
   686  
   687  * Added support for [Infinite Tracing on New Relic
   688    Edge](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/enable-configure/enable-distributed-tracing).
   689  
   690    Infinite Tracing observes 100% of your distributed traces and provides
   691    visualizations for the most actionable data so you have the examples of errors
   692    and long-running traces so you can better diagnose and troubleshoot your systems.
   693  
   694    You [configure your
   695    agent](https://docs.newrelic.com/docs/agents/go-agent/configuration/go-agent-configuration#infinite-tracing)
   696    to send traces to a trace observer in New Relic Edge.  You view your
   697    distributed traces through the New Relic’s UI. There is no need to install a
   698    collector on your network.
   699  
   700    Infinite Tracing is currently available on a sign-up basis. If you would like to
   701    participate, please contact your sales representative.
   702    
   703    **As part of this change, the Go Agent now has an added dependency on gRPC.** 
   704    This is true whether or not you enable the Infinite Tracing feature. The gRPC dependencies include these two libraries:
   705    * [github.com/golang/protobuf](https://github.com/golang/protobuf) v1.3.3
   706    * [google.golang.org/grpc](https://github.com/grpc/grpc-go) v1.27.0
   707  
   708    You can see the changes in the [go.mod file](v3/go.mod) 
   709  
   710    **As part of this change, the Go Agent now has an added dependency on gRPC.** 
   711    This is true whether or not you enable the Infinite Tracing feature. The gRPC dependencies include these two libraries:
   712    * [github.com/golang/protobuf](https://github.com/golang/protobuf) v1.3.3
   713    * [google.golang.org/grpc](https://github.com/grpc/grpc-go) v1.27.0
   714  
   715    You can see the changes in the [go.mod file](v3/go.mod) 
   716  
   717  ### Changes
   718  
   719  * [`nrgin.Middleware`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgin#Middleware)
   720    uses
   721    [`Context.FullPath()`](https://godoc.org/github.com/gin-gonic/gin#Context.FullPath)
   722    for transaction names when using Gin version 1.5.0 or greater.  Gin
   723    transactions were formerly named after the
   724    [`Context.HandlerName()`](https://godoc.org/github.com/gin-gonic/gin#Context.HandlerName),
   725    which uses reflection.  This change improves transaction naming and reduces
   726    overhead.  Please note that because your transaction names will change, you
   727    may have to update any related dashboards and alerts to match the new name.
   728    If you wish to continue using `Context.HandlerName()` for your transaction
   729    names, use
   730    [`nrgin.MiddlewareHandlerTxnNames`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgin#MiddlewareHandlerTxnNames)
   731    instead.
   732  
   733    ```go
   734    // Transactions previously named
   735    "GET main.handleGetUsers"
   736    // will be change to something like this match the full path
   737    "GET /user/:id"
   738    ```
   739  
   740    Note: As part of agent release v3.4.0, a v2.0.0 tag was added to the nrgin
   741    package.  When using go modules however, it was impossible to install this
   742    latest version of nrgin.  The v2.0.0 tag has been removed and replaced with
   743    v1.1.0.
   744  
   745  ## 3.4.0
   746  
   747  ### New Features
   748  
   749  * Attribute `http.statusCode` has been added to external span events
   750    representing the status code on an http response.  This attribute will be
   751    included when added to an ExternalSegment in one of these three ways:
   752  
   753    1. Using
   754       [`NewRoundTripper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#NewRoundTripper)
   755       with your http.Client
   756    2. Including the http.Response as a field on your
   757       [`ExternalSegment`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#ExternalSegment)
   758    3. Using the new
   759       [`ExternalSegment.SetStatusCode`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#ExternalSegment.SetStatusCode)
   760       API to set the status code directly
   761  
   762    To exclude the `http.statusCode` attribute from span events, update your
   763    agent configuration like so, where `cfg` is your [`newrelic.Config`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#Config) object.
   764  
   765    ```go
   766    cfg.SpanEvents.Attributes.Exclude = append(cfg.SpanEvents.Attributes.Exclude, newrelic.SpanAttributeHTTPStatusCode)
   767    ```
   768  
   769  * Error attributes `error.class` and `error.message` are now included on the
   770   span event in which the error was noticed, or on the root span if an error
   771   occurs in a transaction with no segments (no chid spans). Only the most recent error
   772   information is added to the attributes; prior errors on the same span are
   773   overwritten.
   774  
   775    To exclude the `error.class` and/or `error.message` attributes from span events, update your
   776    agent configuration like so, where `cfg` is your [`newrelic.Config`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#Config) object.
   777  
   778    ```go
   779    cfg.SpanEvents.Attributes.Exclude = append(cfg.SpanEvents.Attributes.Exclude, newrelic.newrelic.SpanAttributeErrorClass, newrelic.SpanAttributeErrorMessage)
   780    ```
   781  
   782  ### Changes
   783  
   784  * Use
   785    [`Context.FullPath()`](https://godoc.org/github.com/gin-gonic/gin#Context.FullPath)
   786    for transaction names when using Gin version 1.5.0 or greater.  Gin
   787    transactions were formerly named after the
   788    [`Context.HandlerName()`](https://godoc.org/github.com/gin-gonic/gin#Context.HandlerName),
   789    which uses reflection.  This change improves transaction naming and reduces
   790    overhead.  Please note that because your transaction names will change, you
   791    may have to update any related dashboards and alerts to match the new name.
   792  
   793    ```go
   794    // Transactions previously named
   795    "GET main.handleGetUsers"
   796    // will be change to something like this match the full path
   797    "GET /user/:id"
   798    ```
   799  * If you are using any of these integrations, you must upgrade them when you
   800   upgrade the agent:
   801      * [nrlambda v1.1.0](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrlambda)
   802      * [nrmicro v1.1.0](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrmicro)
   803      * [nrnats v1.1.0](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrnats)
   804      * [nrstan v1.1.0](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrstan)
   805      
   806  ### Known Issues and Workarounds
   807  
   808  * If a .NET agent is initiating distributed traces as the root service, you must 
   809    update that .NET agent to version 8.24 or later before upgrading your downstream 
   810    Go New Relic agents to this agent release.
   811  
   812  ## 3.3.0
   813  
   814  ### New Features
   815  
   816  * Added support for GraphQL in two new integrations:
   817    * [graph-gophers/graphql-go](https://github.com/graph-gophers/graphql-go)
   818    with
   819    [v3/integrations/nrgraphgophers](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgraphgophers).
   820      * [Documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgraphgophers)
   821      * [Example](v3/integrations/nrgraphgophers/example/main.go)
   822    * [graphql-go/graphql](https://github.com/graphql-go/graphql)
   823    with
   824    [v3/integrations/nrgraphqlgo](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgraphqlgo).
   825      * [Documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgraphqlgo)
   826      * [Example](v3/integrations/nrgraphqlgo/example/main.go)
   827  
   828  * Added database instrumentation support for
   829    [snowflakedb/gosnowflake](https://github.com/snowflakedb/gosnowflake).
   830    * [Documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrsnowflake)
   831    * [Example](v3/integrations/nrsnowflake/example/main.go)
   832  
   833  ### Changes
   834  
   835  * When using
   836    [`newrelic.StartExternalSegment`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#StartExternalSegment)
   837    or
   838    [`newrelic.NewRoundTripper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#NewRoundTripper),
   839    if existing cross application tracing or distributed tracing headers are
   840    present on the request, they will be replaced instead of added.
   841  
   842  * The
   843    [`FromContext`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#FromContext)
   844    API which allows you to pull a Transaction from a context.Context will no
   845    longer panic if the provided context is nil.  In this case, a nil is
   846    returned.
   847    
   848  ### Known Issues and Workarounds
   849  
   850  * If a .NET agent is initiating distributed traces as the root service, you must 
   851    update that .NET agent to version 8.24 or later before upgrading your downstream 
   852    Go New Relic agents to this agent release.
   853  
   854  ## 3.2.0
   855  
   856  ### New Features
   857  
   858  * Added support for `v7` of [go-redis/redis](https://github.com/go-redis/redis)
   859    in the new [v3/integrations/nrredis-v7](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrredis-v7)
   860    package.
   861    * [Documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrredis-v7)
   862    * [Example](v3/integrations/nrredis-v7/example/main.go)
   863  
   864  ### Changes
   865  
   866  * Updated Gorilla instrumentation to include request time spent in middlewares.
   867    Added new `nrgorilla.Middleware` and deprecated `nrgorilla.InstrumentRoutes`.
   868    Register the new middleware as your first middleware using
   869    [`Router.Use`](https://godoc.org/github.com/gorilla/mux#Router.Use). See the
   870    [godocs
   871    examples](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgorilla)
   872    for more details.
   873  
   874    ```go
   875    r := mux.NewRouter()
   876    // Always register the nrgorilla.Middleware first.
   877    r.Use(nrgorilla.Middleware(app))
   878  
   879    // All handlers and custom middlewares will be instrumented.  The
   880    // transaction will be available in the Request's context.
   881    r.Use(MyCustomMiddleware)
   882    r.Handle("/", makeHandler("index"))
   883  
   884    // The NotFoundHandler and MethodNotAllowedHandler must be instrumented
   885    // separately using newrelic.WrapHandle.  The second argument to
   886    // newrelic.WrapHandle is used as the transaction name; the string returned
   887    // from newrelic.WrapHandle should be ignored.
   888    _, r.NotFoundHandler = newrelic.WrapHandle(app, "NotFoundHandler", makeHandler("not found"))
   889    _, r.MethodNotAllowedHandler = newrelic.WrapHandle(app, "MethodNotAllowedHandler", makeHandler("method not allowed"))
   890  
   891    http.ListenAndServe(":8000", r)
   892    ```
   893  
   894  ### Known Issues and Workarounds
   895  
   896  * If a .NET agent is initiating distributed traces as the root service, you must 
   897    update that .NET agent to version 8.24 or later before upgrading your downstream 
   898    Go New Relic agents to this agent release.
   899  
   900  ## 3.1.0
   901  
   902  ### New Features
   903  
   904  * Support for W3C Trace Context, with easy upgrade from New Relic trace context.
   905  
   906    Distributed Tracing now supports W3C Trace Context headers for HTTP and
   907    gRPC protocols when distributed tracing is enabled.  Our implementation can
   908    accept and emit both W3C trace header format and New Relic trace header
   909    format.  This simplifies agent upgrades, allowing trace context to be
   910    propagated between services with older and newer releases of New Relic
   911    agents.  W3C trace header format will always be accepted and emitted.  New
   912    Relic trace header format will be accepted, and you can optionally disable
   913    emission of the New Relic trace header format.
   914  
   915    When distributed tracing is enabled with
   916    `Config.DistributedTracer.Enabled = true`, the Go agent will now accept
   917    W3C's `traceparent` and `tracestate` headers when calling
   918    [`Transaction.AcceptDistributedTraceHeaders`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#Transaction.AcceptDistributedTraceHeaders).  When calling
   919    [`Transaction.InsertDistributedTraceHeaders`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#Transaction.InsertDistributedTraceHeaders), the Go agent will include the
   920    W3C headers along with the New Relic distributed tracing header, unless
   921    the New Relic trace header format is disabled using
   922    `Config.DistributedTracer.ExcludeNewRelicHeader = true`.
   923  
   924  * Added support for [elastic/go-elasticsearch](https://github.com/elastic/go-elasticsearch)
   925    in the new [v3/integrations/nrelasticsearch-v7](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrelasticsearch-v7)
   926    package.
   927  
   928  * At this time, the New Relic backend has enabled support for real time
   929    streaming.  Versions 2.8 and above will now send data to New Relic every five
   930    seconds, instead of every minute.  As a result, transaction, error, and custom
   931    events will now be available in New Relic One and Insights dashboards in near
   932    real time.
   933    
   934  ### Known Issues and Workarounds
   935  
   936  * If a .NET agent is initiating distributed traces as the root service, you must update 
   937    that .NET agent to version 8.24 or later before upgrading your downstream 
   938    Go New Relic agents to this agent release.
   939  
   940  ## 3.0.0
   941  
   942  We are pleased to announce the release of Go Agent v3.0.0!  This is a major release
   943  that includes some breaking changes that will simplify your future use of the Go
   944  Agent.
   945  
   946  Please pay close attention to the list of Changes.
   947  
   948  ### Changes
   949  
   950  * A full list of changes and a step by step checklist on how to upgrade can
   951    be found in the [v3 Migration Guide](MIGRATION.md).
   952  
   953  ### New Features
   954  
   955  * Support for Go Modules.  Our Go agent integration packages support frameworks
   956    and libraries which are changing over time. With support for Go Modules, we
   957    are now able to release instrumentation packages for multiple versions of
   958    frameworks and libraries with a single agent release; and support operation
   959    of the Go agent in Go Modules environments.   This affects naming of our
   960    integration packages, as described in the v3 Migration Guide (see under
   961    "Changes" above).
   962  
   963  * Detect and set hostnames based on Heroku dyno names.  When deploying an
   964    application in Heroku, the hostnames collected will now match the dyno name.
   965    This serves to greatly improve the usability of the servers list in APM since
   966    dyno names are often sporadic or fleeting in nature.  The feature is
   967    controlled by two new configuration options `Config.Heroku.UseDynoNames` and
   968    `Config.Heroku.DynoNamePrefixesToShorten`.
   969  
   970  ## 2.16.3
   971  
   972  ### New Relic's Go agent v3.0 is currently available for review and beta testing.  Your use of this pre-release is at your own risk. New Relic disclaims all warranties, express or implied, regarding the beta release.
   973  
   974  ### If you do not manually take steps to use the new v3 folder you will not see any changes in your agent.
   975  
   976  This is the third release of the pre-release of Go agent v3.0.  It includes
   977  changes due to user feedback during the pre-release. The existing agent in
   978  `"github.com/TykTechnologies/newrelic-go-agent"` is unchanged.  The Go agent v3.0 code in the v3
   979  folder has the following changes:
   980  
   981  * A [ConfigFromEnvironment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#ConfigFromEnvironment)
   982    bug has been fixed.
   983  
   984  ## 2.16.2
   985  
   986  ### New Relic's Go agent v3.0 is currently available for review and beta testing. Your use of this pre-release is at your own risk. New Relic disclaims all warranties, express or implied, regarding the beta release.
   987  
   988  ### If you do not manually take steps to use the new v3 folder, as described below, you will not see any changes in your agent.
   989  
   990  This is the second release of the pre-release of Go agent v3.0.  It includes changes due to user feedback during the pre-release. The existing
   991  agent in `"github.com/TykTechnologies/newrelic-go-agent"` is unchanged.  The Go agent v3.0 code
   992  in the v3 folder has the following changes:
   993  
   994  * Transaction names created by [`WrapHandle`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#WrapHandle),
   995  [`WrapHandleFunc`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#WrapHandleFunc),
   996  [nrecho-v3](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrecho-v3),
   997  [nrecho-v4](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrecho-v4),
   998  [nrgorilla](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgorilla), and
   999  [nrgin](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/integrations/nrgin) now
  1000  include the HTTP method.  For example, the following code:
  1001  
  1002    ```go
  1003    http.HandleFunc(newrelic.WrapHandleFunc(app, "/users", usersHandler))
  1004    ```
  1005  
  1006    now creates a metric called `WebTransaction/Go/GET /users` instead of
  1007    `WebTransaction/Go/users`.  As a result of this change, you may need to update
  1008    your alerts and dashboards.
  1009  
  1010  * The [ConfigFromEnvironment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#ConfigFromEnvironment)
  1011    config option is now strict.  If one of the environment variables, such as
  1012    `NEW_RELIC_DISTRIBUTED_TRACING_ENABLED`, cannot be parsed, then `Config.Error`
  1013    will be populated and [NewApplication](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#NewApplication)
  1014    will return an error.
  1015  
  1016  * [ConfigFromEnvironment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/v3/newrelic#ConfigFromEnvironment)
  1017    now processes `NEW_RELIC_ATTRIBUTES_EXCLUDE` and `NEW_RELIC_ATTRIBUTES_INCLUDE`.
  1018  
  1019  ## 2.16.1
  1020  
  1021  ### New Relic's Go agent v3.0 is currently available for review and beta testing. Your use of this pre-release is at your own risk. New Relic disclaims all warranties, express or implied, regarding the beta release.
  1022  
  1023  ### If you do not manually take steps to use the new v3 folder, as described below, you will not see any changes in your agent.
  1024  
  1025  This 2.16.1 release includes a new v3.0 folder which contains the pre-release of
  1026  Go agent v3.0; Go agent v3.0 includes breaking changes. We are seeking
  1027  feedback and hope that you will look this over and test out the changes prior
  1028  to the official release.
  1029  
  1030  **This is not an official 3.0 release, it is just a vehicle to gather feedback
  1031  on proposed changes**. It is not tagged as 3.0 in Github and the 3.0 release is
  1032  not yet available to update in your Go mod file. In order to test out these
  1033  changes, you will need to clone this repo in your Go source directory, under
  1034  `[go-src-dir]/src/github.com/TykTechnologies/newrelic-go-agent`. Once you have the source
  1035  checked out, you will need to follow the steps in the second section of
  1036  [v3/MIGRATION.md](v3/MIGRATION.md).
  1037  
  1038  A list of changes and installation instructions is included in the v3 folder
  1039  and can be found [here](v3/MIGRATION.md)
  1040  
  1041  For this pre-release (beta) version of Go agent v3.0, please note:
  1042  * The changes in the v3 folder represent what we expect to release in ~2 weeks
  1043  as our major 3.0 release. However, as we are soliciting feedback on the changes
  1044  and there is the possibility of some breaking changes before the official
  1045  release.
  1046  * This is not an official 3.0 release; it is not tagged as 3.0 in Github and
  1047  the 3.0 release is not yet available to update in your Go mod file.
  1048  * If you test out these changes and encounter issues, questions, or have
  1049  feedback that you would like to pass along, please open up an issue
  1050  [here](https://github.com/TykTechnologies/newrelic-go-agent/issues/new) and be sure to include
  1051  the label `3.0`.
  1052    * For normal (non-3.0) issues/questions we request that you report them via
  1053     our [support site](http://support.newrelic.com/) or our
  1054     [community forum](https://discuss.newrelic.com). Please only report
  1055     questions related to the 3.0 pre-release directly via GitHub.
  1056  
  1057  
  1058  ### New Features
  1059  
  1060  * V3 will add support for Go Modules. The go.mod files exist in the v3 folder,
  1061  but they will not be usable until we have fully tagged the 3.0 release
  1062  officially. Examples of version tags we plan to use for different modules
  1063  include:
  1064    * `v3.0.0`
  1065    * `v3/integrations/nrecho-v3/v1.0.0`
  1066    * `v3/integrations/nrecho-v4/v1.0.0`
  1067  
  1068  ### Changes
  1069  
  1070  * The changes are the ones that we have requested feedback previously in
  1071  [this issue](https://github.com/TykTechnologies/newrelic-go-agent/issues/106).  
  1072  * A full list of changes that are included, along with a checklist for
  1073   upgrading, is available in [v3/MIGRATION.md](v3/MIGRATION.md).
  1074  
  1075  ## 2.16.0
  1076  
  1077  ### Upcoming
  1078  
  1079  * The next release of the Go Agent is expected to be a major version release
  1080    to improve the API and incorporate Go modules.
  1081    Details available here: https://github.com/TykTechnologies/newrelic-go-agent/issues/106
  1082    We would love your feedback!
  1083  
  1084  ### Bug Fixes
  1085  
  1086  * Fixed an issue in the
  1087    [`nrhttprouter`](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrhttprouter)
  1088    integration where the transaction was not being added to the requests
  1089    context.  This resulted in an inability to access the transaction from within
  1090    an
  1091    [`httprouter.Handle`](https://godoc.org/github.com/julienschmidt/httprouter#Handle)
  1092    function.  This issue has now been fixed.
  1093  
  1094  ## 2.15.0
  1095  
  1096  ### New Features
  1097  
  1098  * Added support for monitoring [MongoDB](https://github.com/mongodb/mongo-go-driver/) queries with the new
  1099  [_integrations/nrmongo](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmongo)
  1100  package.
  1101  
  1102    * [Example application](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrmongo/example/main.go)
  1103    * [Full godocs Documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmongo)
  1104  
  1105  * Added new method `Transaction.IsSampled()` that returns a boolean that
  1106    indicates if the transaction is sampled.  A sampled transaction records a
  1107    span event for each segment.  Distributed tracing must be enabled for
  1108    transactions to be sampled.  `false` is returned if the transaction has
  1109    finished.  This sampling flag is needed for B3 trace propagation and
  1110    future support of W3C Trace Context.
  1111  
  1112  * Added support for adding [B3
  1113    Headers](https://github.com/openzipkin/b3-propagation) to outgoing requests.
  1114    This is helpful if the service you are calling uses B3 for trace state
  1115    propagation (for example, it uses Zipkin instrumentation).  You can use the
  1116    new
  1117    [_integrations/nrb3](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrb3)
  1118    package's
  1119    [`nrb3.NewRoundTripper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrb3#NewRoundTripper)
  1120    like this:
  1121  
  1122    ```go
  1123    // When defining the client, set the Transport to the NewRoundTripper. This
  1124    // will create ExternalSegments and add B3 headers for each request.
  1125    client := &http.Client{
  1126        Transport: nrb3.NewRoundTripper(nil),
  1127    }
  1128  
  1129    // Distributed Tracing must be enabled for this application.
  1130    // (see https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/enable-configure/enable-distributed-tracing)
  1131    txn := currentTxn()
  1132  
  1133    req, err := http.NewRequest("GET", "http://example.com", nil)
  1134    if nil != err {
  1135        log.Fatalln(err)
  1136    }
  1137  
  1138    // Be sure to add the transaction to the request context.  This step is
  1139    // required.
  1140    req = newrelic.RequestWithTransactionContext(req, txn)
  1141    resp, err := client.Do(req)
  1142    if nil != err {
  1143        log.Fatalln(err)
  1144    }
  1145  
  1146    defer resp.Body.Close()
  1147    fmt.Println(resp.StatusCode)
  1148    ```
  1149  
  1150  ### Bug Fixes
  1151  
  1152  * Fixed an issue where the
  1153    [`nrgin`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgin/v1)
  1154    integration was not capturing the correct response code in the case where no
  1155    response body was sent.  This issue has now been fixed but requires Gin
  1156    greater than v1.4.0.
  1157  
  1158  ## 2.14.1
  1159  
  1160  ### Bug Fixes
  1161  
  1162  * Removed the hidden `"NEW_RELIC_DEBUG_LOGGING"` environment variable setting
  1163    which was broken in release 2.14.0.
  1164  
  1165  ## 2.14.0
  1166  
  1167  ### New Features
  1168  
  1169  * Added support for a new segment type,
  1170    [`MessageProducerSegment`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#MessageProducerSegment),
  1171    to be used to track time spent adding messages to message queuing systems like
  1172    RabbitMQ or Kafka.
  1173  
  1174    ```go
  1175    seg := &newrelic.MessageProducerSegment{
  1176        StartTime:       newrelic.StartSegmentNow(txn),
  1177        Library:         "RabbitMQ",
  1178        DestinationType: newrelic.MessageExchange,
  1179        DestinationName: "myExchange",
  1180    }
  1181    // add message to queue here
  1182    seg.End()
  1183    ```
  1184  
  1185  * Added new attribute constants for use with message consumer transactions.
  1186    These attributes can be used to add more detail to a transaction that tracks
  1187    time spent consuming a message off a message queuing system like RabbitMQ or Kafka.
  1188    They can be added using
  1189    [`txn.AddAttribute`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Transaction).
  1190  
  1191    ```go
  1192    // The routing key of the consumed message.
  1193    txn.AddAttribute(newrelic.AttributeMessageRoutingKey, "myRoutingKey")
  1194    // The name of the queue the message was consumed from.
  1195    txn.AddAttribute(newrelic.AttributeMessageQueueName, "myQueueName")
  1196    // The type of exchange used for the consumed message (direct, fanout,
  1197    // topic, or headers).
  1198    txn.AddAttribute(newrelic.AttributeMessageExchangeType, "myExchangeType")
  1199    // The callback queue used in RPC configurations.
  1200    txn.AddAttribute(newrelic.AttributeMessageReplyTo, "myReplyTo")
  1201    // The application-generated identifier used in RPC configurations.
  1202    txn.AddAttribute(newrelic.AttributeMessageCorrelationID, "myCorrelationID")
  1203    ```
  1204  
  1205    It is recommended that at most one message is consumed per transaction.
  1206  
  1207  * Added support for [Go 1.13's Error wrapping](https://golang.org/doc/go1.13#error_wrapping).
  1208    `Transaction.NoticeError` now uses [Unwrap](https://golang.org/pkg/errors/#Unwrap)
  1209    recursively to identify the error's cause (the deepest wrapped error) when generating
  1210    the error's class field.  This functionality will help group your errors usefully.
  1211  
  1212    For example, when using Go 1.13, the following code:
  1213  
  1214    ```go
  1215    type socketError struct{}
  1216  
  1217    func (e socketError) Error() string { return "socket error" }
  1218  
  1219    func gamma() error { return socketError{} }
  1220    func beta() error  { return fmt.Errorf("problem in beta: %w", gamma()) }
  1221    func alpha() error { return fmt.Errorf("problem in alpha: %w", beta()) }
  1222  
  1223    func execute(txn newrelic.Transaction) {
  1224    	err := alpha()
  1225    	txn.NoticeError(err)
  1226    }
  1227    ```
  1228    captures an error with message `"problem in alpha: problem in beta: socket error"`
  1229    and class `"main.socketError"`.  Previously, the class was recorded as `"*fmt.wrapError"`.
  1230  
  1231  * A `Stack` field has been added to [Error](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Error),
  1232    which can be assigned using the new
  1233    [NewStackTrace](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewStackTrace) function.
  1234    This allows your error stack trace to show where the error happened, rather
  1235    than the location of the `NoticeError` call.
  1236  
  1237    `Transaction.NoticeError` not only checks for a stack trace (using
  1238    [StackTracer](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#StackTracer)) in
  1239    the error parameter, but in the error's cause as well.  This means that you
  1240    can create an [Error](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Error)
  1241    where your error occurred, wrap it multiple times to add information, notice it
  1242    with `NoticeError`, and still have a useful stack trace. Take a look!
  1243  
  1244    ```go
  1245    func gamma() error {
  1246    	return newrelic.Error{
  1247    		Message: "something went very wrong",
  1248    		Class:   "socketError",
  1249    		Stack:   newrelic.NewStackTrace(),
  1250    	}
  1251    }
  1252  
  1253    func beta() error  { return fmt.Errorf("problem in beta: %w", gamma()) }
  1254    func alpha() error { return fmt.Errorf("problem in alpha: %w", beta()) }
  1255  
  1256    func execute(txn newrelic.Transaction) {
  1257    	err := alpha()
  1258    	txn.NoticeError(err)
  1259    }
  1260    ```
  1261  
  1262    In this example, the topmost stack trace frame recorded is `"gamma"`,
  1263    rather than `"execute"`.
  1264  
  1265  * Added support for configuring a maximum number of transaction events per minute to be sent to New Relic.
  1266  It can be configured as follows:
  1267  
  1268    ```go
  1269    config := newrelic.NewConfig("Application Name", os.Getenv("NEW_RELIC_LICENSE_KEY"))  
  1270    config.TransactionEvents.MaxSamplesStored = 100
  1271    ```
  1272      * For additional configuration information, see our [documentation](https://docs.newrelic.com/docs/agents/go-agent/configuration/go-agent-configuration)
  1273  
  1274  
  1275  ### Miscellaneous
  1276  
  1277  * Updated the
  1278    [`nrmicro`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmicro)
  1279    package to use the new segment type
  1280    [`MessageProducerSegment`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#MessageProducerSegment)
  1281    and the new attribute constants:
  1282    * [`nrmicro.ClientWrapper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmicro#ClientWrapper)
  1283      now uses `newrelic.MessageProducerSegment`s instead of
  1284      `newrelic.ExternalSegment`s for calls to
  1285      [`Client.Publish`](https://godoc.org/github.com/micro/go-micro/client#Client).
  1286    * [`nrmicro.SubscriberWrapper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmicro#SubscriberWrapper)
  1287      updates transaction names and adds the attribute `message.routingKey`.
  1288  
  1289  * Updated the
  1290    [`nrnats`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrnats)
  1291    and
  1292    [`nrstan`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrstan)
  1293    packages to use the new segment type
  1294    [`MessageProducerSegment`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#MessageProducerSegment)
  1295    and the new attribute constants:
  1296    * [`nrnats.StartPublishSegment`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrnats#StartPublishSegment)
  1297      now starts and returns a `newrelic.MessageProducerSegment` type.
  1298    * [`nrnats.SubWrapper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrnats#SubWrapper)
  1299      and
  1300      [`nrstan.StreamingSubWrapper`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrstan#StreamingSubWrapper)
  1301      updates transaction names and adds the attributes `message.routingKey`,
  1302      `message.queueName`, and `message.replyTo`.
  1303  
  1304  ## 2.13.0
  1305  
  1306  ### New Features
  1307  
  1308  * Added support for [HttpRouter](https://github.com/julienschmidt/httprouter) in
  1309    the new [_integrations/nrhttprouter](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrhttprouter) package.  This package allows you to easily instrument inbound requests through the HttpRouter framework.
  1310  
  1311    * [Documentation](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrhttprouter)
  1312    * [Example](_integrations/nrhttprouter/example/main.go)
  1313  
  1314  * Added support for [github.com/uber-go/zap](https://github.com/uber-go/zap) in
  1315    the new
  1316    [_integrations/nrzap](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrzap)
  1317    package.  This package allows you to send agent log messages to `zap`.
  1318  
  1319  ## 2.12.0
  1320  
  1321  ### New Features
  1322  
  1323  * Added new methods to expose `Transaction` details:
  1324  
  1325    * `Transaction.GetTraceMetadata()` returns a
  1326      [TraceMetadata](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#TraceMetadata)
  1327      which contains distributed tracing identifiers.
  1328  
  1329    * `Transaction.GetLinkingMetadata()` returns a
  1330      [LinkingMetadata](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#LinkingMetadata)
  1331      which contains the fields needed to link data to a trace or entity.
  1332  
  1333  * Added a new plugin for the [Logrus logging
  1334    framework](https://github.com/sirupsen/logrus) with the new
  1335    [_integrations/logcontext/nrlogrusplugin](https://github.com/TykTechnologies/newrelic-go-agent/go-agent/tree/master/_integrations/logcontext/nrlogrusplugin)
  1336    package. This plugin leverages the new `GetTraceMetadata` and
  1337    `GetLinkingMetadata` above to decorate logs.
  1338  
  1339    To enable, set your log's formatter to the `nrlogrusplugin.ContextFormatter{}`
  1340  
  1341    ```go
  1342    logger := logrus.New()
  1343    logger.SetFormatter(nrlogrusplugin.ContextFormatter{})
  1344    ```
  1345  
  1346    The logger will now look for a `newrelic.Transaction` inside its context and
  1347    decorate logs accordingly.  Therefore, the Transaction must be added to the
  1348    context and passed to the logger.  For example, this logging call
  1349  
  1350    ```go
  1351    logger.Info("Hello New Relic!")
  1352    ```
  1353  
  1354    must be transformed to include the context, such as:
  1355  
  1356    ```go
  1357    ctx := newrelic.NewContext(context.Background(), txn)
  1358    logger.WithContext(ctx).Info("Hello New Relic!")
  1359    ```
  1360  
  1361    For full documentation see the
  1362    [godocs](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/logcontext/nrlogrusplugin)
  1363    or view the
  1364    [example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/logcontext/nrlogrusplugin/example/main.go).
  1365  
  1366  * Added support for [NATS](https://github.com/nats-io/nats.go) and [NATS Streaming](https://github.com/nats-io/stan.go)
  1367  monitoring with the new [_integrations/nrnats](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrnats) and
  1368  [_integrations/nrstan](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrstan) packages.  These packages
  1369  support instrumentation of publishers and subscribers.
  1370  
  1371    * [NATS Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrnats/examples/main.go)
  1372    * [NATS Streaming Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrstan/examples/main.go)
  1373  
  1374  * Enables ability to migrate to [Configurable Security Policies (CSP)](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/enable-configurable-security-policies) on a per agent basis for accounts already using [High Security Mode (HSM)](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode).
  1375    * Previously, if CSP was configured for an account, New Relic would not allow an agent to connect without the `security_policies_token`. This led to agents not being able to connect during the period between when CSP was enabled for an account and when each agent is configured with the correct token.
  1376    * With this change, when both HSM and CSP are enabled for an account, an agent (this version or later) can successfully connect with either `high_security: true` or the appropriate `security_policies_token` configured - allowing the agent to continue to connect after CSP is configured on the account but before the appropriate `security_policies_token` is configured for each agent.
  1377  
  1378  ## 2.11.0
  1379  
  1380  ### New Features
  1381  
  1382  * Added support for [Micro](https://github.com/micro/go-micro) monitoring with the new
  1383  [_integrations/nrmicro](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmicro)
  1384  package.  This package supports instrumentation for servers, clients, publishers, and subscribers.
  1385  
  1386    * [Server Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrmicro/example/server/server.go)
  1387    * [Client Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrmicro/example/client/client.go)
  1388    * [Publisher and Subscriber Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrmicro/example/pubsub/main.go)
  1389    * [Full godocs Documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmicro)
  1390  
  1391  * Added support for creating static `WebRequest` instances manually via the `NewStaticWebRequest` function. This can be useful when you want to create a web transaction but don't have an `http.Request` object. Here's an example of creating a static `WebRequest` and using it to mark a transaction as a web transaction:
  1392    ```go
  1393    hdrs := http.Headers{}
  1394    u, _ := url.Parse("http://example.com")
  1395    webReq := newrelic.NewStaticWebRequest(hdrs, u, "GET", newrelic.TransportHTTP)
  1396    txn := app.StartTransaction("My-Transaction", nil, nil)
  1397    txn.SetWebRequest(webReq)
  1398    ```
  1399  
  1400  ## 2.10.0
  1401  
  1402  ### New Features
  1403  
  1404  * Added support for custom events when using
  1405    [nrlambda](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrlambda).
  1406    Example Lambda handler which creates custom event:
  1407  
  1408     ```go
  1409     func handler(ctx context.Context) {
  1410  		if txn := newrelic.FromContext(ctx); nil != txn {
  1411  			txn.Application().RecordCustomEvent("myEvent", map[string]interface{}{
  1412  				"zip": "zap",
  1413  			})
  1414  		}
  1415  		fmt.Println("hello world!")
  1416     }
  1417     ```
  1418  
  1419  ## 2.9.0
  1420  
  1421  ### New Features
  1422  
  1423  * Added support for [gRPC](https://github.com/grpc/grpc-go) monitoring with the new
  1424  [_integrations/nrgrpc](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgrpc)
  1425  package.  This package supports instrumentation for servers and clients.
  1426  
  1427    * [Server Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrgrpc/example/server/server.go)
  1428    * [Client Example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrgrpc/example/client/client.go)
  1429  
  1430  * Added new
  1431    [ExternalSegment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#ExternalSegment)
  1432    fields `Host`, `Procedure`, and `Library`.  These optional fields are
  1433    automatically populated from the segment's `URL` or `Request` if unset.  Use
  1434    them if you don't have access to a request or URL but still want useful external
  1435    metrics, transaction segment attributes, and span attributes.
  1436    * `Host` is used for external metrics, transaction trace segment names, and
  1437      span event names.  The host of segment's `Request` or `URL` is the default.
  1438    * `Procedure` is used for transaction breakdown metrics.  If set, it should be
  1439      set to the remote procedure being called.  The HTTP method of the segment's `Request` is the default.
  1440    * `Library` is used for external metrics and the `"component"` span attribute.
  1441      If set, it should be set to the framework making the call. `"http"` is the default.
  1442  
  1443    With the addition of these new fields, external transaction breakdown metrics
  1444    are changed: `External/myhost.com/all` will now report as
  1445    `External/myhost.com/http/GET` (provided the HTTP method is `GET`).
  1446  
  1447  * HTTP Response codes below `100`, except `0` and `5`, are now recorded as
  1448    errors.  This is to support `gRPC` status codes.  If you start seeing
  1449    new status code errors that you would like to ignore, add them to
  1450    `Config.ErrorCollector.IgnoreStatusCodes` or your server side configuration
  1451    settings.
  1452  
  1453  * Improve [logrus](https://github.com/sirupsen/logrus) support by introducing
  1454    [nrlogrus.Transform](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrlogrus#Transform),
  1455    a function which allows you to turn a
  1456    [logrus.Logger](https://godoc.org/github.com/sirupsen/logrus#Logger) instance into a
  1457    [newrelic.Logger](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Logger).
  1458    Example use:
  1459  
  1460    ```go
  1461    l := logrus.New()
  1462    l.SetLevel(logrus.DebugLevel)
  1463    cfg := newrelic.NewConfig("Your Application Name", "__YOUR_NEW_RELIC_LICENSE_KEY__")
  1464    cfg.Logger = nrlogrus.Transform(l)
  1465    ```
  1466  
  1467    As a result of this change, the
  1468    [nrlogrus](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrlogrus)
  1469    package requires [logrus](https://github.com/sirupsen/logrus) version `v1.1.0`
  1470    and above.
  1471  
  1472  ## 2.8.1
  1473  
  1474  ### Bug Fixes
  1475  
  1476  * Removed `nrmysql.NewConnector` since
  1477    [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) has not yet
  1478    released `mysql.NewConnector`.
  1479  
  1480  ## 2.8.0
  1481  
  1482  ### New Features
  1483  
  1484  * Support for Real Time Streaming
  1485  
  1486    * The agent now has support for sending event data to New Relic every five
  1487      seconds, instead of every minute.  As a result, transaction, error, and
  1488      custom events will now be available in New Relic One and Insights dashboards
  1489      in near real time. For more information on how to view your events with a
  1490      five-second refresh, see the documentation.
  1491  
  1492    * Note that the overall limits on how many events can be sent per minute have
  1493      not changed. Also, span events, metrics, and trace data is unaffected, and
  1494      will still be sent every minute.
  1495  
  1496  * Introduce support for databases using
  1497    [database/sql](https://golang.org/pkg/database/sql/).  This new functionality
  1498    allows you to instrument MySQL, PostgreSQL, and SQLite calls without manually
  1499    creating
  1500    [DatastoreSegment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#DatastoreSegment)s.
  1501  
  1502    | Database Library Supported | Integration Package |
  1503    | ------------- | ------------- |
  1504    | [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) | [_integrations/nrmysql](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmysql) |
  1505    | [lib/pq](https://github.com/lib/pq) | [_integrations/nrpq](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrpq) |
  1506    | [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) | [_integrations/nrsqlite3](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrsqlite3) |
  1507  
  1508    Using these database integration packages is easy!  First replace the driver
  1509    with our integration version:
  1510  
  1511    ```go
  1512    import (
  1513    	// import our integration package in place of "github.com/go-sql-driver/mysql"
  1514    	_ "github.com/TykTechnologies/newrelic-go-agent/_integrations/nrmysql"
  1515    )
  1516  
  1517    func main() {
  1518    	// open "nrmysql" in place of "mysql"
  1519    	db, err := sql.Open("nrmysql", "user@unix(/path/to/socket)/dbname")
  1520    }
  1521    ```
  1522  
  1523    Second, use the `ExecContext`, `QueryContext`, and `QueryRowContext` methods of
  1524    [sql.DB](https://golang.org/pkg/database/sql/#DB),
  1525    [sql.Conn](https://golang.org/pkg/database/sql/#Conn),
  1526    [sql.Tx](https://golang.org/pkg/database/sql/#Tx), and
  1527    [sql.Stmt](https://golang.org/pkg/database/sql/#Stmt) and provide a
  1528    transaction-containing context.  Calls to `Exec`, `Query`, and `QueryRow` do not
  1529    get instrumented.
  1530  
  1531    ```go
  1532    ctx := newrelic.NewContext(context.Background(), txn)
  1533    row := db.QueryRowContext(ctx, "SELECT count(*) from tables")
  1534    ```
  1535  
  1536    If you are using a [database/sql](https://golang.org/pkg/database/sql/) database
  1537    not listed above, you can write your own instrumentation for it using
  1538    [InstrumentSQLConnector](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#InstrumentSQLConnector),
  1539    [InstrumentSQLDriver](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#InstrumentSQLDriver),
  1540    and
  1541    [SQLDriverSegmentBuilder](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#SQLDriverSegmentBuilder).
  1542    The integration packages act as examples of how to do this.
  1543  
  1544    For more information, see the [Go agent documentation on instrumenting datastore segments](https://docs.newrelic.com/docs/agents/go-agent/instrumentation/instrument-go-segments#go-datastore-segments).
  1545  
  1546  ### Bug Fixes
  1547  
  1548  * The [http.RoundTripper](https://golang.org/pkg/net/http/#RoundTripper) returned
  1549    by [NewRoundTripper](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewRoundTripper)
  1550    no longer modifies the request.  Our thanks to @jlordiales for the contribution.
  1551  
  1552  ## 2.7.0
  1553  
  1554  ### New Features
  1555  
  1556  * Added support for server side configuration.  Server side configuration allows
  1557   you to set the following configuration settings in the New Relic APM UI:
  1558  
  1559    * `Config.TransactionTracer.Enabled`
  1560    * `Config.ErrorCollector.Enabled`
  1561    * `Config.CrossApplicationTracer.Enabled`
  1562    * `Config.TransactionTracer.Threshold`
  1563    * `Config.TransactionTracer.StackTraceThreshold`
  1564    * `Config.ErrorCollector.IgnoreStatusCodes`
  1565  
  1566    For more information see the [server side configuration documentation](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/server-side-agent-configuration).
  1567  
  1568  * Added support for AWS Lambda functions in the new
  1569    [nrlambda](_integrations/nrlambda)
  1570    package.  Please email <lambda_preview@newrelic.com> if you are interested in
  1571    learning more or previewing New Relic Lambda monitoring.  This instrumentation
  1572    package requires `aws-lambda-go` version
  1573    [v1.9.0](https://github.com/aws/aws-lambda-go/releases) and above.
  1574  
  1575    * [documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrlambda)
  1576    * [working example](_integrations/nrlambda/example/main.go)
  1577  
  1578  ## 2.6.0
  1579  
  1580  ### New Features
  1581  
  1582  * Added support for async: the ability to instrument multiple concurrent
  1583    goroutines, or goroutines that access or manipulate the same Transaction.
  1584  
  1585    The new `Transaction.NewGoroutine() Transaction` method allows
  1586    transactions to create segments in multiple goroutines!
  1587  
  1588    `NewGoroutine` returns a new reference to the `Transaction`.  This must be
  1589    called any time you are passing the `Transaction` to another goroutine which
  1590    makes segments.  Each segment-creating goroutine must have its own `Transaction`
  1591    reference.  It does not matter if you call this before or after the other
  1592    goroutine has started.
  1593  
  1594    All `Transaction` methods can be used in any `Transaction` reference.  The
  1595    `Transaction` will end when `End()` is called in any goroutine.
  1596  
  1597    Example passing a new `Transaction` reference directly to another goroutine:
  1598  
  1599    ```go
  1600    	go func(txn newrelic.Transaction) {
  1601    		defer newrelic.StartSegment(txn, "async").End()
  1602    		time.Sleep(100 * time.Millisecond)
  1603    	}(txn.NewGoroutine())
  1604    ```
  1605  
  1606    Example passing a new `Transaction` reference on a channel to another
  1607    goroutine:
  1608  
  1609    ```go
  1610    	ch := make(chan newrelic.Transaction)
  1611    	go func() {
  1612    		txn := <-ch
  1613    		defer newrelic.StartSegment(txn, "async").End()
  1614    		time.Sleep(100 * time.Millisecond)
  1615    	}()
  1616    	ch <- txn.NewGoroutine()
  1617    ```
  1618  
  1619  * Added integration support for
  1620    [`aws-sdk-go`](https://github.com/aws/aws-sdk-go) and
  1621    [`aws-sdk-go-v2`](https://github.com/aws/aws-sdk-go-v2).
  1622  
  1623    When using these SDKs, a segment will be created for each out going request.
  1624    For DynamoDB calls, these will be Datastore segments and for all others they
  1625    will be External segments.
  1626    * [v1 Documentation](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrawssdk/v1)
  1627    * [v2 Documentation](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrawssdk/v2)
  1628  
  1629  * Added span event and transaction trace segment attribute configuration.  You
  1630    may control which attributes are captured in span events and transaction trace
  1631    segments using the `Config.SpanEvents.Attributes` and
  1632    `Config.TransactionTracer.Segments.Attributes` settings. For example, if you
  1633    want to disable the collection of `"db.statement"` in your span events, modify
  1634    your config like this:
  1635  
  1636    ```go
  1637    cfg.SpanEvents.Attributes.Exclude = append(cfg.SpanEvents.Attributes.Exclude,
  1638    	newrelic.SpanAttributeDBStatement)
  1639    ```
  1640  
  1641    To disable the collection of all attributes from your transaction trace
  1642    segments, modify your config like this:
  1643  
  1644    ```go
  1645    cfg.TransactionTracer.Segments.Attributes.Enabled = false
  1646    ```
  1647  
  1648  ### Bug Fixes
  1649  
  1650  * Fixed a bug that would prevent External Segments from being created under
  1651    certain error conditions related to Cross Application Tracing.
  1652  
  1653  ### Miscellaneous
  1654  
  1655  * Improved linking between Cross Application Transaction Traces in the APM UI.
  1656    When `Config.CrossApplicationTracer.Enabled = true`, External segments in the
  1657    Transaction Traces details will now link to the downstream Transaction Trace
  1658    if there is one. Additionally, the segment name will now include the name of
  1659    the downstream application and the name of the downstream transaction.
  1660  
  1661  * Update attribute names of Datastore and External segments on Transaction
  1662    Traces to be in line with attribute names on Spans. Specifically:
  1663      * `"uri"` => `"http.url"`
  1664      * `"query"` => `"db.statement"`
  1665      * `"database_name"` => `"db.instance"`
  1666      * `"host"` => `"peer.hostname"`
  1667      * `"port_path_or_id"` + `"host"` => `"peer.address"`
  1668  
  1669  ## 2.5.0
  1670  
  1671  * Added support for [New Relic Browser](https://docs.newrelic.com/docs/browser)
  1672    using the new `BrowserTimingHeader` method on the
  1673    [`Transaction`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Transaction)
  1674    which returns a
  1675    [BrowserTimingHeader](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#BrowserTimingHeader).
  1676    The New Relic Browser JavaScript code measures page load timing, also known as
  1677    real user monitoring.  The Pro version of this feature measures AJAX requests,
  1678    single-page applications, JavaScript errors, and much more!  Example use:
  1679  
  1680  ```go
  1681  func browser(w http.ResponseWriter, r *http.Request) {
  1682  	hdr, err := w.(newrelic.Transaction).BrowserTimingHeader()
  1683  	if nil != err {
  1684  		log.Printf("unable to create browser timing header: %v", err)
  1685  	}
  1686  	// BrowserTimingHeader() will always return a header whose methods can
  1687  	// be safely called.
  1688  	if js := hdr.WithTags(); js != nil {
  1689  		w.Write(js)
  1690  	}
  1691  	io.WriteString(w, "browser header page")
  1692  }
  1693  ```
  1694  
  1695  * The Go agent now collects an attribute named `request.uri` on Transaction
  1696    Traces, Transaction Events, Error Traces, and Error Events.  `request.uri`
  1697    will never contain user, password, query parameters, or fragment.  To prevent
  1698    the request's URL from being collected in any data, modify your `Config` like
  1699    this:
  1700  
  1701  ```go
  1702  cfg.Attributes.Exclude = append(cfg.Attributes.Exclude, newrelic.AttributeRequestURI)
  1703  ```
  1704  
  1705  ## 2.4.0
  1706  
  1707  * Introduced `Transaction.Application` method which returns the `Application`
  1708    that started the `Transaction`.  This method is useful since it may prevent
  1709    having to pass the `Application` to code that already has access to the
  1710    `Transaction`.  Example use:
  1711  
  1712  ```go
  1713  txn.Application().RecordCustomEvent("customerOrder", map[string]interface{}{
  1714  	"numItems":   2,
  1715  	"totalPrice": 13.75,
  1716  })
  1717  ```
  1718  
  1719  * The `Transaction.AddAttribute` method no longer accepts `nil` values since
  1720    our backend ignores them.
  1721  
  1722  ## 2.3.0
  1723  
  1724  * Added support for [Echo](https://echo.labstack.com) in the new `nrecho`
  1725    package.
  1726    * [Documentation](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrecho)
  1727    * [Example](_integrations/nrecho/example/main.go)
  1728  
  1729  * Introduced `Transaction.SetWebResponse(http.ResponseWriter)` method which sets
  1730    the transaction's response writer.  After calling this method, the
  1731    `Transaction` may be used in place of the `http.ResponseWriter` to intercept
  1732    the response code.  This method is useful when the `http.ResponseWriter` is
  1733    not available at the beginning of the transaction (if so, it can be given as a
  1734    parameter to `Application.StartTransaction`).  This method will return a
  1735    reference to the transaction which implements the combination of
  1736    `http.CloseNotifier`, `http.Flusher`, `http.Hijacker`, and `io.ReaderFrom`
  1737    implemented by the ResponseWriter.  Example:
  1738  
  1739  ```go
  1740  func setResponseDemo(txn newrelic.Transaction) {
  1741  	recorder := httptest.NewRecorder()
  1742  	txn = txn.SetWebResponse(recorder)
  1743  	txn.WriteHeader(200)
  1744  	fmt.Println("response code recorded:", recorder.Code)
  1745  }
  1746  ```
  1747  
  1748  * The `Transaction`'s `http.ResponseWriter` methods may now be called safely if
  1749    a `http.ResponseWriter` has not been set.  This allows you to add a response code
  1750    to the transaction without using a `http.ResponseWriter`.  Example:
  1751  
  1752  ```go
  1753  func transactionWithResponseCode(app newrelic.Application) {
  1754         txn := app.StartTransaction("hasResponseCode", nil, nil)
  1755         defer txn.End()
  1756         txn.WriteHeader(200) // Safe!
  1757  }
  1758  ```
  1759  
  1760  * The agent now collects environment variables prefixed by
  1761    `NEW_RELIC_METADATA_`.  Some of these may be added
  1762    Transaction events to provide context between your Kubernetes cluster and your
  1763    services. For details on the benefits (currently in beta) see [this blog
  1764    post](https://blog.newrelic.com/engineering/monitoring-application-performance-in-kubernetes/)
  1765  
  1766  * The agent now collects the `KUBERNETES_SERVICE_HOST` environment variable to
  1767    detect when the application is running on Kubernetes.
  1768  
  1769  * The agent now collects the fully qualified domain name of the host and
  1770    local IP addresses for improved linking with our infrastructure product.
  1771  
  1772  ## 2.2.0
  1773  
  1774  * The `Transaction` parameter to
  1775  [NewRoundTripper](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewRoundTripper)
  1776  and
  1777  [StartExternalSegment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#StartExternalSegment)
  1778  is now optional:  If it is `nil`, then a `Transaction` will be looked for in the
  1779  request's context (using
  1780  [FromContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#FromContext)).
  1781  Passing a `nil` transaction is **STRONGLY** recommended when using
  1782  [NewRoundTripper](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewRoundTripper)
  1783  since it allows one `http.Client.Transport` to be used for multiple
  1784  transactions.  Example use:
  1785  
  1786  ```go
  1787  client := &http.Client{}
  1788  client.Transport = newrelic.NewRoundTripper(nil, client.Transport)
  1789  request, _ := http.NewRequest("GET", "http://example.com", nil)
  1790  request = newrelic.RequestWithTransactionContext(request, txn)
  1791  resp, err := client.Do(request)
  1792  ```
  1793  
  1794  * Introduced `Transaction.SetWebRequest(WebRequest)` method which marks the
  1795  transaction as a web transaction.  If the `WebRequest` parameter is non-nil,
  1796  `SetWebRequest` will collect details on request attributes, url, and method.
  1797  This method is useful if you don't have access to the request at the beginning
  1798  of the transaction, or if your request is not an `*http.Request` (just add
  1799  methods to your request that satisfy
  1800  [WebRequest](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#WebRequest)).  To
  1801  use an `*http.Request` as the parameter, use the
  1802  [NewWebRequest](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewWebRequest)
  1803  transformation function.  Example:
  1804  
  1805  ```go
  1806  var request *http.Request = getInboundRequest()
  1807  txn.SetWebRequest(newrelic.NewWebRequest(request))
  1808  ```
  1809  
  1810  * Fixed `Debug` in `nrlogrus` package.  Previous versions of the New Relic Go Agent incorrectly
  1811  logged to Info level instead of Debug.  This has now been fixed.  Thanks to @paddycarey for catching this.
  1812  
  1813  * [nrgin.Transaction](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgin/v1#Transaction)
  1814  may now be called with either a `context.Context` or a `*gin.Context`.  If you were passing a `*gin.Context`
  1815  around your functions as a `context.Context`, you may access the Transaction by calling either
  1816  [nrgin.Transaction](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgin/v1#Transaction)
  1817  or [FromContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#FromContext).
  1818  These functions now work nicely together.
  1819  For example, [FromContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#FromContext) will return the `Transaction`
  1820  added by [nrgin.Middleware](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgin/v1#Middleware).
  1821  Thanks to @rodriguezgustavo for the suggestion.  
  1822  
  1823  ## 2.1.0
  1824  
  1825  * The Go Agent now supports distributed tracing.
  1826  
  1827    Distributed tracing lets you see the path that a request takes as it travels through your distributed system. By
  1828    showing the distributed activity through a unified view, you can troubleshoot and understand a complex system better
  1829    than ever before.
  1830  
  1831    Distributed tracing is available with an APM Pro or equivalent subscription. To see a complete distributed trace, you
  1832    need to enable the feature on a set of neighboring services. Enabling distributed tracing changes the behavior of
  1833    some New Relic features, so carefully consult the
  1834    [transition guide](https://docs.newrelic.com/docs/transition-guide-distributed-tracing) before you enable this
  1835    feature.
  1836  
  1837    To enable distributed tracing, set the following fields in your config.  Note that distributed tracing and cross
  1838    application tracing cannot be used simultaneously.
  1839  
  1840  ```
  1841    config := newrelic.NewConfig("Your Application Name", "__YOUR_NEW_RELIC_LICENSE_KEY__")
  1842    config.CrossApplicationTracer.Enabled = false
  1843    config.DistributedTracer.Enabled = true
  1844  ```
  1845  
  1846    Please refer to the
  1847    [distributed tracing section of the guide](GUIDE.md#distributed-tracing)
  1848    for more detail on how to ensure you get the most out of the Go agent's distributed tracing support.
  1849  
  1850  * Added functions [NewContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewContext)
  1851    and [FromContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#FromContext)
  1852    for adding and retrieving the Transaction from a Context.  Handlers
  1853    instrumented by
  1854    [WrapHandle](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#WrapHandle),
  1855    [WrapHandleFunc](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#WrapHandleFunc),
  1856    and [nrgorilla.InstrumentRoutes](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgorilla/v1#InstrumentRoutes)
  1857    may use [FromContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#FromContext)
  1858    on the request's context to access the Transaction.
  1859    Thanks to @caarlos0 for the contribution!  Though [NewContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#NewContext)
  1860    and [FromContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#FromContext)
  1861    require Go 1.7+ (when [context](https://golang.org/pkg/context/) was added),
  1862    [RequestWithTransactionContext](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#RequestWithTransactionContext) is always exported so that it can be used in all framework and library
  1863    instrumentation.
  1864  
  1865  ## 2.0.0
  1866  
  1867  * The `End()` functions defined on the `Segment`, `DatastoreSegment`, and
  1868    `ExternalSegment` types now receive the segment as a pointer, rather than as
  1869    a value. This prevents unexpected behaviour when a call to `End()` is
  1870    deferred before one or more fields are changed on the segment.
  1871  
  1872    In practice, this is likely to only affect this pattern:
  1873  
  1874      ```go
  1875      defer newrelic.DatastoreSegment{
  1876        // ...
  1877      }.End()
  1878      ```
  1879  
  1880    Instead, you will now need to separate the literal from the deferred call:
  1881  
  1882      ```go
  1883      ds := newrelic.DatastoreSegment{
  1884        // ...
  1885      }
  1886      defer ds.End()
  1887      ```
  1888  
  1889    When creating custom and external segments, we recommend using
  1890    [`newrelic.StartSegment()`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#StartSegment)
  1891    and
  1892    [`newrelic.StartExternalSegment()`](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#StartExternalSegment),
  1893    respectively.
  1894  
  1895  * Added GoDoc badge to README.  Thanks to @mrhwick for the contribution!
  1896  
  1897  * `Config.UseTLS` configuration setting has been removed to increase security.
  1898     TLS will now always be used in communication with New Relic Servers.
  1899  
  1900  ## 1.11.0
  1901  
  1902  * We've closed the Issues tab on GitHub. Please visit our
  1903    [support site](https://support.newrelic.com) to get timely help with any
  1904    problems you're having, or to report issues.
  1905  
  1906  * Added support for Cross Application Tracing (CAT). Please refer to the
  1907    [CAT section of the guide](GUIDE.md#cross-application-tracing)
  1908    for more detail on how to ensure you get the most out of the Go agent's new
  1909    CAT support.
  1910  
  1911  * The agent now collects additional metadata when running within Amazon Web
  1912    Services, Google Cloud Platform, Microsoft Azure, and Pivotal Cloud Foundry.
  1913    This information is used to provide an enhanced experience when the agent is
  1914    deployed on those platforms.
  1915  
  1916  ## 1.10.0
  1917  
  1918  * Added new `RecordCustomMetric` method to [Application](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Application).
  1919    This functionality can be used to track averages or counters without using
  1920    custom events.
  1921    * [Custom Metric Documentation](https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/collect-custom-metrics)
  1922  
  1923  * Fixed import needed for logrus.  The import Sirupsen/logrus had been renamed to sirupsen/logrus.
  1924    Thanks to @alfred-landrum for spotting this.
  1925  
  1926  * Added [ErrorAttributer](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#ErrorAttributer),
  1927    an optional interface that can be implemented by errors provided to
  1928    `Transaction.NoticeError` to attach additional attributes.  These attributes are
  1929    subject to attribute configuration.
  1930  
  1931  * Added [Error](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#Error), a type
  1932    that allows direct control of error fields.  Example use:
  1933  
  1934  ```go
  1935  txn.NoticeError(newrelic.Error{
  1936  	// Message is returned by the Error() method.
  1937  	Message: "error message: something went very wrong",
  1938  	Class:   "errors are aggregated by class",
  1939  	Attributes: map[string]interface{}{
  1940  		"important_number": 97232,
  1941  		"relevant_string":  "zap",
  1942  	},
  1943  })
  1944  ```
  1945  
  1946  * Updated license to address scope of usage.
  1947  
  1948  ## 1.9.0
  1949  
  1950  * Added support for [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin)
  1951    in the new `nrgin` package.
  1952    * [Documentation](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgin/v1)
  1953    * [Example](examples/_gin/main.go)
  1954  
  1955  ## 1.8.0
  1956  
  1957  * Fixed incorrect metric rule application when the metric rule is flagged to
  1958    terminate and matches but the name is unchanged.
  1959  
  1960  * `Segment.End()`, `DatastoreSegment.End()`, and `ExternalSegment.End()` methods now return an
  1961    error which may be helpful in diagnosing situations where segment data is unexpectedly missing.
  1962  
  1963  ## 1.7.0
  1964  
  1965  * Added support for [gorilla/mux](http://github.com/gorilla/mux) in the new `nrgorilla`
  1966    package.
  1967    * [Documentation](http://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrgorilla/v1)
  1968    * [Example](examples/_gorilla/main.go)
  1969  
  1970  ## 1.6.0
  1971  
  1972  * Added support for custom error messages and stack traces.  Errors provided
  1973    to `Transaction.NoticeError` will now be checked to see if
  1974    they implement [ErrorClasser](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#ErrorClasser)
  1975    and/or [StackTracer](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#StackTracer).
  1976    Thanks to @fgrosse for this proposal.
  1977  
  1978  * Added support for [pkg/errors](https://github.com/pkg/errors).  Thanks to
  1979    @fgrosse for this work.
  1980    * [documentation](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent/_integrations/nrpkgerrors)
  1981    * [example](https://github.com/TykTechnologies/newrelic-go-agent/blob/master/_integrations/nrpkgerrors/nrpkgerrors.go)
  1982  
  1983  * Fixed tests for Go 1.8.
  1984  
  1985  ## 1.5.0
  1986  
  1987  * Added support for Windows.  Thanks to @ianomad and @lvxv for the contributions.
  1988  
  1989  * The number of heap objects allocated is recorded in the
  1990    `Memory/Heap/AllocatedObjects` metric.  This will soon be displayed on the "Go
  1991    runtime" page.
  1992  
  1993  * If the [DatastoreSegment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#DatastoreSegment)
  1994    fields `Host` and `PortPathOrID` are not provided, they will no longer appear
  1995    as `"unknown"` in transaction traces and slow query traces.
  1996  
  1997  * Stack traces will now be nicely aligned in the APM UI.
  1998  
  1999  ## 1.4.0
  2000  
  2001  * Added support for slow query traces.  Slow datastore segments will now
  2002   generate slow query traces viewable on the datastore tab.  These traces include
  2003   a stack trace and help you to debug slow datastore activity.
  2004   [Slow Query Documentation](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/viewing-slow-query-details)
  2005  
  2006  * Added new
  2007  [DatastoreSegment](https://godoc.org/github.com/TykTechnologies/newrelic-go-agent#DatastoreSegment)
  2008  fields `ParameterizedQuery`, `QueryParameters`, `Host`, `PortPathOrID`, and
  2009  `DatabaseName`.  These fields will be shown in transaction traces and in slow
  2010  query traces.
  2011  
  2012  ## 1.3.0
  2013  
  2014  * Breaking Change: Added a timeout parameter to the `Application.Shutdown` method.
  2015  
  2016  ## 1.2.0
  2017  
  2018  * Added support for instrumenting short-lived processes:
  2019    * The new `Application.Shutdown` method allows applications to report
  2020      data to New Relic without waiting a full minute.
  2021    * The new `Application.WaitForConnection` method allows your process to
  2022      defer instrumentation until the application is connected and ready to
  2023      gather data.
  2024    * Full documentation here: [application.go](application.go)
  2025    * Example short-lived process: [examples/short-lived-process/main.go](examples/short-lived-process/main.go)
  2026  
  2027  * Error metrics are no longer created when `ErrorCollector.Enabled = false`.
  2028  
  2029  * Added support for [github.com/mgutz/logxi](github.com/mgutz/logxi).  See
  2030    [_integrations/nrlogxi/v1/nrlogxi.go](_integrations/nrlogxi/v1/nrlogxi.go).
  2031  
  2032  * Fixed bug where Transaction Trace thresholds based upon Apdex were not being
  2033    applied to background transactions.
  2034  
  2035  ## 1.1.0
  2036  
  2037  * Added support for Transaction Traces.
  2038  
  2039  * Stack trace filenames have been shortened: Any thing preceding the first
  2040    `/src/` is now removed.
  2041  
  2042  ## 1.0.0
  2043  
  2044  * Removed `BetaToken` from the `Config` structure.
  2045  
  2046  * Breaking Datastore Change:  `datastore` package contents moved to top level
  2047    `newrelic` package.  `datastore.MySQL` has become `newrelic.DatastoreMySQL`.
  2048  
  2049  * Breaking Attributes Change:  `attributes` package contents moved to top
  2050    level `newrelic` package.  `attributes.ResponseCode` has become
  2051    `newrelic.AttributeResponseCode`.  Some attribute name constants have been
  2052    shortened.
  2053  
  2054  * Added "runtime.NumCPU" to the environment tab.  Thanks sergeylanzman for the
  2055    contribution.
  2056  
  2057  * Prefixed the environment tab values "Compiler", "GOARCH", "GOOS", and
  2058    "Version" with "runtime.".
  2059  
  2060  ## 0.8.0
  2061  
  2062  * Breaking Segments API Changes:  The segments API has been rewritten with the
  2063    goal of being easier to use and to avoid nil Transaction checks.  See:
  2064  
  2065    * [segments.go](segments.go)
  2066    * [examples/server/main.go](examples/server/main.go)
  2067    * [GUIDE.md#segments](GUIDE.md#segments)
  2068  
  2069  * Updated LICENSE.txt with contribution information.
  2070  
  2071  ## 0.7.1
  2072  
  2073  * Fixed a bug causing the `Config` to fail to serialize into JSON when the
  2074    `Transport` field was populated.
  2075  
  2076  ## 0.7.0
  2077  
  2078  * Eliminated `api`, `version`, and `log` packages.  `Version`, `Config`,
  2079    `Application`, and `Transaction` now live in the top level `newrelic` package.
  2080    If you imported the  `attributes` or `datastore` packages then you will need
  2081    to remove `api` from the import path.
  2082  
  2083  * Breaking Logging Changes
  2084  
  2085  Logging is no longer controlled though a single global.  Instead, logging is
  2086  configured on a per-application basis with the new `Config.Logger` field.  The
  2087  logger is an interface described in [log.go](log.go).  See
  2088  [GUIDE.md#logging](GUIDE.md#logging).
  2089  
  2090  ## 0.6.1
  2091  
  2092  * No longer create "GC/System/Pauses" metric if no GC pauses happened.
  2093  
  2094  ## 0.6.0
  2095  
  2096  * Introduced beta token to support our beta program.
  2097  
  2098  * Rename `Config.Development` to `Config.Enabled` (and change boolean
  2099    direction).
  2100  
  2101  * Fixed a bug where exclusive time could be incorrect if segments were not
  2102    ended.
  2103  
  2104  * Fix unit tests broken in 1.6.
  2105  
  2106  * In `Config.Enabled = false` mode, the license must be the proper length or empty.
  2107  
  2108  * Added runtime statistics for CPU/memory usage, garbage collection, and number
  2109    of goroutines.
  2110  
  2111  ## 0.5.0
  2112  
  2113  * Added segment timing methods to `Transaction`.  These methods must only be
  2114    used in a single goroutine.
  2115  
  2116  * The license length check will not be performed in `Development` mode.
  2117  
  2118  * Rename `SetLogFile` to `SetFile` to reduce redundancy.
  2119  
  2120  * Added `DebugEnabled` logging guard to reduce overhead.
  2121  
  2122  * `Transaction` now implements an `Ignore` method which will prevent
  2123    any of the transaction's data from being recorded.
  2124  
  2125  * `Transaction` now implements a subset of the interfaces
  2126    `http.CloseNotifier`, `http.Flusher`, `http.Hijacker`, and `io.ReaderFrom`
  2127    to match the behavior of its wrapped `http.ResponseWriter`.
  2128  
  2129  * Changed project name from `go-sdk` to `go-agent`.
  2130  
  2131  ## 0.4.0
  2132  
  2133  * Queue time support added: if the inbound request contains an
  2134  `"X-Request-Start"` or `"X-Queue-Start"` header with a unix timestamp, the
  2135  agent will report queue time metrics.  Queue time will appear on the
  2136  application overview chart.  The timestamp may fractional seconds,
  2137  milliseconds, or microseconds: the agent will deduce the correct units.