Prometheus

Create Service

To experience the full power of GreptimeCloud, you need to create a service which contains a database with authentication. Open the GreptimeCloud console, signup and login. Then click the New Service button and config the following:

  • Service Name: The name you want to describe your service.
  • Description: More information about your service.
  • Region: Select the region where the database is located.
  • Plan: Select the pricing plan you want to use.

Now create the service and we are ready to write some metrics to it.

Write data

If you already have a Prometheus instance running

Add the following section to your Prometheus configuration.

  1. remote_write:
  2. - url: https://<host>/v1/prometheus/write?db=<dbname>
  3. basic_auth:
  4. username: <username>
  5. password: <password>

Or if you prefer a fresh start

Spin up a Docker container to write sample data to your database:

  1. docker run --rm -e GREPTIME_URL='https://<host>/v1/prometheus/write?db=<dbname>' -e GREPTIME_USERNAME='<username>' -e GREPTIME_PASSWORD='<password>' --name greptime-node-exporter greptime/node-exporter

Prometheus - 图1NOTE

To avoid accidently exit the Docker container, you may want to run it in the “detached” mode: add the -d flag to the docker run command.

Visualize Data

After successfully writing data to the service, you can view the data on the GreptimeCloud dashboard. The dashboard provides a variety of visualizations to help you understand, monitor and analyze the data.

Here, we create a panel that displays the 95% CPU usage as an example. To do this, click the Add Panel button, select a table that contains the CPU usage data, and then choose the 95% aggregation method. Finally, click the Save button to save the panel. You can now see the new panel and set up an alert rule for it.