Skip to content

Commit

Permalink
Merge pull request #230 from axw/0.5
Browse files Browse the repository at this point in the history
 module/apmgorm: fix premature Span.End()
  • Loading branch information
axw committed Sep 20, 2018
2 parents b585ee9 + 843020e commit df3d15a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## [Unreleased](https://github.com/elastic/apm-agent-go/compare/v0.5.1...master)
## [Unreleased](https://github.com/elastic/apm-agent-go/compare/v0.5.2...master)

## [v0.5.2](https://github.com/elastic/apm-agent-go/releases/tag/v0.5.2)

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

## [v0.5.1](https://github.com/elastic/apm-agent-go/releases/tag/v0.5.1)

Expand Down
2 changes: 1 addition & 1 deletion module/apmgorm/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func newAfterCallback(dsnInfo apmsql.DSNInfo) func(*gorm.Scope) {
Type: "sql",
User: dsnInfo.User,
})
span.End()
defer span.End()

// Capture errors, except for "record not found", which may be expected.
for _, err := range scope.DB().GetErrors() {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package elasticapm

const (
// AgentVersion is the Elastic APM Go Agent version.
AgentVersion = "0.5.1"
AgentVersion = "0.5.2"
)

0 comments on commit df3d15a

Please sign in to comment.