27 Commits

Author SHA1 Message Date
Rich Megginson
8b92ea1bd9 mmkubernetes - support for metadata cache expiration
New parameters for mmkubernetes (module and action):

* `cacheexpireinterval`
If `cacheexpireinterval` is -1, then do not check for cache expiration.
If `cacheexpireinterval` is 0, then check for cache expiration.
If `cacheexpireinterval` is greater than 0, check for cache expiration
if the last time we checked was more than this many seconds ago.

* `cacheentryttl` - maximum age in seconds for cache entries

New statistics counters:

* `podcachenumentries` - the number of entries in the pod metadata cache.
* `namespacecachenumentries` - the number of entries in the namespace
  metadata cache.
* `podcachehits` - the number of times a requested entry was found in the
  pod metadata cache.
* `namespacecachehits` - the number of times a requested entry was found
  in the namespace metadata cache.
* `podcachemisses` - the number of times a requested entry was not found
  in the pod metadata cache, and had to be requested from Kubernetes.
* `namespacecachemisses` - the number of times a requested entry was not
  found in the namespace metadata cache, and had to be requested from
  Kubernetes.
2019-04-01 11:53:29 -06:00
Rainer Gerhards
223c03e536
cleanup: remove commented-out code
thanks to lgtm.com for the ability to detect commented out code!
2018-10-27 19:04:30 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
170bf66556 refactor stats system: do use cstr only if needed
There are probably more areas that could be changed, but this is
a good self-sufficient change.

see also https://github.com/rsyslog/rsyslog/issues/1044
2016-05-19 11:28:00 +02:00
Janmejay Singh
a30bf638cc Trying to switch a stats-dependent test from timing based coordination to semaphore-based coordination. 2016-04-18 21:35:07 +05:30
Janmejay Singh
5f071af97f Fixed dyn-stats unused-metric-ttl bug which was was expected to garbage-collect accumulators that were unused for time-period >= ttl, but used to wipe all accumulators. This worked from memory-footprint and metric-life point-of-view, but used to reset accumulators even when they were configured to not be reset. Now it maintains survivor(shadow) table which keeps the accumulator value around from ttl up-to (2 * ttl) and reclaims it only if no dyn_inc call resurrects it by the end of this period. This allows us to resurrect surviving counters if they are used within ttl duration. This keeps a counter alive up-to (2 * ttl) in the worst case(late eviction) and ttl(timely eviction) in the best case. 2016-04-14 21:03:35 +05:30
Janmejay Singh
5d47513cf0 this makes dyn-stats resettable property independent of impstats resetCounters (which means when dyn-stats bucket is resettable, it will reset regardless of impstats being configured to resetCounters or not) 2016-03-31 16:16:03 +05:30
Janmejay Singh
90019a681a dyn-stats values are now reported (in json, json-es and cee formats) under a key "values" 2016-03-31 00:16:17 +05:30
Rainer Gerhards
c0736fe344 emit warning if sender has not been seen for a period of time
controllable via
   global(senders.reportGoneAway="on" senders.timeoutAfter="10")

see also https://github.com/rsyslog/rsyslog/issues/751
2016-02-01 15:07:32 +01:00
Rainer Gerhards
861059467b implement sender-specific statistics
see also https://github.com/rsyslog/rsyslog/issues/751

Note: this is only the impstats part of the feature request,
and only done for imptcp.
2016-02-01 12:42:51 +01:00
Rainer Gerhards
3549041b0f Merge branch 'dyn_stats' of https://github.com/janmejay/rsyslog into master-integrate-dynstats
Conflicts:
	.travis.yml
	grammar/rainerscript.c
	plugins/imdiag/imdiag.c
2016-01-28 09:51:25 +01:00
Rainer Gerhards
0f5595c074 impstats: support broken ElasticSearch JSON implementation
ES 2.0 no longer supports valid JSON and disallows dots inside names.
This adds a new "json-elasticsearch" format option which replaces
those dots by the bang ("!") character. So "discarded.full" becomes
"discarded!full".

This is a workaroud. A method that will provide more control over
replacemetns will be implemented some time in the future. For
details, see below-quoted issue tracker.

closes https://github.com/rsyslog/rsyslog/issues/713
2015-12-23 09:16:03 +01:00
Janmejay Singh
d94abbf49f created a control to bump stats counter for batch-operations in one shot + some asthetic space->tab conversion 2015-11-17 16:16:24 +05:30
Janmejay Singh
33cb11db57 dynstats reset-of-accumulated-dyn-metric-names and more-metrics-than-expected flows fixed and tested 2015-11-16 16:43:51 +05:30
Janmejay Singh
59b46975bd dyn-stats (dynamic metric-name support) high-level impl sketch 2015-11-09 22:31:01 +05:30
Rainer Gerhards
423c3ac62c pstats: add "origin" paramter to stats records
see also: https://github.com/rsyslog/rsyslog/issues/119
2014-11-19 15:49:09 +01:00
Rainer Gerhards
6d668c915f cosmetic: fix some gcc --pedantic messages 2014-07-13 12:43:07 +02:00
Rainer Gerhards
490b083326 impstats: implement parameter "resetCounters"
it provides the capability to make impstats emit deltas in contrast to
accumulated counter values (see doc for details).
2013-09-09 15:41:07 +02:00
Rainer Gerhards
fbc737d650 experimental: make impstats return delta values where possible 2013-09-07 15:58:09 +02:00
David Kelly
cbff73d94c added new-style zeromq plugins, based on czmq api and rsyslog v6 conf 2012-05-29 13:05:59 +02:00
Rainer Gerhards
5351538b0a impstats: added $PStatsJSON directive 2012-04-01 18:58:58 +02:00
Rainer Gerhards
e6aaf19689 changed statsobj interface and added better doc 2012-03-14 12:50:21 +01:00
Rainer Gerhards
f8769ca19d bugfix: fixed build problems on some platforms
namely those that have 32bit atomic operations but not 64 bit ones
2010-12-01 18:13:40 +01:00
Rainer Gerhards
2288bbb90f fixed compile problems on Solaris 2010-09-16 15:58:03 +02:00
Rainer Gerhards
e86cb62f12 improved statistics-gathering subsystem
... well, actually this is a first real implementation of this subsystem.
I have added a counter registry, a way to access the countres (as readable
string) and a way to define and maintem them. Also, module impstats has
been updated to utilize the new system. Finally, I added some counters. I
hope that this sets the baseline for useful future enhancements.
2010-09-13 15:43:56 +02:00