From ba1c67a93da63ad54805164bd1a1cb0744514fcc Mon Sep 17 00:00:00 2001 From: Daniel Reigada <11428771+DReigada@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:05:01 +0100 Subject: [PATCH] fix: convert tags boolean values different from other atoms (#61) --- lib/spandex_datadog/api_server.ex | 1 + test/api_server_test.exs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/spandex_datadog/api_server.ex b/lib/spandex_datadog/api_server.ex index 8e6504b..7d51c33 100644 --- a/lib/spandex_datadog/api_server.ex +++ b/lib/spandex_datadog/api_server.ex @@ -432,6 +432,7 @@ defmodule SpandexDatadog.ApiServer do defp deep_remove_nils(term), do: term + defp term_to_string(term) when is_boolean(term), do: inspect(term) defp term_to_string(term) when is_binary(term), do: term defp term_to_string(term) when is_atom(term), do: term defp term_to_string(term), do: inspect(term) diff --git a/test/api_server_test.exs b/test/api_server_test.exs index a8dea0a..459bea3 100644 --- a/test/api_server_test.exs +++ b/test/api_server_test.exs @@ -51,7 +51,7 @@ defmodule SpandexDatadog.ApiServerTest do name: "foo", trace_id: trace_id, completion_time: 1_527_752_052_216_578_000, - tags: [foo: "123", bar: 321, buz: :blitz, baz: {1, 2}, zyx: [xyz: {1, 2}]] + tags: [is_foo: true, foo: "123", bar: 321, buz: :blitz, baz: {1, 2}, zyx: [xyz: {1, 2}]] ) {:ok, span_2} = @@ -176,6 +176,7 @@ defmodule SpandexDatadog.ApiServerTest do "buz" => "blitz", "env" => "local", "foo" => "123", + "is_foo" => "true", "version" => "v1", "zyx" => "[xyz: {1, 2}]" }, @@ -267,6 +268,7 @@ defmodule SpandexDatadog.ApiServerTest do "buz" => "blitz", "env" => "local", "foo" => "123", + "is_foo" => "true", "version" => "v1", "zyx" => "[xyz: {1, 2}]" },