---
title: "将 OCP 监控集成到 Prometheus - 云平台 OCP V4.3.0 | OceanBase 文档中心"
description: 将 OCP 监控集成到 Prometheus 本节为您介绍如何使用 Prometheus 集成 OceanBase 业务监控。 应用场景 用户需要使用自有的 Prometheus 体系集成业务监控。 前提条件 已部署 V2.28 及以上版本的 prometheus 服务。 已部署 V4.2.2 及以上的 OCP 版本…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*lJTmRZ61jSUAAAAAAAAAAAAADiGDAQ/original) 云平台 OCPV 4.3.0

# 将 OCP 监控集成到 Prometheus

更新时间：2026-04-14 11:55:54

[编辑](https://github.com/oceanbase/ocp-doc/edit/V4.3.0/zh-CN/1850.ocp-om-best-practices/1550.prometheus-https-sd.md)  

本节为您介绍如何使用 Prometheus 集成 OceanBase 业务监控。

## 应用场景

用户需要使用自有的 Prometheus 体系集成业务监控。

## 前提条件

- 已部署 V2.28 及以上版本的 prometheus 服务。
 - 已部署 V4.2.2 及以上的 OCP 版本。
 - 拥有主机读权限的账号。建议单独建一个相应用户，分配 HOST_VIEWER 角色（OCP 主机只读角色）。

## 操作步骤

1. 登录 OCP 平台。
 2. 在左侧导航栏单击 **系统管理** > **系统参数**，确认以下三个系统参数的配置情况。

   | 参数名称 | 描述 | 设置为 |
   | --- | --- | --- |
   | ocp.monitor.prometheus.service.discovery.enabled | 是否开启 Prometheus http service discovery 服务 | true |
   | ocp.monitor.server.exporter.auth.enabled | 是否开启 OCP 自监控认证 | false |
   | ocp.agent.auth.metric-auth-enabled | 是否开启OCP Agent 的监控API鉴权 | false |
 3. 在 Prometheus 的配置文件中填写抓取配置。参考如下示例：

   ```xml
   scrape_configs:
     - job_name: ocp_sd
       http_sd_configs:
         - url: 'http://xxx.xxx.xxx.xxx:port/api/v2/monitor/prometheus_sd'
           basic_auth:
             username: a****
             password: '******'

   ```

   | 参数 | 描述 |
   | --- | --- |
   | url | OCP 服务的 IP 地址+端口+API 名称。 |
   | username | 账号名称。建议单独建一个相应用户，分配 HOST_VIEWER 角色（OCP 主机只读角色）。 |
   | password | 账号密码。 |

   配置完成后，Prometheus 可通过接口获取 exporter 地址抓取数据，进行监控。
 4. 登录 Prometheus 服务地址，选择 **Status** > **Targets**。确认是否找到了所需要的 exporter 地址。

## 相关操作

- OCP V4.3.0 已支持白屏监控对接 Prometheus 数据源，详情可参考 [监控查询对接外部时序系统](https://www.oceanbase.com/docs/common-ocp-1000000000826627)。
 - 如果您正在使用 Grafana GUI 仪表盘进行数据可视化，可以在如下文档里下载 OCP 的 Grafana 模板 JSON 文件：[Grafana 仪表板](https://www.oceanbase.com/docs/common-ocp-1000000003804013)。

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
