grobian / carbon-c-relay

Enhanced C implementation of Carbon relay, aggregator and rewriter
Apache License 2.0
380 stars 107 forks source link

Unable to debug rules with -d -t -l flags #456

Closed pbaranovsky closed 1 year ago

pbaranovsky commented 1 year ago

we are trying to troubleshoot how certain stats received by ccrelay are aggregated. Normally we are running with /opt/ccrelay/bin/relay -f /opt/ccrelay/etc/relay.cfg [-S 30 -b 50000 -w 18 -q 15000000 -p 2013 -H stats-server] and are receiving statistics at the destination.

We are hoping to aggregate the stats from several servers and send on the sum like so: aggregate a.b.c.(...).server-x1[1,2].field.(....?).([A-Za-z0-9_-]+)$ <<ie match from either server-x11 or server -x12 every 30 seconds expire after 50 seconds compute sum write to a.b.c.\1.sum.\2.\3 ;

this however is clearly not being computed properly. So in order to troubleshoot we've tried the -t switch like so /opt/ccrelay/bin/relay -t -q 15000000 -b 50000 -p 2013 -H stats-server -f /opt/ccrelay/etc/ccrelay.cfg

but all it seemingly does is print the ccrelay.cfg file above.

we have carbon-c-relay v3.1 and carbon-c-relay v3.4

grobian commented 1 year ago
-S  implies submission mode, print iostat-like statistics
-s  submission mode: don't add any metrics to the stream like
      statistics, report drop counts and queue pressure to log

-H  hostname: override hostname (used in statistics)

So I don't understand what you're trying to do. -S disables any statistics being sent, and -H just changes the statistic hostname, but they are not sent with your config.

What is "clearly not being computed properly" in your case? Are the values empty? Can you elaborate?

pbaranovsky commented 1 year ago
  1. Right now the stats are not coming up empty but rather with wrong values. Approximately double of what they should be.
  2. We are trying to see how the rules are processed on the carbon-c-relay level by the regex rule in the config file.
  3. From what I'm seeing in the --help menu I can use -t option to display at least some of the information on how the rules are processed but I'm not seeing anything other than the cfg file being displayed.
  4. Basically, how do I run the carbon-c-relay command(with what options) to see what's going on with the rule processing/re-writing?

This post https://github.com/grobian/carbon-c-relay/issues/371#issuecomment-512940073 is something that I would want to see outputted to see how the rules are processed.

grobian commented 1 year ago

With -t, the relay becomes interactive, and doesn't do any reception or delivery. Once you see the parsed config, anything you enter is treated as metric input, and it will report where it will go. You should just enter a few metrics that you believe are received by the relay.

pbaranovsky commented 1 year ago

thank you very much. that explains it. I will close this.