From 15132f2a59c40097afc409819a1e80f48938b0d6 Mon Sep 17 00:00:00 2001 From: Leo Cavaille Date: Tue, 27 Mar 2018 14:16:45 +0200 Subject: [PATCH] config: support overriding agent endpoint via env --- config/merge_env.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/merge_env.go b/config/merge_env.go index ad76306f7..e916fdc5b 100644 --- a/config/merge_env.go +++ b/config/merge_env.go @@ -26,6 +26,10 @@ func mergeEnv(c *AgentConfig) { c.HostName = v } + if v := os.Getenv("DD_TRACE_AGENT_ENDPOINT"); v != "" { + c.APIEndpoint = v + } + if v := os.Getenv("DD_API_KEY"); v != "" { vals := strings.Split(v, ",") for i := range vals {