Skip to content
This plug acts as a wrapper around Plug.Telemetry to filter out certain events
Elixir
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.formatter.exs
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
mix.exs
mix.lock

README.md

TelemetryFilter

Hex.pm Build Status

The purpose of this library is to filter out routes that should not trigger Plug Telemetry events. The Plug Telemetry events are used by Phoenix Logger (https://hexdocs.pm/phoenix/Phoenix.Logger.html) to display response times for route invocations. This may be useful when you are using something like Kubernetes or Prometheus and do not want your logs polluted with calls to "/health" and "/metrics" every 5 seconds (or how ever long the interval is set).

Installation

The package can be installed by adding telemetry_filter to your list of dependencies in mix.exs:

def deps do
  [
    {:telemetry_filter, "~> 0.1.0"}
  ]
end

Once your mix.exs file has been updated, you can replace the following call in endpoint.ex:

Plug.Telemetry, event_prefix: [:phoenix, :endpoint]

with:

plug TelemetryFilter, filter_endpoints: ["/metrics", "/health"], event_prefix: [:phoenix, :endpoint]

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/telemetry_filter.

You can’t perform that action at this time.