Elixirschool: Instrumenting Phoenix with Telemetry

Created on 24 Mar 2020  路  3Comments  路  Source: elixirschool/elixirschool

I'm working on a side project exploring Elixir's Telemetry offerings and hoping to wrap up the code portion in the next week or so. I think there are a number of opportunities for content on observability in Elixir with Telemetry. I'd love to produce either a series of blog posts or lessons that along the lines of:

  • Intro to observability - what is it/why do we need it
  • OOTB instrumentation with Elixir Telemetry in Phoenix - Ecto and Phoenix emit a set of pre-defined Telemetry events from source code that you can opt-in to listening to. This section will cover the following Telemetry events and include a look at setting up your Telemetry module to opt-in to them as well as a long at the Phoenix and/or Ecto source code that emits the event "for free".

    • Request counts and durations

    • Ecto query counts and durations

    • Channel and socket metrics

    • VM monitoring

  • Custom instrumentation with Telemetry

    • Custom Telemetry events

    • Custom Telemetry polling

  • Telemetry reporting options - StatsD, Prometheus, DogStatsD
  • Telemetry under the hood - a deeper dive into Telemetry source code to understand how Telemetry library "listens" for emitted events and handles them with the appropriate handler (its not a GenServer! Its ETS!)

I'm leaning towards building these as a set of lessons that walks a user through adding instrumentation to an existing dummy Phoenix app that we supply.

What do others think? Would this maybe make more sense as a blog post? I'm leaning toward lesson b/c I've been on something of an observability crusade lately and am trying to make this kind of work more of a "first class citizen" when it comes to the development lifecycle. One of the very cool things about Elixir and Phoenix right now is that it treats observability like a first class citizen thanks to the Telemetry library and its robust "Out Of The Box" event reporting.

discussion

Most helpful comment

I'm almost done with a draft of an article that covers:

  • Intro to Telemetry
  • Telemetry under the hood

Will open for review this weekend, likely as a blog post for now and we can move to a series of lessons later if we think that would be a good fit/addition.

All 3 comments

I'm almost done with a draft of an article that covers:

  • Intro to Telemetry
  • Telemetry under the hood

Will open for review this weekend, likely as a blog post for now and we can move to a series of lessons later if we think that would be a good fit/addition.

@SophieDeBenedetto can we close this now?

yep!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sotojuan picture sotojuan  路  4Comments

pjhampton picture pjhampton  路  5Comments

ybur-yug picture ybur-yug  路  4Comments

malloryerik picture malloryerik  路  4Comments

doomspork picture doomspork  路  4Comments