From 7405b832bcc24dff07a5e8d41f9cdad69a4e2071 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:41:21 +0100 Subject: [PATCH] fix(profiling): tag serialisation in HTTP exporter [backport 2.8] (#9042) Backport 0bacde040535ed5867471d406964f4979a6f5171 from #9032 to 2.8. Ensure that the HTTP exporter does not fail to serialise the tags. Addresses #8996. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Gabriele N. Tornetta --- ddtrace/profiling/exporter/http.py | 2 +- .../notes/fix-profiling-exporter-tags-f19c6cf93cbe1502.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-profiling-exporter-tags-f19c6cf93cbe1502.yaml diff --git a/ddtrace/profiling/exporter/http.py b/ddtrace/profiling/exporter/http.py index 7015082555a..c4809e044ac 100644 --- a/ddtrace/profiling/exporter/http.py +++ b/ddtrace/profiling/exporter/http.py @@ -152,7 +152,7 @@ def _get_tags( tags.update(self.tags) - return ",".join(tag + ":" + value for tag, value in tags.items()) + return ",".join(f"{tag}:{value}" for tag, value in tags.items()) def export( self, diff --git a/releasenotes/notes/fix-profiling-exporter-tags-f19c6cf93cbe1502.yaml b/releasenotes/notes/fix-profiling-exporter-tags-f19c6cf93cbe1502.yaml new file mode 100644 index 00000000000..858e09be12e --- /dev/null +++ b/releasenotes/notes/fix-profiling-exporter-tags-f19c6cf93cbe1502.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + profiling: fix a bug that caused the HTTP exporter to crash when attempting to serialize tags.