Skip to content

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

License

Notifications You must be signed in to change notification settings

akoutmos/telemetry_filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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