Skip to content

Commit

Permalink
add another tracer macro test
Browse files Browse the repository at this point in the history
  • Loading branch information
btkostner committed Dec 5, 2024
1 parent 1a4fff2 commit 3e34ac3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/otel_tests.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ defmodule OtelTests do
assert {"attr-2", "value-2"} in :otel_attributes.map(span_attributes)
end

test "use Tracer includes code attributes" do
Tracer.with_span "span-1" do
:ok
end

assert_receive {:span, span(name: "span-1", attributes: span_attributes)}
assert {:"code.function", "test use Tracer includes code attributes/1"} in :otel_attributes.map(span_attributes)
assert {:"code.lineno", 71} in :otel_attributes.map(span_attributes)
end

test "use Span to set attributes" do
s = Tracer.start_span("span-2")
Span.set_attribute(s, "attr-1", "value-1")
Expand Down

0 comments on commit 3e34ac3

Please sign in to comment.