# Diamond

Diamond runs on your server, and intermittently sends these useful system metrics to Graphite. Here’s a quick primer on how to configure it.

### Configuring Diamond

* **Download Diamond** - Available at [https://github.com/BrightcoveOS/Diamond](https://github.com/python-diamond/Diamond).
* **Install Diamond** - Follow the installation instructions at <https://github.com/BrightcoveOS/Diamond/wiki/Installation>.
* **Edit the config file** - Usually located at `/etc/diamond/diamond.conf`

  > 1. At the top of the config file, add the HostedGraphiteHandler
  >
  > > ```
  > > # Handlers for published metrics.
  > > handlers =  diamond.handler.hostedgraphite.HostedGraphiteHandler
  > > ```
  >
  > 2. Under the `[handlers]` `[[HostedGraphiteHandler]]` section, set:
  >
  > > ```
  > > apikey = YOUR_API_KEY
  > > timeout = 15
  > > batch = 1
  > > ```
  >
  > 3. Under the `[[default]]` section, you can change how frequently metrics are reported:
  >
  > 4. On our servers we also enable collectors for network metrics and MySQL:
  >
  > > ```
  > > [[NetworkCollector]]
  > > enabled = True
  > >
  > > [[MySQLCollector]]
  > > enabled = True
  > > hosts = username:pass@localhost:3306/mysql,
  > > master = True
  > > innodb = True
  > > ```
* **More collectors** - Here is a [full list of Diamond collectors](https://github.com/BrightcoveOS/Diamond/wiki/Collectors) for various systems e.g. Hadoop, NetApp, Nginx, Postgres, RabbitMQ, Redis, and Zookeeper.
* **Start Diamond** - Usually with `/etc/init.d/diamond start` but it may differ depending on your OS.

Diamond should now be configured to send data to Hosted Graphite and it will appear under the ‘servers’ entry in your tree of metrics. Once you start receiving Diamond metrics, an automatic Diamond dashboard will be created in your account which offers a great starting point and can be customized further.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hostedgraphite.com/agents-guide/diamond.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
