Building a graph in Graphite

The Graphite interface introduces several extensive capabilities. In order to use its complete functionality, we must log in. After doing so, we can save graphs, delete saved graphs, load graphs that other users have created and customized, and much more.

This recipe will take you through the interface to create a graph, save it, and load it later. Finally, we can avoid extremely technical discussions for a while!

Getting ready

In this recipe, we will be combining the results of all the previous recipes related to collectd and Graphite. We recommend that you have a functional monitor server configured, as discussed in those recipes.

When we installed and configured Graphite, it should have asked for a username and password for the primary administrative user. This information will be necessary to log in to the interface.

How to do it...

Follow these instructions to build, save, and load a saved graph:

  1. Direct a web browser at the monitor server on port 8080.
  2. Click on the Login link located at the top of the page.
  3. Enter the username and password as requested, and click on login.
  4. Click on the Graphite link on the left pane.
  5. Click on the collectd link on the left pane.
  6. Click on the name of the server you wish to view.
  7. Continue by clicking on postgresql, Production, and then on derive.
  8. Select the item corresponding to a busy database or default to TPS-postgres.
  9. Select another item from the derive list so that both data points are in the same graph.
  10. Click on the save icon shaped like a floppy disk, and name this graph. We suggest that you name it Production TPS.
  11. Reload the browser window to clear out any selections.
  12. Click on My Graphs on the left pane.
  13. Choose the Production TPS graph.

How it works...

Regular guest users can view graphs, but they cannot save views for later. When we installed Graphite, it created a default user, probably named root. For now, we can use this for demonstration purposes. The login screen is very terse:

How it works...

Once we have logged into Graphite, we are free to build a graph. When we click on a link on the left pane, we expand its contents. Every expanded section leads to a list of one or more further sections. As such, we keep clicking on them until we reach items that can be represented on the graph pane. The data we are interested in is being supplied by collectd, so we start with it after expanding the Graphite section.

We recommended that you select two data series for two reasons. First, it shows that multiple data points can exist in the same graph. Secondly, we believe that saving a graph with only one data point is boring. After the two data points are activated, our interface should look like this:

How it works...

The active line through the graph represents the pgbench database in our test system, and it is quite busy. The dashed line at the bottom of the graph is the postgres database, which nobody uses, and it is zero for the duration of our view window. Regardless of the contents, we save this graph so that we can load it again later.

After we reload the browser window and expand the My Graphs link, we should see the graph that we just saved:

How it works...

Click on the Production TPS chart, and it should load on the right pane automatically.

There's more...

Graphite groups the items that contain a period anywhere in their names. We suggest that you develop a naming scheme to take advantage of this. A good naming scheme should incorporate the environment and a descriptive explanation of the graph's contents. If we used Trading | Database Write Activity, our saved graphs would look like this:

There's more...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.138.14