Add the `metric_id` option to the http requests in the facts terminus,
resource terminus, query function, and for command submission. These
`metric_id`s will be used by the http client Puppet Server uses to create
metrics in its registry, which can then be queried to determine how long
requests Puppet Server makes to PuppetDB are taking.
For each element in a `metric_id` array, a metric is created. So, a `metric_id`
`[:foo :bar :baz]` will result in metrics `foo`, `foo.bar`, and `foo.bar.baz`.
The elements in the array can be symbols or strings. For more information, see
the [documentation on metrics in the clj-http-client
For the facts `find` action, the `metric_id` is `[:puppetdb :facts :find
For the facts `search` action, the `metric_id` is `[:puppetdb :facts
:search]`. The query is not included as part of the `metric_id` because it
would not create useful metrics to capture - each search query can be pretty
much anything, and tracking a single search query over time probably won't be
For the resource `search` action, the `metric_id` is `[:puppetdb :resource
:search <resource type>]`.
For the http call made by the puppetdb query function, the `metric_id` is
`[:puppetdb :query]`. This metric-id does not include the actual query, since
there are so many possible queries that tracking metrics on them does not seem
For the http requests for submitting commands, `metric_id`s will be
`[:puppetdb :command <command name> <certname>]`.