This commit introduces advanced configuration. The rate-interval and
label-prefix flags are removed, and replaced by a configuration file
that allows you to specify series queries and the rules for transforming
those into metrics queries and API resources.
For vector and range queries, the Prometheus HTTP API takes a timeout
parameter. Previously, we ignored this parameter. Now, we check to see
if the context passed to the query contains a deadline, and if so,
compare that to the current time to calculate an appropriate timeout for
query evaulation.
This commit instruments prometheus query times by prometheus endpoint,
allowing us to see how quickly prometheus answers the queries that
back the custom-metrics API endpoints.
The initial functionality works. There's still a number of TODOs to
clean up, and some edge cases to work around, and some errors that could
be handled better.