Skip to content

Commit

Permalink
Elixir refs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryannaegele committed Sep 30, 2024
1 parent bcd1dd8 commit 25d755e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apps/opentelemetry_api/lib/open_telemetry/span.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ defmodule OpenTelemetry.Span do
- A Status (`t:OpenTelemetry.status/0`)
"""

require OpenTelemetry.SemanticConventions.Trace

@type start_opts() :: :otel_span.start_opts()
@type start_config() :: :otel_span.start_config()

Expand Down Expand Up @@ -140,10 +138,9 @@ defmodule OpenTelemetry.Span do
exception_type = to_string(exception.__struct__)

exception_attributes = [
{OpenTelemetry.SemanticConventions.Trace.exception_type(), exception_type},
{OpenTelemetry.SemanticConventions.Trace.exception_message(), Exception.message(exception)},
{OpenTelemetry.SemanticConventions.Trace.exception_stacktrace(),
Exception.format_stacktrace(trace)}
{:"exception.type", exception_type},
{:"exception.message", Exception.message(exception)},
{:"exception.stacktrace", Exception.format_stacktrace(trace)}
]

add_event(span_ctx, :exception, exception_attributes ++ attributes)
Expand Down

0 comments on commit 25d755e

Please sign in to comment.