Skip to content

GreptimeTeam/greptimedb-grafana-datasource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GreptimeDB DataSource for Grafana

GitHub Release GitHub License This is a Grafana data source plugin built for GreptimeDB. This plugin is built on top of original Grafana ClickHouse data source and enhanced for GreptimeDB's additional features.

Installation

Grab the latest release from release page, Unzip the file to your grafana plugin directory.

Use grafana cli to download and install

Install signed version

grafana cli --pluginUrl https://github.com/GreptimeTeam/greptimedb-grafana-datasource/releases/latest/download/info8fcc-greptimedb-datasource.zip plugins install info8fcc

Install unsigned version

If there is some error when installing signed version, use unsigned version

you need to set grafana ini file to use unsigned plugin.

allow_loading_unsigned_plugins = info8fcc-greptimedb-datasource

If you are using Grafana inside Docker, you need to export the variable:

GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=info8fcc-greptimedb-datasource
grafana cli --pluginUrl https://github.com/GreptimeTeam/greptimedb-grafana-datasource/releases/latest/download/info8fcc-greptimedb-datasource-unsigned.zip plugins install info8fcc

Note that you may need to restart your grafana server after installing the plugin.

Docker Image

We also build Grafana docker image that includes GreptimeDB datasource by default. To run the docker image:

docker pull greptime/grafana-greptimedb:latest
docker run -p 3000:3000 greptime/grafana-greptimedb:latest

You can log in Grafana by visiting http://localhost:3000. The default username and password are both set to admin.

Docs

See our setup guide from our docs.

Connection settings

Click the Add data source button and select GreptimeDB as the type.

grafana-add-greptimedb-data-source

Fill in the following URL in the GreptimeDB server URL:

http://<host>:4000

In the Auth section, click basic auth, and fill in the username and password for GreptimeDB in the Basic Auth Details section (not set by default, no need to fill in).

  • User: <username>
  • Password: <password>

Then click the Save & Test button to test the connection.

General Query Settings

Before selecting any query type, you first need to configure the Database and Table to query from.

Setting Description
Database Select the database you want to query.
Table Select the table you want to query from.

Table Query

Choose the Table query type when your query results do not include a time column. This is suitable for displaying tabular data.

Setting Description
Columns Select the columns you want to retrieve. Multiple selections are allowed.
Filters Set conditions to filter your data.

Table Query


Metrics Query

Select the Time Series query type when your query results include both a time column and a numerical value column. This is ideal for visualizing metrics over time.

Main Setting Description
Time Select the time column.
Columns Select the numerical value column(s).

Time Series


Logs Query

Choose the Logs query type when you want to query log data. You'll need to specify a Time column and a Message column.

Main Setting Description
Time Select the timestamp column for your logs.
Message Select the column containing the log content.
Log Level (Optional) Select the column representing the log level.

Logs


Traces Query

Select the Traces query type when you want to query distributed tracing data.

Main Setting Description
Trace Model Select Trace Search to query a list of traces.
Trace Id Column Default value: trace_id
Span Id Column Default value: span_id
Parent Span ID Column Default value: parent_span_id
Service Name Column Default value: service_name
Operation Name Column Default value: span_name
Start Time Column Default value: timestamp
Duration Time Column Default value: duration_nano
Duration Unit Default value: nano_seconds
Tags Column Multiple selections allowed. Corresponds to columns starting with span_attributes (e.g., span_attributes.http.method).
Service Tags Column Multiple selections allowed. Corresponds to columns starting with resource_attributes (e.g., resource_attributes.host.name).

Traces

Development

Yarn 1.x is required for this project. Execute these commands in code root folder

  1. Install dependencies

    yarn install
  2. Build plugin in development mode and run in watch mode

    yarn run dev
  3. Build backend plugin binaries for Linux, Windows and Darwin:

    mage -v build:linux
  4. Start Docker Service

    docker compose up

License

GreptimeDB uses the Apache License 2.0 to strike a balance between open contributions and allowing you to use the software however you want.

About

Grafana DataSource of GreptimeDB

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 29