I’m trying to understand more about the telemetry events emitted from a poorly performing query.
I’m looking at the AppSignal dashboard which records the events and puts them into a timeline.
The query has many preloads, but they don’t seem to show up in the timeline:
- Why is only one of the preloads showing up in each of the screenshots above?
- Is that dead-time between the first query and the last preload just time spend doing the preloads? Is that expected? if not is this likely a telemetry events issue or an appsignal issue?
The offending code:
# in data_plugs @decorate transaction_event() def add_project_offers_to_conn(conn, _ops) do project = conn.assigns.project offers = Production.list_offers([project_id: project.id], [:custom_fields]) conn |> assign(:proj_offers, offers) end def list_offers(filters, preloads \\ ) when is_list(filters) and is_list(preloads) do preloads = preloads ++ [ :engagement, :original_offer, :replacement_offer, :job_title, :department, :contract_type, :document, altered_documents: :document, envelope_events: EnvelopeEventAPI.preload_query() ] query = from(o in Offer, preload: ^preloads) |> Queries.apply_filters(filters) Repo.all(query) end