Commit graph

70 commits

Author SHA1 Message Date
glightfoot
ee3b81b864 use a quit channel and log exit messages
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2021-01-28 15:23:46 -05:00
glightfoot
6a9749cd42 don't return empty responses to lifecycle api requests
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2021-01-26 13:33:35 -05:00
alexanderritola
175e9a6728 Refactor startup order to not grab ports when checkConfig is true
Signed-off-by: alexanderritola <alexanderritola@users.noreply.github.com>
2021-01-20 11:37:58 -08:00
Robert Fratto
b5deeda251 Pass around custom registry for registering exporter metrics
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>
2020-11-20 14:14:14 -05:00
Matthias Rampke
cba4a0783a
Merge pull request #339 from yaron-idan/add-health-endpoint
add healthcheck endpoint
2020-10-15 07:01:42 +00:00
Yaron Idan
f5e400962a remove flag and add ready endpoint
Signed-off-by: Yaron Idan <yaronidan@gmail.com>
2020-10-13 14:15:04 +03:00
Daniel Sabsay
07c754c759 Minor documentation fixes
* Fix CLI help for --statsd.event-flush-interval
* Move verbiage regarding default histogram bucket values to proper
  section

Signed-off-by: Daniel Sabsay <sabsay@adobe.com>
2020-09-28 10:42:44 -07:00
Yaron Idan
f0c7abebb1 add healthcheck endpoint
Signed-off-by: Yaron Idan <yaronidan@gmail.com>
2020-09-12 17:24:50 +03:00
Matthias Rampke
a73707d102
Merge pull request #329 from glightfoot/reload-api
Add lifecycle api
2020-08-21 12:02:18 +02:00
glightfoot
c162b349b7 add parsing flags to README
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2020-08-10 14:55:57 -04:00
glightfoot
1293a24b59 add lifecycle api
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2020-08-10 14:46:44 -04:00
glightfoot
afa40f4ada rename cli flags for parsing and add docs to README
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2020-08-10 12:56:23 -04:00
glightfoot
6942b5a4f3 move to line parser struct and option functions
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2020-08-10 12:44:23 -04:00
glightfoot
3f3ab23359 add globals for disabling individual tag parsing formats
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2020-07-28 13:29:06 -04:00
Matthias Rampke
c8b8ddc952
Support checking configuration and exiting
If desired, go through all the motions of setting up the exporter, but
then exit. This is not very elegant, as we actually open the ports,
which may not be what you want to do in a pipeline, but it is the
quickest way to implement this.

Fixes #263.

Signed-off-by: Matthias Rampke <matthias@prometheus.io>
2020-05-29 08:51:41 +00:00
Chai Nadig
a75e588cf0 Log Ingested Lines
Signed-off-by: Chai Nadig <chaitanya.nadig@gmail.com>
2020-05-13 23:58:24 -07:00
Frank Davidson
c75b6091b8 Added metrics to unixgram listener.
Signed-off-by: Frank Davidson <frank_davidson@manulife.com>
2020-04-16 12:43:27 -04:00
Frank Davidson
5ec58a32c2 squash! Updated structs and tests.
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>
2020-04-09 11:44:13 -04:00
Frank Davidson
a455a8ad64 hopefully now linux
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net>
Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
2020-04-08 15:29:54 -04:00
Frank Davidson
d55b42eabb :Issue 234: Split into reusable packages.
Signed-off-by: Frank Davidson <frank_davidson@manulife.com>
Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
2020-04-08 15:29:49 -04:00
bakins
90e247b091 Add random replacement cache
Signed-off-by: bakins <brian@akins.org>
2020-03-04 12:26:59 -05:00
Matthias Rampke
fa2159f8e8
Pass logger to UDP listener
We were already passing it to the TCP and Unixgram listener, but
somehow left it out of the UDP listener setup.

Fixes #285.

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2020-01-13 09:55:07 +00:00
Matthias Rampke
53f732d480
Log error and exit instead of panicking
Following the lead of prometheus/prometheus, we prefer to log-and-exit
instead of an unstructured panic.

cf. https://github.com/prometheus/prometheus/pull/3061/files#diff-4a3ccbb3ebdcd530af96f0105fe833c2R182

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2020-01-10 14:02:59 +00:00
mhartenbower
c710b851c7 Switch to go-kit logging
Fixes #270

Signed-off-by: mhartenbower <matt.hartenbower@gmail.com>
2019-10-13 13:19:28 -05:00
Gert van den Berg
b555158e53 Add event handler for Unixgram
Signed-off-by: Gert van den Berg <gert.vandenberg@iotnxt.com>
2019-07-23 16:00:00 +02:00
Matthias Rampke
23ef5daeac
Reload on SIGHUP instead of watching the file
This is more portable (works on any system that has UNIX signals) and
removes the dependency on fsnotify, which doesn't compile on AIX. It
also reduces the probability of failed reloads due to partial writes.

Fixes #241.

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2019-07-05 13:30:31 +00:00
Selman Kayrancioglu
bb88165d52 add missing eventHandler to StatsDTCPListener
Signed-off-by: Selman Kayrancioglu <selman@peak.com>
2019-06-14 15:42:21 +03:00
Chanan Damboritz
8f7676eaa9 Use promhttp instead of http
Signed-off-by: Chanan Damboritz <chanan@hiredscore.com>
Signed-off-by: Chanan Damboritz <cdambo@gmail.com>
2019-06-11 13:54:20 +03:00
Clayton O'Neill
c7e76967c8
Add internal event queuing and flushing
At high traffic levels, the locking around sending on channels can cause
a large amount of blocking and CPU usage.  These adds an event queue
mechanism so that events are queued for short period of time, and
flushed in batches to the main exporter goroutine periodically.

The default is is to flush every 1000 events, or every 200ms, whichever
happens first.

Signed-off-by: Clayton O'Neill <claytono@github.com>
2019-06-04 06:57:48 -04:00
SpencerMalone
35d1a99592 Adding mapping cache
Signed-off-by: SpencerMalone <malone.spencer@gmail.com>
2019-04-26 18:00:39 -04:00
Matthias Rampke
9963806a62
Merge pull request #205 from claytono/add-pprof
Add pprof for profiling
2019-04-23 09:01:09 +00:00
Wangchong Zhou
47b5ef9be0
Buffer signals channel
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2019-04-22 16:35:28 -07: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
Clayton O'Neill
024f9dc0aa
Add pprof for profiling
Signed-off-by: Clayton O'Neill <clayton@oneill.net>
2019-04-22 08:07:43 -04:00
Matthias Rampke
9ed6d59151
Correct to use name socket mode instead of mask
Co-Authored-By: fffonion <fffonion@gmail.com>
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2019-04-09 11:20:11 -07: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
Simon Pasquier
8f56cc811d *: add staticcheck target back
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-01-04 15:26:57 +01:00
Wangchong Zhou
5262b2904c
tidy up and use go benchmark
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2018-09-28 12:58:25 -07:00
Wangchong Zhou
5e1df60d22
abstract dumpFsm
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2018-09-21 18:11:00 -07:00
Wangchong Zhou
e634997791
move fsm to sepeare pkg
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2018-09-21 18:10:51 -07:00
Wangchong Zhou
bfe23298aa
replace glob matching
Signed-off-by: Wangchong Zhou <fffonion@gmail.com>
2018-09-11 17:34:19 -07:00
Nic Cope
fcc398a032 Switch to kingpin for flag handling
This commit also removs the deprecated -statsd.listen-address flag. Switching
to kingpin is a breaking change in that flags now start with two hyphens (e.g.
--statsd.listen-udp), and thus a good time to remove deprecated flags.

Signed-off-by: Nic Cope <negz@planet.com>
2018-08-20 13:18:59 -07:00
Matthias Rampke
d9f305b6f2
Inject the mappings count metric into the library package
so that it can be initialized with an exporter-specific name.

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2018-08-14 09:31:38 +00: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
Simon Pasquier
27f07a6516 Use Makefile.common from Prometheus
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-05-23 12:49:57 +02:00
Brian Brazil
fbbd6452c6
Update a few Bridges we missed to Exporter 2018-01-30 20:01:29 +00: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
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
nordicdyno
6ac8203d40 http listener: log and fail on ListenAndServe error 2017-02-10 15:35:38 +03:00