Importers of pkg/exporter may not want for series to be imported into
the default registry. This commit makes it possible to provide a custom
registry for metrics registration.
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
This commit fixes the case when the metric is not present in rm (registered metric) then LastRegisteredAt and TTL are initialized twice. Firstly, LastRegisteredAt is initialized with the time.Time's zero value and then with clock.Now(). Plus, TTL is initialized with the same value twice.
Signed-off-by: subham sarkar <subham.sarkar@guavus.com>
squash! Updated structs and tests.
Updated structs and tests.
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net>
Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <frank_davidson@manulife.com>
The Go client for prometheus aggregates summary metrics over 10
minutes by default, in 5 buckets. This is not always the behaviour we
want.
Allow tweaking those settings in `statsd_exporter`, so we can
aggregate summary metrics over more or less time, with more or fewer
buckets, and set the cap for the bucket as well.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Currently the Buckets and Quantiles settings are top level settings per metric
in the yaml. In a subsequent commit we're going to allow adding more such
options for summaries, at which point having them all at the top level gets
confusing.
Split the options out into separate hierarchies to allow adding more options,
without adding confusion. We preserve backwards compatibility by still
accepting the old option, but warning when it is present.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
The mapper package can be used outside the statsd exporter, so it is
better to use generic names here.
Signed-off-by: Matthias Rampke <mr@soundcloud.com>
- Statsd allows users to provide a metric with the same name but
differing types (counter, gauge, timer)
- The exporter allows this by letting users specify a
"match_metric_type" in the mapping config
- However the mapper cache does not look at the metric type so it would
return a MetricMapperCacheResult for the type of the first metric with
that name that the exporter saw
- Add MetricType to the signature for the cache and format the metric
name with the type to provide unique keys for a metric with the same
name but differing type
Signed-off-by: Andy Paine <andy.paine@digital.cabinet-office.gov.uk>