Skip to content

Commit

Permalink
Fix apmcloudutil logger assignment (#1158)
Browse files Browse the repository at this point in the history
* Fix apmcloudutil logger assignment

Assigning nil pointer to an interface.

* Update changelog
  • Loading branch information
axw authored Nov 25, 2021
1 parent fe066b0 commit 1ae5839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ https://github.com/elastic/apm-agent-go/compare/v1.14.0...master[View commits]
- Experimental support to compress short exit spans into a composite span. Disabled by default. {pull}1134[#(1134)]
- Discard exit spans shorter or equal than `ELASTIC_APM_EXIT_SPAN_MIN_DURATION`. Defaults to `1ms`. {pull}1138[#(1138)]
- module/apmprometheus: add support for mapping prometheus histograms. {pull}1145[#(1145)]
- Fixed a bug where errors in cloud metadata discovery could lead to the process aborting during initialisation {pull}1158[#(1158)]
[[release-notes-1.x]]
=== Go Agent version 1.x
Expand Down
5 changes: 4 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ func getCloudMetadata() *model.Cloud {
// package initialisation time. Instead, we defer until it is
// first requested by the tracer.
cloudMetadataOnce.Do(func() {
logger := apmlog.DefaultLogger
var logger apmcloudutil.Logger
if apmlog.DefaultLogger != nil {
logger = apmlog.DefaultLogger
}
provider := apmcloudutil.Auto
if str := os.Getenv(envCloudProvider); str != "" {
var err error
Expand Down

0 comments on commit 1ae5839

Please sign in to comment.