Commit graph

90 commits

Author SHA1 Message Date
kullanici0606
04ed8c69a9
fix typo
Co-authored-by: Matthias Rampke <matthias.rampke@googlemail.com>
Signed-off-by: kullanici0606 <35795498+kullanici0606@users.noreply.github.com>
2023-10-23 10:08:22 +03:00
kullanici0606
c246633aec add counter for dropped UDP packets. Remove unnecessary and misleading comment
Signed-off-by: kullanici0606 <yakup.turgut@btk.gov.tr>
2023-10-23 10:01:52 +03:00
kullanici0606
03255bf218 process udp packets in a separate goroutine so that udp packets are not dropped
Signed-off-by: kullanici0606 <yakup.turgut@btk.gov.tr>
2023-09-20 10:37:53 +03:00
SuperQ
7f5125abdd
Use exporter-toolkit landing page
Use the exporter-toolkit to render the exporter homepage.
* Also allow metricsEndpoint to be on `/`.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-02 08:43:57 +02:00
Matthias Rampke
9a980af22f
Update Go module dependencies
and switch to github.com/alecthomas/kingpin/v2 matching the changes in
prometheus/common

Signed-off-by: Matthias Rampke <matthias@prometheus.io>
2023-03-08 18:13:33 +00:00
don-philipe
00d82daaf2
Print version, help etc to stdout
The default behavior of kingpin lib is to print stuff to stderr. This is now changed by using the os.Stdout writer. Now information like version and help text will be printed to stdout.

Signed-off-by: don-philipe <don_philipe@gmx.de>
2022-09-21 23:05:42 +02:00
akartasov
b60989291b
feat: enable more linters and fix warnings (#364)
Signed-off-by: akartasov <agneum@gmail.com>
2021-10-24 21:27:31 +07:00
SuperQ
ae26c506f5
Add metrics to relay
Add some metrics to the statsd relay.
* The number of StatsD packets relayed.
* The number lines that were too long to relay.

Also convert main.go to use promauto for metric registration.

Signed-off-by: SuperQ <superq@gmail.com>
2021-09-02 11:57:39 +02:00
SuperQ
0b84893d4a
Add statsd relay
Add a simple statsd packet output relay that buffers and forwards raw
statsd lines.
* Only supports UDP output.
* Has a hard-coded buffering timeout of 1 second.

Closes: https://github.com/prometheus/statsd_exporter/issues/95

Signed-off-by: SuperQ <superq@gmail.com>
2021-09-01 15:14:01 +02:00
davinlu
6329577a6b refactor: replace level pkg
Signed-off-by: davinlu <davinlu@tencent.com>
2021-09-01 18:55:45 +08:00
Matthias Rampke
c4f435e140
Revert "replace level pkg" 2021-08-31 12:39:34 +02:00
Matthias Rampke
e395798230
Merge pull request #386 from royeo/feature/pprof
use http.DefaultServeMux to support pprof
2021-08-31 12:05:55 +02:00
royeo
c3a818ef62 replace level pkg
Signed-off-by: royeo <ljn6176@gmail.com>
2021-08-17 23:27:27 +08:00
davinlu
f4fe58dcf2 use http.DefaultServeMux to support pprof
Signed-off-by: davinlu <davinlu@tencent.com>
2021-08-16 22:24:08 +08:00
Mark Sagi-Kazar
278a862099
refactor: use go-kit logger instead of deprecated common log package
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2021-06-07 16:00:08 +02:00
John Howard
c5113b732c Update dependencies and drop large go-kit update
Pulling in the same changes as done in
https://github.com/prometheus/common/issues/255

Signed-off-by: John Howard <howardjohn@google.com>
2021-06-03 08:00:27 -07:00
glightfoot
8b306c8c76 remove noop cache, add helper function for tests
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2021-02-19 14:08:53 -05:00
glightfoot
aa529c8884 rename mapper_cache to mappercache
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2021-02-06 23:27:11 -05:00
glightfoot
940e653ea6 cleanup
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2021-02-06 23:21:49 -05:00
glightfoot
0099df7f71 move lru and rr mapper caches to their own package and make mapper_cache a better an interface for implementing externally`
Signed-off-by: glightfoot <glightfoot@rsglab.com>
2021-02-06 22:50:17 -05:00
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