Skip to content

Import PBX Data from a Database into Grafana

Once your PBX (Private Branch Exchange, your phone system) data is flowing into a third-party database, you can surface it in Grafana. Register the database as a Grafana data source, then load the Cloud Voice dashboard template to turn your call records into charts and tables.

PlatformRequirement
GrafanaAn account with the Organization administrator role.
Third-party databaseSee the list below.

For the database, make sure all of the following are in place:

You have already synced your PBX data to a third-party database.

Setting up the integration takes two stages:

  1. Connect Grafana to the database.
  2. Import a dashboard from the database using the Cloud Voice template.
  1. Sign in to Grafana and go to Connections > Add new connection.

    The Add new connection page under Connections in Grafana

  2. Add a data source:

    a. Search for your database type and pick it from the list of available data sources. In this example, choose the PostgreSQL data source.

    Selecting the PostgreSQL data source from the connection search results

    b. In the top-right corner, click Add new data source.

    The Add new data source button on the PostgreSQL connection page

  3. Enter the details Grafana needs to reach the database:

    a. Under Connection, provide the connection settings.

    ItemDescription
    Host URLThe IP address or domain name of the machine running the database, along with the database port.
    Database nameThe name of the database.

    b. Under Authentication, provide the sign-in credentials.

    ItemDescription
    UsernameThe username used to connect to the database.
    PasswordThe password used to connect to the database.
  4. Optional: Adjust any other settings your setup requires.

  5. Scroll to the bottom of the page and click Save & test to validate and store the connection. A Database Connection OK message confirms that Grafana reached the database.

Step 2. Import a dashboard using the template

Section titled “Step 2. Import a dashboard using the template”
  1. In your browser’s address bar, copy the data source UID (Unique Identifier, the ID Grafana assigns to the data source you just created), it is the final segment of the URL. You need it when editing the template.

    The data source UID shown at the end of the Grafana page URL

    In this example, the UID is bfkbvupmpwe0wb.

  2. Download and edit the dashboard JSON template:

    a. Download and unzip the Cloud Voice dashboard template package. It bundles templates for each supported database, pick the one that matches yours. This example uses the PostgreSQL template.

    The PostgreSQL dashboard template file inside the template package

    b. In every panel, replace each uid value under datasource with the UID you copied.

    The datasource uid values being edited in the dashboard JSON file

    c. Optional: Change the title value. Grafana uses it as the dashboard name.

    The title field being set in the dashboard JSON template

  3. Import the edited template into Grafana:

    a. In the left navigation bar, click Dashboards.

    b. In the top-right corner, click the add icon Add icon and choose Import dashboard.

    The Import dashboard option in the Dashboards add menu

    c. Click Upload dashboard JSON file and select your edited .json file.

    d. Click Import.

    The dashboard import settings before confirming the import

The dashboard loads into Grafana and your PBX data appears as charts and tables.

A Grafana dashboard populated with imported PBX call data

Tune the SQL queries in the dashboard to control exactly which data appears.