(TK-402) Update docs to mention configurable metric namespace
This commit is contained in:
parent
4f92c1ba55
commit
5237287c2b
2 changed files with 25 additions and 3 deletions
|
@ -38,6 +38,11 @@ The following are the base set of options supported by the `create-client` funct
|
||||||
to. If provided, metrics will automatically be registered for all requests
|
to. If provided, metrics will automatically be registered for all requests
|
||||||
made by the client. See the [metrics documentation](./metrics.md) for more
|
made by the client. See the [metrics documentation](./metrics.md) for more
|
||||||
info.
|
info.
|
||||||
|
* `:server-id`: a string for the name of the server the request is being made
|
||||||
|
from. If specified, used in the namespace for metrics:
|
||||||
|
`puppetlabs.<server-id>.http-client.experimental`.
|
||||||
|
* `:metric-prefix`: a string for the prefix for metrics. If specified, metric
|
||||||
|
namespace is `<metric-prefix>.http-client.experimental`.
|
||||||
|
|
||||||
### SSL Options
|
### SSL Options
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ change.
|
||||||
For using metrics with either the Java client or the Clojure client you must
|
For using metrics with either the Java client or the Clojure client you must
|
||||||
already have created a Dropwizard `MetricRegistry`.
|
already have created a Dropwizard `MetricRegistry`.
|
||||||
|
|
||||||
- [Metrics prefix](#metrics-prefix)
|
- [Metric namespace](#metric-namespace)
|
||||||
- [Types of metrics](#types-of-metrics)
|
- [Types of metrics](#types-of-metrics)
|
||||||
- [Getting back metrics](#getting-back-metrics)
|
- [Getting back metrics](#getting-back-metrics)
|
||||||
- [Clojure API](#clojure-api)
|
- [Clojure API](#clojure-api)
|
||||||
|
@ -29,9 +29,26 @@ already have created a Dropwizard `MetricRegistry`.
|
||||||
- [Filtering by metric-id](#filtering-by-metric-id-1)
|
- [Filtering by metric-id](#filtering-by-metric-id-1)
|
||||||
|
|
||||||
|
|
||||||
## Metrics prefix
|
## Metric namespace
|
||||||
|
|
||||||
All http metrics are prefixed with `puppetlabs.http-client.experimental`.
|
By default, http metrics are prefixed with the namespace
|
||||||
|
`puppetlabs.http-client.experimental`. This namespace can be customized with two
|
||||||
|
client options, `server-id` and `metric-prefix`.
|
||||||
|
|
||||||
|
When `server-id` is set, the metric namespace becomes
|
||||||
|
`puppetlabs.<server-id>.http-client.experimental`.
|
||||||
|
|
||||||
|
When `metric-prefix` is set, the metric namespace becomes
|
||||||
|
`<metric-prefix>.http-client.experimental`.
|
||||||
|
|
||||||
|
If both `server-id` and `metric-prefix` are set, `metric-prefix` wins out and
|
||||||
|
a warning message is logged.
|
||||||
|
|
||||||
|
For a Clojure client, the `get-client-metric-namespace` protocol method can
|
||||||
|
be used to get back the metric namespace set for the client.
|
||||||
|
|
||||||
|
For a Java client, the `getMetricNamespace` method can be used to get back the
|
||||||
|
configured metric namespace.
|
||||||
|
|
||||||
## Types of metrics
|
## Types of metrics
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue