7.3. 导入仪表板
- 从左侧的 Grafana 菜单打开仪表板页面。
- 单击 New and Import。
- 单击 Upload dashboard JSON 文件,再选择您要导入的仪表板的 JSON 文件。
- 选择您的 Prometheus 数据源。
- 点 Import。
提示
Grafana 仪表板带有由 Kubernetes 插入的标签。通过在 Prometheus 配置文件中添加缺少的标签,可以在裸机部署中使用仪表板,如下所示。
Prometheus Scrape 配置
scrape_configs:
# The job name is added as a label `job=<job_name>` to any time series scraped from this config.
- job_name: "keycloak-service"
static_configs:
- targets: ["localhost:9000", "localhost:9001", "localhost:9002"]
labels:
namespace: 'keycloak'
container: 'keycloak'
relabel_configs:
- source_labels: [__address__]
target_label: pod