Grafana on the Ametnes Platform#
This tutorial explains how to provision a Grafana data service on the Ametnes Platform. Grafana is commonly used with Prometheus to build dashboards and explore metrics.
Prerequisites#
- An Ametnes Platform account.
- A configured Data Service Location.
Provision Grafana on Ametnes Platform#
- Sign in to the Ametnes Platform console.
- Click New Resource.
- Enter:
- Name: a unique name for your Grafana service.
- Resource Kind:
grafana. - Tier: choose a preset tier size that matches your expected user load and dashboard complexity.
- Storage: choose capacity for Grafana’s database and persisted configuration (for example dashboards and users stored locally).
- Select your Data Service Location.
- Click Create.
- Save the generated connection details: URL, username, and password (or single-use setup token if the console shows one).
You do not select individual nodes, CPU, or memory, and you do not attach a separate Network Access resource for Grafana.
Note
Treat Grafana credentials like any production admin account. Rotate passwords if they were shown only once during creation.
Open Grafana#
- Open the Grafana URL from your resource details in a browser.
- Sign in with the username and password (or complete first-time setup if the product requires it).
Use Grafana with Prometheus#
After provisioning Prometheus, add it as a data source in Grafana (Prometheus uses HTTP Basic Authentication).
Using the UI#
Follow Connect Grafana to Prometheus in the Prometheus tutorial to add the data source from the Grafana interface.
Using Terraform#
For a more composable and repeatable process, Infrastructure as Code (IaC) is usually a better option.
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
version = "~> 3.0"
}
}
}
provider "grafana" {
url = var.grafana_url
auth = "${var.grafana_user}:${var.grafana_password}"
}
resource "grafana_data_source" "prometheus" {
type = "prometheus"
name = "Ametnes Prometheus"
url = var.prometheus_url
basic_auth = true
basic_auth_username = var.prometheus_user
secure_json_data_encoded = jsonencode({
basicAuthPassword = var.prometheus_password
})
}
variable "grafana_url" {
type = string
}
variable "grafana_user" {
type = string
}
variable "grafana_password" {
type = string
sensitive = true
}
variable "prometheus_url" {
type = string
}
variable "prometheus_user" {
type = string
}
variable "prometheus_password" {
type = string
sensitive = true
}
You can then import dashboards or build your own panels against your Ametnes Prometheus instance.
Validation checklist#
- Grafana resource status is
onlinein Ametnes Platform. - You can sign in to the Grafana UI using the saved URL and credentials.
- If Prometheus is provisioned, the Prometheus data source Save & test succeeds from the steps linked above.