Created
September 16, 2025 19:45
-
-
Save vhf/0bb7b62dd6f9d0c369602eabadd89800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule SAppsignal.Span do | |
defstruct [ | |
:kind, | |
:reason, | |
:stack, | |
:name, | |
:extra | |
] | |
def set_name(span, name) do | |
%{span | name: name} | |
end | |
def set_attribute(span, key, val) do | |
%{span | extra: Map.put(span.extra, key, val)} | |
end | |
def set_sample_data_if_nil(span, key, val) do | |
%{span | extra: Map.put_new(span.extra, key, val)} | |
end | |
end | |
defmodule SAppsignal do | |
def send_error(kind, reason, stack, fun) do | |
fun.(%SAppsignal.Span{ | |
kind: kind, | |
reason: reason, | |
stack: stack, | |
extra: %{} | |
}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment