Skip to content

Commit

Permalink
Merge branch 'main' into brettlangdon/allchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon committed May 29, 2024
2 parents 97ab6c6 + 9e637e7 commit a61d680
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions ddtrace/internal/writer/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ def recreate(self):
dogstatsd=self.dogstatsd,
sync_mode=self._sync_mode,
api_version=self._api_version,
headers=self._headers,
)

@property
Expand Down
10 changes: 10 additions & 0 deletions tests/tracer/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,16 @@ def test_writer_recreate_api_version(init_api_version, api_version, endpoint, en
assert isinstance(writer._encoder, encoder_cls)


def test_writer_recreate_keeps_headers():
writer = AgentWriter("http://dne:1234", headers={"Datadog-Client-Computed-Stats": "yes"})
assert "Datadog-Client-Computed-Stats" in writer._headers
assert writer._headers["Datadog-Client-Computed-Stats"] == "yes"

writer = writer.recreate()
assert "Datadog-Client-Computed-Stats" in writer._headers
assert writer._headers["Datadog-Client-Computed-Stats"] == "yes"


@pytest.mark.parametrize(
"sys_platform, api_version, ddtrace_api_version, priority_sampling, raises_error, expected",
[
Expand Down

0 comments on commit a61d680

Please sign in to comment.