While it doesn't report it as a metric, when collecting, the registry
considers the base metric name to below to the histogram that's
registered. This means that we need to prevent other metrics from
registering anything under this name, in addition to checking for the
bucket, sum and count suffixes.
Signed-off-by: Clayton O'Neill <claytono@github.com>
This adds sanity checking before registering a metric to ensure that the
metric isn't already registered under an existing name. This prevents
the exporter from getting into a state where it has accepted and
registered conflicting metrics, and then cannot report the metrics it
has collected.
Signed-off-by: Clayton O'Neill <claytono@github.com>
This adds the ability to accept Datadog's distribution type and treat it
like a histogram/summary.
Signed-off-by: Clayton O'Neill <claytono@github.com>
This improves performance per call in the a-z case from around 5533
ns/op to 3169ns/op. It also drops allocations per call from 57 to 31
in the a-z case.
Signed-off-by: Clayton O'Neill <claytono@github.com>
- use MetricVec family instead of Metric
- dynamic label values instead of ConstLabels
- use dto.Metric to gain histrogram value in exporter_test
- remove hash calculations
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
It's idiomatic in go to keep code indentation due to nested loops to a
minimum. Decoupling the events handling function into its own function
makes it easier to read the code and test the behavior in isolation of
the channel handling. It's now also easily possible to process events
in parallel without having to touch actual business code.
Signed-off-by: Tobias Schmidt <tobidt@gmail.com>
* Quantile values for a Summary are now configurable.
* The default quantiles (DefObjectives) in the prometheus Go client library is
deprecated. This commit removes the reliance on it.
Signed-off-by: Harry Bagdi <harrybagdi@gmail.com>
The "packets" metric had heavily overloaded meaning for different
"outcomes", and would often be incremented multiple times, sometimes
even with a single (per-line) increment in one outcome corresponding to
multiple increments in another.
This removes the broken metric, and replaces it with separate total and
error counters for each level of processing. This allows monitoring the
network traffic handled separately from the samples incurred by it.
* Updated mappings to accept custom help text in YAML config
* Updated exporter to display configured help messages
* Update README to reflect aditional configurability
* Removed inaccurate comment
* Removed some cruft from a rebase
* Remove option flag
* Update NewExporter call signature to not take suffix boolean
* Update tests to reflect new behavior and signature
* Update documentation to reflect option flag removal