Plug that can be used to add Server-Timing header metrics to responses



ServerTimingPlug Build Status

The purpose of this library is to provide an easy way to capture basic timing metrics from your application and surface them via the Server-Timing header ( The design of this lib is very much inspired from, but makes some slightly different design decisions. Whereas plug_telemetry_server_timing attaches :telemetry handlers to events and automatically aggregates the results of timings, this library allows you to time arbitrary events and does not infer timing label names based on telemetry events. There are other Server-Timing libraries on hex as well; Which one you choose depends on your specific needs :).


If available in Hex, the package can be installed by adding server_timing_plug to your list of dependencies in mix.exs:

def deps do
    {:server_timing_plug, "~> 0.1.0"}

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at