Skip to content

v1.1.0

Compare
Choose a tag to compare
@axw axw released this 13 Dec 03:36
9abbae5

Major changes / new instrumentation modules

module/apmlogrus: introduce Logrus error-tracking hook, and log correlation (#381)

We have introduced module/apmlogrus, which provides two integrations with Logrus: a logrus.Hook implementation which sends error log records to Elastic APM, and a function for adding trace, transaction, and span ID fields to log records.

module/apmbeego: introduce Beego instrumentation module (#386)

This new instrumentation module provides tracing middleware for the Beego web framework. This currently covers the web requests, and not beego/orm.

Stop pooling Transaction/Span/Error, introduce internal pooled objects (#319)

Prior to this release, Transaction, Span and Error objects returned by StartTransaction, StartSpan and NewError respectively were pooled to minimise memory allocation overhead, at the cost of having to handle the objects with care; once a transaction was ended, it would no longer be valid for use. The intention was to educate users to handle these objects carefully.

It turned out to be too easy to access ended transactions, particularly when used with context objects with cancellation. For example, an instrumented HTTP handler might pass its context onto another goroutine; some time later that goroutine attempts to start a span using the context, but the request has timed out and accordingly ended the transaction.

We have changed how pooling works, so that it operates internally within the Transaction, Span, and Error objects. This means a slightly higher allocation overhead, but it is now safe to access an ended Transaction, Span, or Error.

Bug fixes

apm.StartSpanOptions fixed to stop ignoring options (#326)

apm.StartSpanOptions was ignoring the options provided, which meant, for example, you could not provide the start timestamp. Many thanks to @ChristophPech for the fix!

module/apmsql: don't report driver.ErrBadConn, context.Canceled (#346, #348)

module/apmsql will no longer report "bad connection" or "context canceled" errors.

"Bad connection" errors occur when a pooled database connection becomes stale/unusable, which can occur in normal usage. Internally, database/sql will attempt to fetch another pooled connection, and finally attempt to make a new connection, under these circumstances. Since these are not indicative of application errors, and are not actionable, we will stop reporting them to the user.

Similarly, we were reporting "context canceled" errors from module/apmsql, as these may be intentional and not related to any application logic error.

Other changes

  • ELASTIC_APM_SERVER_CERT enables server certificate pinning (#325)
  • Add Docker container ID to metadata (#330)
  • Add Kubernetes pod info to metadata (#342)
  • Added distributed trace context propagation to apmgrpc (#335)
  • Introduce Span.Subtype, Span.Action (#332)
  • Enable metrics collection with default interval of 30s (#322)
  • Added ErrorLogRecord.Error field, for associating an error value with a log record (#380)
  • module/apmhttp: report status code for client spans (#388)