Skip to content

Commit

Permalink
Don't duplicate the metric options.
Browse files Browse the repository at this point in the history
Signed-off-by: Karolis Petrauskas <[email protected]>
  • Loading branch information
kape1395 committed Aug 22, 2024
1 parent f65ec52 commit a4ea0e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/exometer_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ handle_call({ensure, Name, Type, Opts}, _From, S) ->
[] ->
#exometer_entry{options = OptsTemplate} = E0 =
lookup_definition(Name, Type, Opts),
E1 = process_opts(E0, OptsTemplate ++ Opts),
E1 = process_opts(E0, OptsTemplate),
Res = exometer:create_entry(E1),
report_new_entry(E1),
{reply, Res, S}
Expand Down
13 changes: 11 additions & 2 deletions test/exometer_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
test_app_predef/1,
test_function_match/1,
test_status/1,
test_slide_ignore_outdated/1
test_slide_ignore_outdated/1,
test_info_options/1
]).

%% utility exports
Expand Down Expand Up @@ -113,7 +114,8 @@ groups() ->
]},
{test_info, [shuffle],
[
test_status
test_status,
test_info_options
]}
].

Expand Down Expand Up @@ -502,6 +504,13 @@ test_slide_ignore_outdated(_Config) ->

ok.


% Check if options are not duplicated.
test_info_options(_Config) ->
ok = exometer:new([?FUNCTION_NAME], gauge, [{custom_opt, works}]),
[{custom_opt,works}] = exometer:info([?FUNCTION_NAME], options).


%%%===================================================================
%%% Internal functions
%%%===================================================================
Expand Down

0 comments on commit a4ea0e2

Please sign in to comment.