A plug for logging response time in datadog. To use it, just plug it into the desired module:
# ...
plug Plug.RequestId
plug ExDatadog.Plug, prefix: "your-service", method: true, query: []
# ...:prefix- the prefix you want to put for this stat. Default isplug.:method- a boolean value to include the method in the tag list. Default isfalse.:query- a list of strings to include specific query string in the tag list.[]will generate all query params as tags. Default isnil(do not generate tag for query string)
ex_datadog_plug is available in hex, it can be installed
by adding ex_datadog_plug to your list of dependencies in mix.exs:
def deps do
[{:ex_datadog_plug, "~> 0.6.0"}]
endFull documentation can be found at https://hexdocs.pm/ex_datadog_plug.