Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datadogexporter: read response body on pushSketches #36779

Merged

Conversation

spudlymurf
Copy link
Contributor

Description

The pushSketches function in the datadogexporter does not read the contents of the HTTP response's Body on return.

The Go documentation states that the full response body from the http request should be read and closed to ensure that connections can be properly re-used: https://pkg.go.dev/net/http#Client.Do

We saw this manifest as a high load of incoming metric traffic through the exporter creating a connection per request and essentially killing platform infrastructure (proxy, DNS) as a result.

Testing

No additional testing added. Fix is running to great effect in private internal fork at extremely high scale.

@spudlymurf spudlymurf requested review from mx-psi, songy23 and a team as code owners December 11, 2024 04:56
Copy link

linux-foundation-easycla bot commented Dec 11, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, please sign the CLA and add a changelog

@spudlymurf spudlymurf requested a review from songy23 December 16, 2024 01:24
@songy23
Copy link
Member

songy23 commented Dec 16, 2024

Error: datadogexporter/metrics_exporter.go:160:5: ineffectual assignment to err (ineffassign)
_, err = io.Copy(io.Discard, resp.Body)

https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/12306370401/job/34364745079?pr=36779

please fix

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mx-psi mx-psi merged commit 9aadead into open-telemetry:main Dec 16, 2024
160 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 16, 2024
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this pull request Dec 17, 2024
…6779)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

The pushSketches function in the datadogexporter does not read the
contents of the HTTP response's Body on return.

The Go documentation states that the full response body from the http
request should be read and closed to ensure that connections can be
properly re-used: https://pkg.go.dev/net/http#Client.Do

We saw this manifest as a high load of incoming metric traffic through
the exporter creating a connection per request and essentially killing
platform infrastructure (proxy, DNS) as a result.


<!--Describe what testing was performed and which tests were added.-->
#### Testing

No additional testing added. Fix is running to great effect in private
internal fork at extremely high scale.
mterhar pushed a commit to mterhar/opentelemetry-collector-contrib that referenced this pull request Dec 19, 2024
…6779)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

The pushSketches function in the datadogexporter does not read the
contents of the HTTP response's Body on return.

The Go documentation states that the full response body from the http
request should be read and closed to ensure that connections can be
properly re-used: https://pkg.go.dev/net/http#Client.Do

We saw this manifest as a high load of incoming metric traffic through
the exporter creating a connection per request and essentially killing
platform infrastructure (proxy, DNS) as a result.


<!--Describe what testing was performed and which tests were added.-->
#### Testing

No additional testing added. Fix is running to great effect in private
internal fork at extremely high scale.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/datadog Datadog components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants