model.proto
means that it accepts the opentelemetry http_protobuf format. I'm guessing it does.
When instrumenting a project your application should only depend on the OpenTelemetry API application, found in directory apps/opentelemetry_api of this repo which is published as the hex package opentelemetry_api.
This is confusing - since to instrumnet my project, isn’t it supposed to use SDK, not API? e.g. SDK actually holds the implementation, and sdk depends on api, not vice versa
with_span
to the code
Aha probably the confusion is whether “application” is of the end-user project (e.g. project to run a web service), or my library package (e.g. HTTP library “application”). Is there any good terminology in Erlang?
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/library-guidelines.md uses “final application” vs “third party libraries/frameworks” btw.
For traces to actually be tracked, propagated and exported, the opentelemetry Application must be included as a dependency of your project, likely as part of a Release and not as a dependency of an individual Application within the Release.
What’s the reason? I guess it is to start and supervise opentelemetry
application (SDK) at the top level, not a child of a specific application. Is it correct?
main
do I cause the same issue ?
Hey there :)
Playing around with Elixir I can't figure out how to set the parent span for a new span declared in an anonymous function in a Task.async
.
I tried something like this:
OpenTelemetry.Tracer.with_span "span_1" do
span_ctx = OpenTelemetry.Tracer.current_span_ctx()
task =
Task.async(fn ->
OpenTelemetry.Tracer.with_span "span_2", %{parent: span_ctx} do
nil
end
end)
...
end
But the parent option does not seem to do anything.
Can you please help me on what I am probably doing wrong here?
SpanCtx = ?start_span(<<"child">>),
Ctx = otel_ctx:get_current(),
proc_lib:start_link(fun() ->
otel_ctx:attach(Ctx),
?set_current_span(SpanCtx)
%% do work here
end),
SpanCtx = ?current_span_ctx,
proc_lib:spawn_link(fun() ->
Link = opentelemetry:link(SpanCtx),
?with_span(<<"other-process">>, #{links => [Link]},
fun() -> ok end)
end),