Commit graph

70 commits

Author SHA1 Message Date
Matthias Rampke
e3d6050616
Merge pull request #199 from Kong/feat/unixgram-socket
Implement listener for Unixgram sockets
2019-04-23 08:44:11 +00:00
Wangchong Zhou
383ee9bd3b
Add a signal handler to allow clean up of unixgram socket file
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2019-04-22 16:33:22 -07:00
Brian Akins
45402964a4 use label for metric type and decrement
Signed-off-by: Brian Akins <brian@akins.org>
2019-04-15 08:16:00 -04:00
Brian Akins
92957ce080 Add metric to track unique metric names the exporter is tracking
Signed-off-by: Brian Akins <brian@akins.org>
2019-04-10 12:23:07 -04:00
Matthias Rampke
ece9385f22
Merge pull request #197 from bakins/escapeMetricName-performance
Increase escapeMetricName performance
2019-04-10 08:47:49 +00:00
Brian Akins
cfcf3c9ba5 Add comments explaining escapeMetricName
Signed-off-by: Brian Akins <brian@akins.org>
2019-04-09 14:10:26 -04:00
Brian Akins
e6bdf13407 Add comments explaining escapeMetricName
Signed-off-by: Brian Akins <brian@akins.org>
2019-04-09 11:58:18 -04:00
Brian Akins
d371436f01 Replace regex in escapeMetricName with loop over runes
Signed-off-by: Brian Akins <brian@akins.org>
2019-04-09 11:58:18 -04:00
Matthias Rampke
178d130388
Merge pull request #193 from bakins/statsd_exporter_events_total
Add metric for count of events by action
2019-04-09 12:13:17 +00:00
Wangchong Zhou
05bca84294
Implement listener for Unixgram sockets
As requested in #189

Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2019-04-05 16:45:34 -07:00
Brian Akins
1cbc5a9b27 Add metric for count of events by action
Signed-off-by: Brian Akins <brian@akins.org>
2019-04-02 15:20:50 -04:00
Vitaliy Sakhartchouk
2fc89536f4 Break out mapkey generation into function
Signed-off-by: Vitaliy Sakhartchouk <vsakhart@github.com>
2019-03-29 13:25:46 -07:00
Vitaliy Sakhartchouk
2025b47cb1 Allow support for inconsistent label sets by marking metrics
registered as unchecked collectors

Signed-off-by: Vitaliy Sakhartchouk <vsakhart@github.com>
2019-03-29 13:18:31 -07:00
Ivan Izaguirre
c9e5e94ed2 Adds a separate counter for events discarded due to errors
Signed-off-by: Ivan Izaguirre <ivanizag@gmail.com>
2019-03-26 00:44:17 +01:00
Ivan Izaguirre
1c71191aaf Fixes #191: crash on empty metric name
Signed-off-by: Ivan Izaguirre <ivanizag@gmail.com>
2019-03-23 19:38:27 +01:00
SpencerMalone
c73a7b2c9a Scale summaries from milliseconds to seconds.
Fixes #177

Updating exporter tests for new summary unit scaling behavior

Signed-off-by: Spencer Malone <malone.spencer@gmail.com>
2019-01-09 12:37:38 -05:00
Simon Pasquier
8f56cc811d *: add staticcheck target back
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-01-04 15:26:57 +01:00
Ivan Mikheykin
699c11ca11 Rework tests to not depend on actual wall clocks
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-19 08:24:25 +03:00
Ivan Mikheykin
331d2a56d0 Language fixes in README, reduce map lookups in saveLabelValues.
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-19 08:24:17 +03:00
Ivan Mikheykin
e550f061f6 Use updated ttl value from mapping in saveLabelValues
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-18 09:46:10 +03:00
Ivan Mikheykin
d1b2dd47a8 TTL expiration tests, README update
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-18 09:46:05 +03:00
Ivan Mikheykin
57495db281 rename labelsNames to labelNames
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-18 08:39:23 +03:00
Ivan Mikheykin
e1a3a5fc32 Configured ttl value for stale metrics
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-18 08:39:23 +03:00
Ivan Mikheykin
b4e29c5f18 Remove stale timeseries
- ttl is hardcoded — should be in mapping.yaml
- works with metrics without labels

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
2018-12-18 08:39:23 +03:00
Ivan Mikheykin
b638b9d808 Replace Metrics with Collectors
- 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>
2018-12-18 08:39:23 +03:00
Tobias Schmidt
ab844a3f63
Break out event handling into its own function
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>
2018-11-02 18:28:18 +01:00
Matthias Rampke
40a13e604f
Move mapper -> pkg/mapper
to make clear that this is meant to be used elsewhere

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2018-08-14 09:20:00 +00:00
Matthias Rampke
124c5b88d0
Move mapper to a package
This allows the mapping logic and configuration format to be re-used by
the graphite exporter.

Enables prometheus/graphite_exporter#37, cf. https://github.com/prometheus/graphite_exporter/pull/52#issuecomment-412324849

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2018-08-12 11:14:18 +00:00
Harry Bagdi
a144b1f9f7 feat: configurable quantiles for Summaries
* 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>
2018-08-08 19:41:41 -07:00
Simon Westphahl
b6c7e863d3 Allow mappings to match on metric types
Co-authored-by: Simon Westphahl <westphahl@gmail.com>
Signed-off-by: Simon Westphahl <simon.westphahl@bmw.de>
2018-06-15 11:36:12 +02:00
Erick Pintor
27ee4050c4 allow for dynamic metric name 2018-01-16 18:45:55 -02:00
Brian Akins
6738c909a5 Add drop action for matches 2018-01-02 17:21:50 -05:00
Matthias Rampke
d9db83b9be
Merge pull request #106 from prometheus/mr/rework-sample-counters
Break out the telemetry during sample processing
2017-11-15 09:42:46 +01:00
Brian Akins
e58bf8e1ca Set name in mapping, rather than from special label with key 'name' 2017-11-13 07:23:14 -05:00
Matthias Rampke
cdf79ba2f9 Break out the telemetry during sample processing
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.
2017-11-10 19:23:54 +00:00
Dave Rawks
ab2a88c06f Allow help text to be customized (#87)
* 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
2017-10-04 18:11:58 +02:00
Dave Rawks
0478c40ab0 Removes -statsd.add-suffix option flag
* 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
2017-09-28 11:30:17 -07:00
Tobias Schmidt
7e11f326ae Merge pull request #92 from drawks/log_levels
Resolves #81 - Reduce log levels
2017-08-26 12:25:26 +02:00
Dave Rawks
e493a9c766 Fixup per PR review:
* Added internal metric to track `illegal_negative_counter` events
2017-08-15 09:03:13 -07:00
Dave Rawks
42e41f1a7e Resolves #81 - Reduce log levels
* Reduced all `log.Error*` events to `log.Debug*` in `exporter.go` where
  an existing internal metric tracks the event.
2017-08-14 16:04:57 -07:00
Dave Rawks
e37bee9bf2 Resolves #88 - histograms use wrong units 2017-08-14 11:23:14 -07:00
Julius Volz
aeab2905ad Merge pull request #66 from bakins/extended-config
Allow histograms for timer metrics
2017-08-03 17:25:30 +02:00
jwfang
07543ac557 Add TCP StatsD listener support (#71)
* add TCP StatsD listener support

* add listen-tcp flag to control UDP/TCP mode on same port

* statsdListenUDP/statsdListenTCP as string, and alias listen-address to listen-udp

* add stats for tcp error/line_too_long

* add test for TCP listener
2017-08-01 12:21:00 +02:00
Brian Akins
2643f1550f cleanup debug statements 2017-07-26 18:40:56 -04:00
Brian Akins
b467a537d5 Validate timer type while reading config 2017-07-26 14:50:29 -04:00
Brian Akins
74975b8411 merge with upstream master 2017-07-26 14:03:08 -04:00
Thomas Jackson
bbd5227a1c Add metric for total number of conflicting events 2017-07-18 08:58:40 -07:00
Thomas Jackson
c1791d7ecb Ensure we log errors every time there is a problem
Move addition of metric to "Elements" until after a successful registry
with prometheus, otherwise we'll continue to increment a metric which
isn't registered
2017-07-18 08:58:40 -07:00
Thomas Jackson
d9aa6e2867 Don't crash on conflicting metric names
This patch simply moves the error message from a log.Fatalf() to a
log.Errorf() to continue on.

Fixes #63
2017-07-18 08:58:40 -07:00
Thomas Jackson
22520f4c7b Move value check before metric get
If someone is emitting negative counters we shouldn't even register the
metric for them
2017-07-18 08:58:40 -07:00