carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Rewriting does not occur

Open guidoffm opened this issue 3 years ago • 8 comments

I use the Helm chart:

https://artifacthub.io/packages/helm/kiwigrid/graphite version 0.7.2

I have added these rules to rewrite-rules.conf:

    [pre]
    ^(.+) = somePrefix.someOther.\1
    [post]
    ^(.*) = bar.\1

I cannot see any rewriting. Do I have to activate the rewriting in another file?

guidoffm avatar May 10 '22 18:05 guidoffm

I'm afraid it's some issue in chart itself or config propagation to carbon. I didn't test config above but it looks legit, though.

deniszh avatar May 10 '22 19:05 deniszh

I don't believe it is an issue with the chart because I have noticed that:

When there is a problem in the regex the log shows there is a problem. Maybe I could try to test other container images.

guidoffm avatar May 10 '22 21:05 guidoffm

The Helm chart is here:

https://github.com/kiwigrid/helm-charts/tree/master/charts/graphite

guidoffm avatar May 10 '22 21:05 guidoffm

I don't believe it is an issue with the chart because I have noticed that:

When there is a problem in the regex the log shows there is a problem. Maybe I could try to test other container images.

The problem is also there with image tag 1.1.8-8.

guidoffm avatar May 10 '22 21:05 guidoffm

I found out this problem exists also when I run the pure Docker image:

docker run -d  --name graphite  --restart=always  -p 8080:80  \
-p 2003-2004:2003-2004  -p 2023-2024:2023-2024  \
-p 8125:8125/udp  -p 8126:8126 \
-v "$(pwd)"/rewrite-rules.conf:/opt/graphite/conf/rewrite-rules.conf graphiteapp/graphite-statsd

guidoffm avatar May 10 '22 21:05 guidoffm

Hmm... Then it's need to investigated, will try to dig more.

deniszh avatar May 11 '22 09:05 deniszh

Hi @guidoffm Sorry, it took me some time to find what the issue is. Rewrite is not part of carbon-cache, rewrite is part of carbon-aggregator. Aggregator is running in docker container by default, but listening port 2023 instead of 2003. You can switch them, if needed: carbon.conf

[cache]
LINE_RECEIVER_PORT = 2023
...
[aggregator]
LINE_RECEIVER_PORT = 2003
LOG_AGGREGATOR_MISSES = False
Screenshot 2022-05-22 at 13 51 02

deniszh avatar May 22 '22 11:05 deniszh

PS: unfortunately, carbon.conf is not configurable by environment variables, you need to mount fixed file or bake it in the image.

deniszh avatar May 22 '22 11:05 deniszh