Skip to content

Commit

Permalink
Merge pull request #464 from cbowman0/issue461
Browse files Browse the repository at this point in the history
Support stop in aggregate section without send to.
  • Loading branch information
grobian authored Sep 28, 2024
2 parents 943145c + a268dc6 commit 74be92d
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* [PR #463](https://github.com/grobian/carbon-c-relay/pull/463)
support rewrite form \g{n} to allow for integers to follow expansion
* [PR #464](https://github.com/grobian/carbon-c-relay/pull/464)
support stop in aggregate section without send to

### Bugfixes

Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ CRTESTS = \
issue357 \
issue369 \
issue448 \
issue461 \
issue462 \
server-type \
basic \
Expand Down
2 changes: 1 addition & 1 deletion conffile.l
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ match {
return crTO;
}
<idcl>blackhole return crBLACKHOLE;
<ma,idcl>stop return crSTOP;
<ma,idcl,ag>stop return crSTOP;

rewrite {
identstate = re;
Expand Down
24 changes: 24 additions & 0 deletions issues/issue461.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cluster default
fnv1a_ch replication 1
127.0.0.1:2103 proto tcp
;

# metric name reported by collectd: collectd.$hostname.cpu.$core-id.percent.$type
# aggregate target metric name: collectd.$hostname.aggregated.cpu.total_cores
aggregate
^collectd\.(.+)\.cpu\.([0-9]+)\.percent\.idle
^collectd\.(ABC-.+)\.cpu\.([0-9]+)\.percent\.idle
^collectd\.ABC-(.+)\.cpu\.([0-9]+)\.percent\.idle
^collectd\.([^.]+)\.cpu\.([0-9]+)\.percent\.idle
every 10 seconds
expire after 15 seconds
compute count write to
collectd.\1.aggregated.cpu.total_cores
stop
;

match *
send to
default
stop
;
42 changes: 42 additions & 0 deletions test/issue461.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
listen
type linemode
2003 proto tcp
2003 proto udp
/tmp/.s.carbon-c-relay.2003 proto unix
;

statistics
submit every 60 seconds
prefix with carbon.relays.test_hostname
;

cluster default
fnv1a_ch replication 1
127.0.0.1:2103
;

aggregate
^collectd\.(.+)\.cpu\.([0-9]+)\.percent\.idle
^collectd\.(ABC-.+)\.cpu\.([0-9]+)\.percent\.idle
^collectd\.ABC-(.+)\.cpu\.([0-9]+)\.percent\.idle
^collectd\.([^.]+)\.cpu\.([0-9]+)\.percent\.idle
every 10 seconds
expire after 15 seconds
timestamp at end of bucket
compute count write to
collectd.\1.aggregated.cpu.total_cores
stop
;
match *
send to default
stop
;

aggregation
^collectd\.(.+)\.cpu\.([0-9]+)\.percent\.idle (regex) -> collectd.test_host.cpu.42.percent.idle
count(collectd.\1.aggregated.cpu.total_cores) -> collectd.test_host.aggregated.cpu.total_cores
stop
aggregation
^collectd\.(.+)\.cpu\.([0-9]+)\.percent\.idle (regex) -> collectd.test_host2.cpu.42.percent.idle
count(collectd.\1.aggregated.cpu.total_cores) -> collectd.test_host2.aggregated.cpu.total_cores
stop
2 changes: 2 additions & 0 deletions test/issue461.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
collectd.test_host.cpu.42.percent.idle
collectd.test_host2.cpu.42.percent.idle

0 comments on commit 74be92d

Please sign in to comment.