diff --git a/agent/endpoint.go b/agent/endpoint.go index 7db4b474e..bbd91e077 100644 --- a/agent/endpoint.go +++ b/agent/endpoint.go @@ -31,6 +31,10 @@ func (err *apiError) IsEmpty() bool { return len(err.errs) == 0 } +func (err *apiError) SetClient(client *http.Client) { + err.endpoint.client = client +} + func (err *apiError) Append(url, apiKey string, e error) { err.errs = append(err.errs, e) err.endpoint.urls = append(err.endpoint.urls, url) @@ -124,6 +128,11 @@ func (a *APIEndpoint) Write(p model.AgentPayload) (int, error) { endpointErr := newAPIError() + // if this payload cannot be flushed due to API errors + // we need to pass the client along for future submissions + // FIXME(aaditya) + endpointErr.SetClient(a.client) + for i := range a.urls { atomic.AddInt64(&a.stats.TracesPayload, 1) diff --git a/agent/writer.go b/agent/writer.go index 4c6bc4531..0d9470a2f 100644 --- a/agent/writer.go +++ b/agent/writer.go @@ -70,6 +70,7 @@ func NewWriter(conf *config.AgentConfig) *Writer { if conf.Proxy != nil { // we have some kind of proxy configured. // make sure our http client uses it + log.Infof("configuring proxy through host %s", conf.Proxy.Host) endpoint.(*APIEndpoint).SetProxy(conf.Proxy) } } else {