This commit passes the negotiated locale via the i18n/*locale* variable
through the Accept-Language header by default in a clj-http-client
request (only in the Clojure client, not the Java client).
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.