fix(tracing): remove internal extra field from the trace config

This commit removes the internal extra field from the trace config
structure exposed to the user via the HTTP API.
This commit is contained in:
Kjell Winblad 2024-04-19 17:05:34 +02:00
parent 9e46c18443
commit 2890bc2619
2 changed files with 3 additions and 5 deletions

View File

@ -255,11 +255,10 @@ format(Traces) ->
fun(Trace0 = #?TRACE{}) ->
[_ | Values] = tuple_to_list(Trace0),
Map0 = maps:from_list(lists:zip(Fields, Values)),
Extra0 = maps:get(extra, Map0, #{}),
Formatter = maps:get(formatter, Extra0, text),
Extra = maps:get(extra, Map0, #{}),
Formatter = maps:get(formatter, Extra, text),
Map1 = Map0#{formatter => Formatter},
Extra1 = maps:remove(formatter, Extra0),
maps:put(extra, Extra1, Map1)
maps:remove(extra, Map1)
end,
Traces
).

View File

@ -96,7 +96,6 @@ t_base_create_delete(_Config) ->
start_at => Now,
end_at => Now + 30 * 60,
payload_encode => text,
extra => #{},
formatter => text
}
],