Skip to content

Commit

Permalink
fix: convert tags boolean values different from other atoms (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
DReigada authored Aug 26, 2023
1 parent 811629d commit ba1c67a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/spandex_datadog/api_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion test/api_server_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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} =
Expand Down Expand Up @@ -176,6 +176,7 @@ defmodule SpandexDatadog.ApiServerTest do
"buz" => "blitz",
"env" => "local",
"foo" => "123",
"is_foo" => "true",
"version" => "v1",
"zyx" => "[xyz: {1, 2}]"
},
Expand Down Expand Up @@ -267,6 +268,7 @@ defmodule SpandexDatadog.ApiServerTest do
"buz" => "blitz",
"env" => "local",
"foo" => "123",
"is_foo" => "true",
"version" => "v1",
"zyx" => "[xyz: {1, 2}]"
},
Expand Down

0 comments on commit ba1c67a

Please sign in to comment.