Embedded resources generate "Failed to lookup telemetry handlers." warning during compilation

I noticed that from some time I’m getting some [warning] Failed to lookup telemetry handlers. Ensure the telemetry application has been started. warnings when i compile my project.

Looking into it, I found that these warnings are generated when compiling my embedded resources, here is the stacktrace:

    {telemetry_handler_table, list_for_event, 1,[{file,"/var/home/sezdocs/projects/rebuilt/platform/marketplace/deps/telemetry/src/telemetry_handler_table.erl"},{line,53}]},

As you can see, it reaches the Ash.Actions.Create.run/4 function which calls:

Ash.Tracer.telemetry_span [:ash, Ash.Api.Info.short_name(api), :create],
                                  metadata do

Is there some way to remove/disable that call so I don’t get more these warnings?

Oh, how interesting. I’ve been trying to find this issue for ages :laughing: I’ve seen it in another project and couldn’t track it down. how did you get that stacktrace?? I can’t check on that other project at this exact moment, but I pushed something up to ash main that I believe should address the issue. Please try it out and let me know.

Thank you for for helping me figure this one out :bowing_man:

Using the dumbest method possible haha, basically I used grep to search for that warning message in my project deps directory.

grep -r "Failed to lookup telemetry handlers" *

From that, I found that the warning was generated from the file deps/telemetry/src/telemetry_handler_table.erl in the function list_for_event/1.

Then i changed that function to print the stacktrace:

-spec list_for_event(telemetry:event_name()) -> [#handler{}].
list_for_event(EventName) ->
        ets:lookup(?MODULE, EventName)
        error:badarg ->
            erlang:display(erlang:process_info(self(), current_stacktrace)),
            ?LOG_WARNING("Failed to lookup telemetry handlers. "
                         "Ensure the telemetry application has been started. ", []),

Finally i recompiled the telemetry dep with mix deps.compile telemetry and recompiled my project mix compile --force

Far from dumb, that is genius :slight_smile: We’ll done!

1 Like