Skip to content

Commit

Permalink
Merge pull request #145 from tsloughter/fix-add-event
Browse files Browse the repository at this point in the history
fix add_event macro to call otel_span:add_event/3
  • Loading branch information
tsloughter committed Nov 15, 2020
2 parents 1d5a5a0 + e9576bc commit b5e6b65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/opentelemetry_api/include/otel_tracer.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
-define(set_attributes(Attributes),
otel_span:set_attributes(?current_span_ctx, Attributes)).

-define(add_event(Event),
otel_span:add_event(?current_span_ctx, Event)).
-define(add_event(Name, Attributes),
otel_span:add_event(?current_span_ctx, Name, Attributes)).

-define(add_events(Events),
otel_span:add_events(?current_span_ctx, Events)).
Expand Down
1 change: 1 addition & 0 deletions apps/opentelemetry_api/test/opentelemetry_api_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ update_span_data(_Config) ->
?set_current_span(SpanCtx1),

?set_attribute(<<"key-1">>, <<"value-1">>),
?add_event(<<"event-1">>, [{<<"attr-1">>, <<"value-1">>}]),

Events = opentelemetry:events([{opentelemetry:timestamp(),
<<"timed-event-name">>, []}]),
Expand Down

0 comments on commit b5e6b65

Please sign in to comment.