Grafana is a powerful visualisation tool that we can use to display graphics of the persisted data.
You can now follow Crate's recommendations on how to configure the datasource by checking out this post. If you already put some data in your database, you can jump directly to the "Add a Data Source" section. The main parts of such post are convered below.
Configuring the DataSource
Explore your deployed Grafana instance (e.g http://0.0.0.0:3000).
If you didn't change the defaults credentials, use
admin as both user and
Go to Add data source, select
PostreSQL and fill in the required fields,
with the following considerations:
- Name: This is the name you want for the Datasource. Name it
CrateDBand make it default.
- Host: The full url where CrateDB was deployed, but on port
5432. In the docker-compose example, this should be
- Database: This is the name of the database schema. By default, crate uses
docschema, but if you are using multi-tenancy headers, the schema will be defined by the tenant of the entity type. More info in the Multi-tenancy section.
- User: Use
- SSL Mode:
The following image shows an example of how the datasource configuration should look like
Click Save & Test and you should get an OK message.
Using the DataSource in your Graph
Having your datasource setup, you can start using it in the different visualisation widgets.
The following is an example of a simple Graph using a datasource connected to CrateDB. Note the selection of the datasource (called CrateDB in this case), as well as the specification of the table in the from field.
Note table names are prefixed by
et. See the Data Retrieval
section to know how table names are defined, but you should recognise the
Note the name of the column used as time index is
time_index, as explained
in the Time Index section.