Skip to content

Commit

Permalink
Guard telemetry:execute/3 (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 1, 2022
1 parent ebe0f73 commit d3ba8b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/telemetry.erl
Expand Up @@ -150,7 +150,7 @@ execute(EventName, Value, Metadata) when is_number(Value) ->
?LOG_WARNING("Using execute/3 with a single event value is deprecated. "
"Use a measurement map instead.", []),
execute(EventName, #{value => Value}, Metadata);
execute(EventName, Measurements, Metadata) when is_map(Measurements) and is_map(Metadata) ->
execute([_ | _] = EventName, Measurements, Metadata) when is_map(Measurements) and is_map(Metadata) ->
Handlers = telemetry_handler_table:list_for_event(EventName),
ApplyFun =
fun(#handler{id=HandlerId,
Expand Down

0 comments on commit d3ba8b2

Please sign in to comment.