BeaconCMS / BeaconCMS/beacon

Extension: Emit telemetry events

Open
#143 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Elixir
Stars
1.3k
Forks
134
PR merge metrics
No merged PRs in 30d

Description

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`](https://github.com/BeaconCMS/beacon/blob/main/lib/beacon/loader.ex), adding the loaded resource in the event metadata. For eg loading a page would emit the following events:

```elixir
[: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`](https://github.com/BeaconCMS/beacon/blob/cbe3bf7445cc559c96310593105e710366ed2cea/lib/beacon_web/live/page_live.ex#L26) must be tracked and emit a telemetry event so we can measure rendering times.

Contributor guide

Open the contributing guide

Research direction

Start by reading lib/beacon/loader.ex around lines 127 and 236, then inspect lib/beacon_web/live/page_live.ex around line 26. The work is done when each listed resource load emits the specified start/stop events with the loaded resource metadata, and the full PageLive.render/1 block emits render timing events.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.