erldns
erldns copied to clipboard
Start opentelemetry_api otp application
This is needed even in environments where opentelemetry itself isn't enabled, as it provides the interface for erldns to define its traces. Without this, erldns_worker would crash when processing queries, as the opentelemetry module doesn't exist:
{'module could not be loaded',
[{opentelemetry,get_tracer,[erldns_worker],[]},
{erldns_worker,handle_cast,2,
[{file,".../erldns/src/erldns_worker.erl"},
{line,69}]},
Note: I didn't notice this issue when starting my application using rebar3 shell; it was only when I deployed using a release (rebar3 release) this started to occur, so I assume it has to do with how the modules included in the release are collected. Without this change, relx wouldn't know to include the opentelemetry
module (provided by the opentelemetry_api
application), whereas rebar3 shell seems to have another another mechanism to find modules.
(The test failure is addressed by #141.)
After reviewing the documentation and running some tests locally, I can confirm that the opentelemetry_api
should be included as a direct dependency.
@olof if you can merge main
into this branch we can approve and merge this PR.
Thanks for your contribution.
@olof if you can merge
main
into this branch we can approve and merge this PR.
Updated (rebased, hope that's ok).
New test failures; doesn't look directly related to my change from what can tell.
@olof the tests fail because now we have an actual reference to perform a type check and the currently used map()
type for SpanCtx
is invalid. The correct typing needs to be used in this case: ' otel_tracer:tracer_ctx()`. The type error only occurs in three places, would you be open to updating the type checks to get the specs to pass?
Ah, got it! It was my fault after all :). Didn't realize the connection. I've just updated the pull request branch with your suggestion applied. Thanks!