---
title: "Groonga data source plugin for Grafana"
description: "Groonga datasource. Groonga data source plugin for Grafana by Groonga. Available in Grafana Cloud and self-managed Grafana."
---

> This is the Markdown version of https://grafana.com/grafana/plugins/groonga-datasource/

# Groonga

- Developer: Groonga
- Version: 1.1.4
- [Installation](https://grafana.com/grafana/plugins/groonga-datasource/installation.md)

![Datasource configuration](https://grafana.com/api/plugins/groonga-datasource/versions/1.1.4/images/img/screenshot-datasource-configuration.png)

![Panel](https://grafana.com/api/plugins/groonga-datasource/versions/1.1.4/images/img/screenshot-panel.png)

# Grafana Groonga Data Source Plugin

![CI](https://github.com/groonga/grafana-datasource-plugin-groonga/workflows/CI/badge.svg)

View report data from Groonga in your Grafana.

## Install the Data Source

Use the new grafana-cli tool to install groonga-datasource from the commandline:

```bash
grafana-cli plugins install groonga-datasource
```

The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins if you installed the grafana package.

## Configure the Data Source

Accessed from the Grafana main menu, newly installed data sources can be added immediately within the `Data Sources` section. Next, click the `Add data source` button in the upper right. The data source will be available for selection in the Type select box. To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear. Select Groonga-datasource and enter the `Name`, `URL`, `Default table name`, and `Default field name` in the displayed setting screen.

## How to try

You can use [docker-compose](https://docs.docker.com/compose/) to try groonga-datasource. Here is a command line to try groonga-datasource 1.0.4:

```bash
GF_GROONGA_DATASOURCE_DIR=/tmp/groonga-datasource \
  GF_INSTALL_PLUGINS="https://github.com/groonga/grafana-datasource-plugin-groonga/releases/download/1.0.4/groonga-datasource-1.0.4.zip;groonga-datasource" \
  docker-compose up garafana
```

You can find Grafana at <http://localhost:3000/> .

You can login as the `admin` user with `admin` for password.

You can find "Groonga" datasource at the bottom of <http://localhost:3000/datasources/new> . You can use the following parameters to use the test Groonga server that has some test data:

- Name: `Groonga`

- HTTP
  - URL: `http://groonga:10041/`

- Groonga Details

  - Default table name: `Logs`
  - Default time field name: `timestamp`

You can use the Groonga datasource in a panel with the following parameters:

- Table Name: `Logs`

You can see visualized data in the test Groonga server.

## Usage

- `Table Name`: target table name.
- `Time field`: the key time field for the table.
- `Output columns`: output columns by csv format. (ex: `timefield,value1,value2`)
- `limit num`: number of output records. default value is `10`.
- `Filter string`: filtering string according to [Groonga's script syntax](https://groonga.org/docs/reference/grn_expr/script_syntax.html).
- `Sort columns`: sort key columns by csv format. (ex: `timefield,value1,-value2`)
  - If you want to use descending order, add `-` at the beginning.)

If you want to perform aggregation processing, specify the following.

- `Key columns`: Aggregate key columns by csv format.
- `Type`: data aggregation method(count/sum/max/min/avg).
- `Target`: column to be aggregated.
- `Interval`: Interval when aggregation is performed for each fixed period.

> **Note:**
>
> - If you want to aggregate every certain period in the graph panel, `Interval` is required.
> - Aggregated time is stored in a column called AGGTIME and can be used in Key columns and Output columns.
> - If you want to display aggregated values, specify a special column name in Output columns.
>
> | Aggregation method | Special column name |
> | ------------------ | ------------------- |
> | count              | \_nsubrecs          |
> | sum                | \_sum               |
> | max                | \_max               |
> | min                | \_min               |
> | avg                | \_avg               |

> **Limitations:**
>
> - If multiple queries are used, the settings of the first query will be valid except for the aggregated items.

## Learn more

- [Build a data source plugin tutorial](https://grafana.com/tutorials/build-a-data-source-plugin)
- [Grafana documentation](https://grafana.com/docs/)
- [Grafana Tutorials](https://grafana.com/tutorials/) - Grafana Tutorials are step-by-step guides that help you make the most of Grafana
- [Grafana UI Library](https://developers.grafana.com/ui) - UI components to help you build interfaces using Grafana Design System

## License

Apache License 2.0, see [LICENSE](https://github.com/groonga/grafana-datasource-plugin-groonga/blob/master/LICENSE).
