> For the complete documentation index, see [llms.txt](https://docs.hostedgraphite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostedgraphite.com/add-ons-and-integrations-guide/carbon-c-relay.md).

# Carbon-C-Relay

Carbon-C-Relay is a lightweight, high-performance proxy that acts as an intermediary between metric sources and Hosted Graphite. It is commonly used for pre-aggregation and securely forwarding metrics from private networks to external destinations. You can locate the latest releases/assets [HERE](https://github.com/grobian/carbon-c-relay/releases/tag/v3.8.1), and see configuration syntax [HERE](https://github.com/grobian/carbon-c-relay?tab=readme-ov-file#configuration-syntax). Below is a basic sample configuration and setup:

Installation (Linux):

```
sudo apt install -y carbon-c-relay
```

Modify your configuration file with the following (generally located at: */etc/carbon-c-relay.conf*):

```
rewrite ^([a-zA-Z0-9_\.\-]*)
  into <HG-API-KEY>.\1
  ;

cluster hg
  forward
    carbon.hostedgraphite.com:2003
  ;

# Forward internal relay system metrics with the carbon.relays prefix
match ^carbon\.relays\..*
  send to hg
  stop
  ;

match *
  send to hg
  stop
  ;
```

Restart the service and check status:

```
sudo systemctl restart carbon-c-relay
sudo systemctl status carbon-c-relay
```

Now, any metrics sent to **localhost:2003** will be collected and forwarded by the Carbon-C-Relay service. Additionally, internal relay performance metrics (carbon.relays.\*) will be automatically forwarded to your Hosted Graphite account.

<figure><img src="/files/Hq3FoRzGAmB90eMb2iGB" alt=""><figcaption><p>Carbon-C-Relay Example Dashboard</p></figcaption></figure>
