-
Notifications
You must be signed in to change notification settings - Fork 93
regexps fixed for collectd 5.x #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
973904e
ba6915b
28d241f
519f57c
5a4b525
62e987a
345190c
d86bc49
5c781c1
170ebd4
378fda6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ def __init__(self, config): | |
|
|
||
| self.targets = [ | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.(?P<collectd_plugin>cpu)\.(?P<core>[^\.]+)\.cpu\.(?P<type>[^\.]+)$', | ||
| 'match': prefix + '(?P<server>[^\.]+)\.(?P<collectd_plugin>cpu)[\-\.](?P<core>[^\.]+)\.cpu[\-\.](?P<type>[^\.]+)$', | ||
| 'target_type': 'gauge_pct', | ||
| 'tags': { | ||
| 'unit': 'Jiff', | ||
|
|
@@ -23,28 +23,116 @@ def __init__(self, config): | |
| 'configure': lambda self, target: self.fix_load(target) | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.interface\.(?P<device>[^\.]+)\.if_(?P<wt>[^\.]+)\.(?P<dir>[^\.]+)$', | ||
| 'match': prefix + '(?P<server>[^\.]+)\.interface[\-\.](?P<device>[^\.]+)\.if_(?P<wt>[^\.]+)\.(?P<dir>[^\.]+)$', | ||
| 'target_type': 'counter', | ||
| 'tags': {'collectd_plugin': 'network'}, | ||
| 'configure': lambda self, target: self.fix_network(target) | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.memory\.memory\.(?P<type>[^\.]+)$', | ||
| 'match': prefix + '(?P<server>[^\.]+)\.memory\.memory[\-\.](?P<type>[^\.]+)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'B', | ||
| 'where': 'system_memory' | ||
| } | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.df\.(?P<mountpoint>[^\.]+)\.df_complex\.(?P<type>[^\.]+)$', | ||
| 'match': prefix + '(?P<server>[^\.]+)\.df[\-\.](?P<mountpoint>[^\.]+)\.df_complex[\-\.](?P<type>[^\.]+)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': {'unit': 'B'} | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.(?P<collectd_plugin>disk)\.(?P<device>[^\.]+)\.disk_(?P<wt>[^\.]+)\.(?P<operation>[^\.]+)$', | ||
| 'match': prefix + '(?P<server>[^\.]+)\.(?P<collectd_plugin>disk)[\-\.](?P<device>[^\.]+)\.disk_(?P<wt>[^\.]+)\.(?P<operation>[^\.]+)$', | ||
| 'configure': lambda self, target: self.fix_disk(target) | ||
| } | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>irq)\.irq[\-\.](?P<wt>.*)$', | ||
| 'target_type': 'counter', | ||
| 'tags': { | ||
| 'unit': 'calls', | ||
| 'what': 'irq_calls' | ||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>processes)\.ps_state[\-\.](?P<state>.*)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'procs', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be Process (see http://metrics20.org/spec/) |
||
| 'what': 'procs_in_state' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can be left out entirely (doesn't bring any new info that's not in unit tag or state tag) |
||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>processes)\.(?P<value>fork_rate)$', | ||
| 'target_type': 'counter', | ||
| 'tags': { | ||
| 'unit': 'procs', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Process |
||
| 'what': 'fork_rate' | ||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.swap\.swap[\-\.](?P<type>[^\.]+)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'B', | ||
| 'where': 'swap' | ||
| } | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>[^\.]+)\.swap\.swap_io[\-\.](?P<dir>[^\.]+)$', | ||
| 'target_type': 'counter', | ||
| 'tags': { | ||
| 'unit': 'B', | ||
| 'where': 'swap_io' | ||
| } | ||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>tcpconns)[\-\.](?P<port>\d+)[\-\.]local\.tcp_connections[\-\.](?P<state>.*)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'connections', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Conn (http://metrics20.org/spec/) |
||
| 'what': 'tcp_connections_in_state' | ||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>contextswitch)\.(?P<value>contextswitch)$', | ||
| 'target_type': 'counter', | ||
| 'tags': { | ||
| 'unit': 'fork/s', | ||
| 'what': 'contextswitch' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forks/s and contextswitches are different things? you can do context switches without doing any forks. |
||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>users)\.(?P<value>users)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'users', | ||
| 'what': 'users_logged' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can use unit=User for this (and add it to the spec) |
||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>entropy)\.(?P<value>entropy)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'bits', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unit=b |
||
| 'what': 'entropy' | ||
| } | ||
|
|
||
| }, | ||
| { | ||
| 'match': prefix + '(?P<server>.+?)\.(?P<collectd_plugin>conntrack)\.(?P<value>conntrack)$', | ||
| 'target_type': 'gauge', | ||
| 'tags': { | ||
| 'unit': 'entries', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this be unit=Conn, cause we track connections right? and this metric denotes how many connections are in the conntrack table? |
||
| 'what': 'conntrack' | ||
| } | ||
|
|
||
| }, | ||
| ] | ||
| super(CollectdPlugin, self).__init__(config) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should introduce a new unit for this, like Irq