MjmlEEx.Telemetry (MJML EEx v0.13.0)

View Source

Telemetry integration for event metrics, logging and error reporting.

Render events

MJML EEx emits the following telemetry events whenever a template is rendered:

  • [:mjml_eex, :render, :start] - When the rendering process has begun
  • [:mjml_eex, :render, :stop] - When the rendering process has successfully completed
  • [:mjml_eex, :render, :exception] - When the rendering process resulted in an error

The render events contain the following measurements and metadata:

eventmeasuresmetadata
:start:system_time:compiler, :mode, :assigns, :mjml_template, :mjml_template_file, :layout_module
:stop:duration:compiler, :mode, :assigns, :mjml_template, :mjml_template_file, :layout_module
:exception:duration:compiler, :mode, :assigns, :mjml_template, :mjml_template_file, :layout_module, :kind, :reason, :stacktrace

Summary

Functions

This function attaches a Telemetry debug handler to MJML EEx so that you can see what emails are being rendered, under what conditions, and what the resulting HTML looks like. This is primarily used for debugging purposes but can be modified for use in production if you need to.

Detach the debugging logger so that log messages are no longer produced.

Functions

attach_logger(opts \\ [])

This function attaches a Telemetry debug handler to MJML EEx so that you can see what emails are being rendered, under what conditions, and what the resulting HTML looks like. This is primarily used for debugging purposes but can be modified for use in production if you need to.

detach_logger()

Detach the debugging logger so that log messages are no longer produced.