Handle empty stack (#205)

* Update otel_telemetry.erl

* Add debug log (#204)
This commit is contained in:
Bryan Naegele 2023-09-12 19:28:53 -06:00 committed by GitHub
parent 6a143eeccf
commit 596fcbc2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -100,7 +100,11 @@ peek_from_tracer_stack(TracerId) ->
undefined ->
undefined;
[SpanCtxSet | _Rest] ->
SpanCtxSet
SpanCtxSet;
[] ->
?LOG_DEBUG("`opentelemetry_telemetry` span ctx tracer stack for "
"TracerId ~p in Pid ~p is empty.", [TracerId, self()]),
undefined
end.
-spec pop_ctx(atom(), telemetry:event_metadata()) -> ctx_set().