# 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="https://495119770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZtHmoGZNsmARIViZEdbz%2Fuploads%2FqfhgMgyAkjtBY58QOAWT%2Fcarbon-c-relay_traffic-dash.png?alt=media&#x26;token=458179d9-e1cf-403f-af3d-2bf6b70aec06" alt=""><figcaption><p>Carbon-C-Relay Example Dashboard</p></figcaption></figure>
