From 32df9eaa35069b3e2104a67dc4552afd848e46cf Mon Sep 17 00:00:00 2001 From: "will@newrelic.com" Date: Mon, 27 Jan 2020 09:17:52 -0800 Subject: [PATCH] Document reason for config fields --- v3/newrelic/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/v3/newrelic/config.go b/v3/newrelic/config.go index 20393a072..051e57b93 100644 --- a/v3/newrelic/config.go +++ b/v3/newrelic/config.go @@ -629,6 +629,11 @@ func gatherMetadata(env []string) map[string]string { // config exists to avoid adding private fields to Config. type config struct { Config + // These fields based on environment variables are located here, rather + // than in appRun, to ensure that they are calculated during + // NewApplication (instead of at each connect) because some customers + // may unset environment variables after startup: + // https://github.com/newrelic/go-agent/issues/127 metadata map[string]string hostname string }