Add note to clojure client docs about precendence of `metric-prefix` option if
both it and `server-id` are specified as client options.
Also remove some empty lines.
Add two new client options - `server-id` and `metric-prefix` that allow the
metric namespace to be configured rather than always
`puppetlabs.http-client.experimental`.
If `server-id` is set, the metric namespace becomes
`puppetlabs.<server-id>.http-client.experimental`.
If `metric-prefix` is set, the metric namespace becomes
`<metric-prefix>.http-client.experimental`.
If both are set, `metric-prefix` wins out and a warning message is logged.
Also add a `get-client-metric-namespace`/`getMetricNamespace` method on the
client (clojure and java) to get back the metric namespace.
There was a bug in the previous version of the Apache HttpAsyncClient library
that caused the cline tto hang if the process had exhausted the number of open
file descriptors it was allowed. This bug was fixed in the 4.1.2 release,
which this commit bumps to.
The Clojure metrics API supports metric-ids as vectors of keywords or strings.
Previously, the docs only mentioned that keywords could be used. Strings
should be used if special characters are needed.
(MAINT) remove comments
(MAINT) change body message to reflect 400 status
(MAINT) change test to use Java and Clj API
(MAINT) refactor RequestOptions in let block of java api test
(MAINT) add tests for async cookie support
When constructing url timers for request metrics, we strip off any username,
password, query params, and path fragments on the request uri. This commit
provides a public method to do this conversion of a url, so that users can
take the url they used for their request and easily figure out the url we used
for the metric.
Previously, if any of the `get-client-metrics*` methods (in Clojure or Java)
had a nil metric registry passed into them, they would return nil. This commit
updates the behavior of all of these methods to instead return an error - a
schema error (clojure.lang.ExceptionInfo) for the clojure functions, and an
IllegalArgumentException for the java methods.
Previously, all the get-client-metrics* functions had two arities - one with a
metric type and one without. This commit removes the arity with a metric type
from all these functions since currently we only have one metric type and
since we aren't entirely certain of what we want the API to be when we add
additional metric types. When we add more metric types, we will change the API
in a backward compatible way.
Rather than having e.g a nil url and method in the metric data when metric-id
is filtered on, or a nil metric id if url and method are filtered on, use
specific schemas for metrics data returned for each metric category - metric
id, url, and url and method.
* Don't pass args into `isMatch()` in `ClientMetricFilter`, since this method
isn't static and so has access to the member variables.
Relevant gif: https://aphyr.com/data/posts/317/state.gif.
* Remove unused `metricTypeString` method
Rename the Metric Types from `bytes-read`/`init-repsonse` to
`full-response`/`initial-response` (note that the `initial-response` timer has
not yet been implemented, but when it is this will be its name).