Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

This plug acts as a wrapper around Plug.Telemetry to filter out certain events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages