Disable default APM tracer.

This commit is contained in:
Ludovic Fernandez 2020-03-04 00:56:04 +01:00 committed by GitHub
parent 67e17def56
commit fb51ebcba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -15,6 +15,13 @@ import (
// Name sets the name of this tracer.
const Name = "elastic"
func init() {
// The APM lib uses the init() function to create a default tracer.
// So this default tracer must be disabled.
// https://github.com/elastic/apm-agent-go/blob/8dd383d0d21776faad8841fe110f35633d199a03/tracer.go#L61-L65
apm.DefaultTracer.Close()
}
// Config provides configuration settings for a elastic.co tracer.
type Config struct {
ServerURL string `description:"Set the URL of the Elastic APM server." json:"serverURL,omitempty" toml:"serverURL,omitempty" yaml:"serverURL,omitempty"`