BeaconCMS/beacon

Extension: Emit telemetry events

開放

#143 建立於 2023年2月23日

 (1 則留言) (0 個反應) (0 位負責人)Elixir (120 個分叉)batch import
enhancementgood first issue

倉庫指標

星標
 (1,194 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Expose Telemetry events for important lifecycle actions by calling https://hexdocs.pm/telemetry/telemetry.html#span/3

[:beacon, :core, :load_resource, :start | :stop]

Emit start/stop events for each resource loaded by Beacon.Loader, adding the loaded resource in the event metadata. For eg loading a page would emit the following events:

[:beacon, :core, :load_resource, :start]
metadata: %{page: %Page{...}}

[:beacon, :core, :load_resource, :stop]
metadata: %{page: %Page{...}}

And it would be called here https://github.com/BeaconCMS/beacon/blob/cbe3bf7445cc559c96310593105e710366ed2cea/lib/beacon/loader.ex#L236

Here is the list of resources that must emit telemetry events https://github.com/BeaconCMS/beacon/blob/cbe3bf7445cc559c96310593105e710366ed2cea/lib/beacon/loader.ex#L127

[:beacon, :core, :render_page, :start | :stop]

The entire block of PageLive.render/1 must be tracked and emit a telemetry event so we can measure rendering times.

貢獻者指南