statsd-proxy
statsd-proxy copied to clipboard
add preagg feature
添加了指标替换的功能:
目的 agg.cfg 所示, 首先匹配以 metric.test.v 为开头的所有metric,例如 metric.test.value-xg-1.do和 metric.test.visual ,然后,从匹配位置开始截取到下一个 . 符号为止,全部替换成 metric.test.hello 。
最终结果就是:
metric.test.hello.do
metric.test.hello
另外,原指标按照要求会仍然被保留。
@hit9
走google style, 用clang-format lint下
reformat done @hit9
@wayslog 配置搞到一份config里去
@wayslog 配置搞到一份config里去
没明白……是像我上面那样?
把规则配置文件的内容写到原来的配置文件中,而不是分成两个配置文件。
最新格式
rule remove|metric.test.v|metric.test.to # 将metric.test.v 聚合为 metric.test.to
rule copy|metric.test.c|metric.test.cval # 将metric.test.c 聚合为 metric.test.cval
rule copy|metric.test.c # 将metric.test.c 聚合为 metric.test.c 用于trim,这种情况下 prefix和suffix是一样的
写在同一个配置文件里即可。 @hit9
@wooparadog 你来负责这个项目吧
Not sure about the content of your chat since I don't speak Chinese but a pre-aggregation feature seems :+1: to me as a tcpdump of proxy output clearly shows packets with same metrics that will actually be aggregated anyway:
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:1657|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:1657|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:22800|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:2287|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:13758|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:61706|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:85547|c
cdn.cRPnBlkg3CDU.KAnkkEDSINDg.client.hit.200.cdn-frpar1-001.bytes:124710|c
The goal is clearly not to re-make statsd in C but to minimize network load and statsd work at the same time.
@wooparadog How about the status of this pr? Have you already given up this feature?