Crometheus::Middleware::HttpCollector
Inherits HTTP::Handler / Reference / Object
This class is an HTTP::Handler that records basic statistics
about every request that comes in, and passes through to the next
handler without modifying the request or response.
It creates the http_requests_total,
http_request_duration_seconds, and
http_request_exceptions_total metrics.
See the custom-server example for a use case.
Constants
Substitutes ":id" in place of numeric path components, e.g.
turning "/forum/102/thread/12" into "/forum/:id/thread/:id".
Constructors
Initializes the HttpCollector, allowing the user to set the
registry to which metrics will be added and the path cleaner.
Defaults to Crometheus.default_registry and
DEFAULT_PATH_CLEANER.
Set path_cleaner to nil to avoid mangling paths altogether.
Instance methods
Transforms request paths before labeling metrics, so that multiple paths may be tracked in the same time series.
Transforms request paths before labeling metrics, so that multiple paths may be tracked in the same time series.