Commit graph

58 commits

Author SHA1 Message Date
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
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
Andreas Andersen
b5dfc9c9ce Added support for sampling factor on timing events 2017-05-15 15:57:31 +02:00
Brian Akins
1488f0f902 Allow overriding default timing type 2017-03-13 06:32:58 -04:00
Brian Akins
3048412df6 Add YAML config file and ability to set histograms 2017-03-12 21:11:05 -04:00
Justin Reid
9cd4b974e4 consensed if/else statement 2017-03-09 17:39:20 -07:00
Justin Reid
3efcef6229 Simplified inc/dec logic based on PR feedback.
There is no need to add the string to all event types as only Gauge
is compatible with inc/dec functionality.  Removed valueStr from all
events and added a simple boolean to the Gauge event instead
2017-03-09 17:35:29 -07:00
Justin Reid
7fc8727306 Added increment/decrement support to Gauges
Now passing the value as a string (with operation prefix) through to build event so that Listen() can modify the gauge metric appropriately
2017-03-09 15:50:06 -07:00
Ilya Margolin
1fbc392800 Remove unintended changes 2016-07-21 17:55:47 +02:00
Ilya Margolin
bb4e42068f Skip metrics with invalid utf8 2016-07-20 20:27:23 +02:00
David Haguenauer
56f65c4870 Don't panic on empty metric names or components
* Don't panic on empty metric names
* Don't panic on empty metric components
* Test tolerance the above kinds of broken StatsD lines
2016-05-19 12:43:35 -04:00
Johannes 'fish' Ziemke
03fde8f3ba Use common/version and common/log packages 2016-05-04 23:12:18 +02:00
Johannes 'fish' Ziemke
8e43fc2654 Merge pull request #37 from prometheus/fish/remove-auto-suffixes
Make metric suffixes optional, expose unmapped events
2016-05-03 09:46:59 -07:00
Tobias Schmidt
ba9c37eb20 Merge pull request #40 from Jimdo/dogstats-extensions-squashed
Dogstats extensions squashed
2016-05-03 12:42:38 -04:00