Skip to content

fix(dogstatsd): accept pre-built client#83

Merged
duncanista merged 3 commits intomainfrom
jordan.gonzalez/dogstatsd/accept-pre-built-client
Mar 4, 2026
Merged

fix(dogstatsd): accept pre-built client#83
duncanista merged 3 commits intomainfrom
jordan.gonzalez/dogstatsd/accept-pre-built-client

Conversation

@duncanista
Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the client dependency in DogStatsD, allowing caller to provide a pre-built one.

Motivation

This crate shouldn't be concerned about client configuration, therefore its delegated to the caller.

Additional Notes

Allows agents to build the agent tailored to their needs.

Describe how to test/QA your changes

Unit tests.

@duncanista duncanista requested review from a team as code owners March 4, 2026 20:37
@duncanista duncanista requested review from duncanpharvey and shreyamalpani and removed request for a team March 4, 2026 20:37
@duncanista duncanista changed the base branch from main to jordan.gonzalez/dogstatsd/modularize-code March 4, 2026 20:38
@duncanista duncanista requested a review from Copilot March 4, 2026 20:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the dogstatsd crate’s metrics shipping so HTTP client configuration is delegated to the caller by accepting a pre-built reqwest::Client, rather than building/configuring one internally.

Changes:

  • Replace https_proxy / ca_cert_path / timeout configuration with a caller-supplied reqwest::Client throughout the DogStatsD flusher/shipping path.
  • Remove DogStatsD’s internal reqwest client construction (including custom cert loading) and adjust tests accordingly.
  • Update datadog-serverless-compat to build and pass a reqwest client (via datadog-fips adapter) and update dependencies/lockfile.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
crates/dogstatsd/tests/integration_test.rs Updates integration tests to pass a pre-built reqwest client into FlusherConfig/DdApi.
crates/dogstatsd/src/flusher.rs Updates FlusherConfig/Flusher to store and clone a provided reqwest::Client when constructing DdApi.
crates/dogstatsd/src/datadog/shipping.rs Changes DdApi to require a reqwest::Client (no longer optional) and removes internal client-building logic.
crates/dogstatsd/Cargo.toml Drops datadog-fips and rustls-pemfile deps; adjusts fips feature definition.
crates/datadog-serverless-compat/src/main.rs Builds a reqwest client using datadog-fips adapter and passes it into FlusherConfig.
crates/datadog-serverless-compat/Cargo.toml Adds dependencies required to build/provide the reqwest client.
Cargo.lock Updates lockfile for dependency graph changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread crates/dogstatsd/tests/integration_test.rs
Comment thread crates/dogstatsd/tests/integration_test.rs
Comment thread crates/dogstatsd/tests/integration_test.rs
Comment thread crates/dogstatsd/tests/integration_test.rs
Comment thread crates/dogstatsd/tests/integration_test.rs
Comment thread crates/dogstatsd/src/flusher.rs
Comment thread crates/dogstatsd/src/flusher.rs
Comment thread crates/dogstatsd/src/flusher.rs
Comment thread crates/datadog-serverless-compat/src/main.rs Outdated
Comment thread crates/dogstatsd/Cargo.toml Outdated
Base automatically changed from jordan.gonzalez/dogstatsd/modularize-code to main March 4, 2026 21:11
client building is not a concern of a dogstatsd server, therefore, we should provide a simple reqwest client which can be modified upstream
@duncanista duncanista force-pushed the jordan.gonzalez/dogstatsd/accept-pre-built-client branch from 30a3bfe to b36aeb4 Compare March 4, 2026 21:12
@duncanista duncanista merged commit 28f796b into main Mar 4, 2026
26 checks passed
@duncanista duncanista deleted the jordan.gonzalez/dogstatsd/accept-pre-built-client branch March 4, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants