fix(dogstatsd): accept pre-built client#83
Merged
duncanista merged 3 commits intomainfrom Mar 4, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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/timeoutconfiguration with a caller-suppliedreqwest::Clientthroughout the DogStatsD flusher/shipping path. - Remove DogStatsD’s internal reqwest client construction (including custom cert loading) and adjust tests accordingly.
- Update
datadog-serverless-compatto build and pass a reqwest client (viadatadog-fipsadapter) 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.
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
30a3bfe to
b36aeb4
Compare
lym953
approved these changes
Mar 4, 2026
duncanpharvey
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.