Closed iamemilio closed 9 months ago
Attention: 12 lines
in your changes are missing coverage. Please review.
Comparison is base (
7b07e07
) 80.03% compared to head (4f77a5a
) 79.70%. Report is 3 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
v3/newrelic/internal_app.go | 11.11% | 8 Missing :warning: |
v3/newrelic/collector.go | 92.30% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
We are also seeing the error logged here:
if nil != resp.Err {
app.Warn("application connect failure", map[string]interface{}{
"error": resp.Err.Error(),
})
}
I skimmed through the PRs and I think this part may not be covered yet.
Hope you don't mind me chiming in.
I think the issue originates from this line:
resp, err := cs.Client.Do(req)
if err != nil {
return rpmResponse{
forceSaveHarvestData: true,
Err: err,
}
}
http.Client.Do always returns *url.Error
s:
Any returned error will be of type *url.Error
And url.Error.Error()
always prints the URL in it's string representation.
func (e *Error) Error() string { return fmt.Sprintf("%s %q: %s", e.Op, e.URL, e.Err) }
I think the part we want to obfuscate is the URL.
We could obfuscate by checking if the error is of type *url.Error
. And maybe clear out the URL, or cast the error type to a defined type that has a different implementation of Error() string
, or whatever else you think is best.
Hope you don't mind me chiming in.
I think the issue originates from this line:
resp, err := cs.Client.Do(req) if err != nil { return rpmResponse{ forceSaveHarvestData: true, Err: err, } }
http.Client.Do always returns
*url.Error
s:Any returned error will be of type *url.Error
And
url.Error.Error()
always prints the URL in it's string representation.func (e *Error) Error() string { return fmt.Sprintf("%s %q: %s", e.Op, e.URL, e.Err) }
I think the part we want to obfuscate is the URL.
We could obfuscate by checking if the error is of type
*url.Error
. And maybe clear out the URL, or cast the error type to a defined type that has a different implementation ofError() string
, or whatever else you think is best.
that's a very good idea, let me take a look. I am also going to check if we are printing URLs for other ingestion related errors, because this issue is probably not a one off.
Yes, feel free to squash this.
Links
Details