Skip to content

Releases: elastic/apm-agent-go

v1.1.0

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

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)

v1.0.0

14 Nov 14:48
@axw axw
cb9bc73
Compare
Choose a tag to compare

Major changes

The Go agent is now generally available. This version requires APM Server v6.5 or later.

  • The canonical import path is now "go.elastic.co/apm", and top-level package name is "apm" (#202)
  • The v2 intake protocol is now being used, and support for distributed tracing added (#180)
  • We've added support for multiple APM Server URLs with failover (#233)
  • All HTTP request/response headers are now reported, with configurable filtering (#280)
  • ELASTIC_APM_LOG_FILE and ELASTIC_APM_LOG_LEVEL introduced for logging agent behaviour (#313)
  • We've added support for mixing OpenTracing spans with native transactions/spans (#235)

New instrumentation modules

  • module/apmredigo: introduce gomodule/redigo instrumentation (#248)
  • module/apmrestful: introduce emicklei/go-restful instrumentation (#270)

Other changes

  • Unexported Transaction.Timestamp and Span.Timestamp (#207)
  • Dropped Context.SetCustom (#284)
  • Add support for span tags (#213)
  • Add jitter (+/-10%) to backoff on transport error (#212)
  • Require units for size configuration (#223)
  • Require units for duration configuration (#211)
  • Drop SetHTTPResponseHeadersSent and SetHTTPResponseFinished methods from Context (#238)
  • Stop setting custom context (gin.handler) in apmgin (#238)
  • Set response context in errors reported by web modules (#238)
  • Update Sampler interface to take TraceContext (#243)
  • Truncate SQL statements to a maximum of 10000 chars, all other strings to 1024 (#244, #276)
  • Add leading slash to URLs in transaction/span context (#250)
  • Add Transaction.Context method for setting framework (#252)
  • Timestamps are now reported as usec since epoch, spans no longer use "start" offset (#257)
  • Fix panic handling in web instrumentations (#273)
  • Migrate internal/fastjson to go.elastic.co/fastjson (#275)
  • Reuse memory for tags (#286)
  • Return a more helpful error message when /intake/v2/events 404s, to detect old servers (#290)
  • Implement test service for w3c/distributed-tracing test harness (#293)
  • End HTTP client spans on response body closure (#289)
  • module/apmgrpc requires Go 1.9+ (#300)
  • Invalid tag key characters are replaced with underscores (#308)
  • ELASTIC_APM_SANITIZE_FIELD_NAMES and ELASTIC_APM_IGNORE_URLS now use wildcard matching (#260)

0.5.2

20 Sep 02:50
@axw axw
df3d15a
Compare
Choose a tag to compare

Fixed premature Span.End() in apmgorm callback, causing a data-race with captured errors (#229)

0.5.1

05 Sep 10:57
@axw axw
a23d41b
Compare
Choose a tag to compare

Fixed a bug causing error stacktraces and culprit to sometimes not be set (#204)

0.5.0

30 Aug 04:55
@axw axw
38b0716
Compare
Choose a tag to compare
  • ELASTIC_APM_SERVER_URL now defaults to "http://localhost:8200" (#122)
  • Transport.SetUserAgent method added, enabling the User-Agent to be set programatically (#124)
  • Inlined functions are now properly reported in stacktraces (#127)
  • Support for the experimental metrics API added (#94)
  • module/apmsql: SQL is parsed to generate more useful span names (#129)
  • Basic vgo module added (#136)
  • module/apmhttprouter: added a wrapper type for httprouter.Router to simplify adding routes (#140)
  • Add Transaction.Context methods for setting user IDs (#144)
  • module/apmgocql: new instrumentation module, providing an observer for gocql (#148)
  • Add ELASTIC_APM_SERVER_TIMEOUT config (#157)
  • Add ELASTIC_APM_IGNORE_URLS config (#158)
  • module/apmsql: fix a bug preventing errors from being captured (#160)
  • Introduce Tracer.StartTransactionOptions, drop variadic args from Tracer.StartTransaction (#165)
  • module/apmgorm: introduce GORM instrumentation module (#169, #170)
  • module/apmhttp: record outgoing request URLs in span context (#172)
  • module/apmot: introduce OpenTracing implementation (#173)

In the next release we will be changing the canonical import path prefix to "go.elastic.co/apm", and the top-level package name to "apm". Please consider vendoring if this will break your builds.

v0.4.0

18 Jun 03:20
@axw axw
a228397
Compare
Choose a tag to compare

This is the first release we consider to be production-ready. We do not
anticipate significant breaking changes to the API, but we do not rule
it out entirely.