Telemetry events for rendering documents.
Typsty emits these events whenever a document is rendered, with :telemetry.span/3:
[:typsty, :render, :start]- rendering has begun[:typsty, :render, :stop]- rendering has finished, successfully or with an error[:typsty, :render, :exception]- rendering raised, for example because of an invalid option or assign. (Assigns that aren't a map, and templates that aren't a string or aTypsty.Template, raise before rendering begins, without any event.)
| event | measurements | metadata |
|---|---|---|
:start | :system_time, :monotonic_time | :module, :format, :template |
:stop | :duration, :monotonic_time | :module, :format, :template, :result, :reason, :diagnostics |
:exception | :duration, :monotonic_time | :module, :format, :template, :kind, :reason, :stacktrace |
:duration- how long rendering took, in native time units (convert it withSystem.convert_time_unit/3). It covers rendering the template, not a document module'srender/1, which runs first.:module- the document module, ornilfor a template rendered withTypsty.to_pdf/3and the like.:format-:pdf,:pngor:svg.:template- theTypsty.Templatethat was rendered, with its assigns.:result-:ok, or:errorwhen the document couldn't be rendered.:reason- for:stopevents with an:errorresult, why: the:reasonof theTypsty.RenderError. For:exceptionevents, the exception.:diagnostics- the warnings when the document rendered, or the errors when it didn't, asTypsty.Diagnosticstructs.
Every event's metadata also has :telemetry_span_context, which ties the events of a
render together.