Skip to content

Instantly share code, notes, and snippets.

@yatender-oktalk
Created October 14, 2020 07:34
Show Gist options
  • Save yatender-oktalk/48044085561bcf589918a4219b10bd00 to your computer and use it in GitHub Desktop.
Save yatender-oktalk/48044085561bcf589918a4219b10bd00 to your computer and use it in GitHub Desktop.
change-3-zipkin_random
...
def second_event(delay) do
OpenTelemetry.Tracer.start_span("second_event_span")
# again mimicing the same stuff
Process.sleep(delay)
# use set_attributes api to add the attributes during the span
OpenTelemetry.Span.set_attributes([{"delay_data", delay}])
OpenTelemetry.Tracer.end_span()
"world slept for #{delay}ms"
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment