new_relic v0.1.2 NewRelic.Plug.Instrumentation

Utility methods for instrumenting parts of an Elixir app.

Link to this section Summary

Functions

Instruments a database call and records the elapsed time.

Link to this section Functions

Link to this function

instrument_db(action, queryable, opts, f)

instrument_db(atom(), Ecto.Queryable.t(), Keyword.t(), (... -> any())) ::
  any()

Instruments a database call and records the elapsed time.

  • conn should be a Plug.Conn that has been configured by NewRelic.Plug.Phoenix.
  • action is the name of the repository method being instrumented.
  • queryable is the Queryable being passed to the repository.

By default, the query name will be infered from queryable and action. This can be overriden by providing a :query option in opts.