写点什么

达梦数据库监控观测最佳实践

作者:观测云
  • 2025-07-09
    上海
  • 本文字数:1678 字

    阅读完需:约 6 分钟

达梦数据库监控观测最佳实践

概述

达梦企业管理器简称 DEM,架构如下:



概略来说,每个数据库主机安装代理程序 DMAgent,在监控方面,它将指标发送至 DEM 服务端,用户可访问 DEM 控制台查看数据主机和实例的监控指标,在 DEM 进行配置后可通过 http://<dem-server>:8080/dem/metrics 端点暴露主机和数据库的 Prometheus 指标,观测云 DataKit 可从此端点采集指标完成达梦数据库集成。

前提条件

  • 监控目标可通过 DMAgent 上报指标至 DEM。

配置 DEM 暴露监控指标

请按照以下步骤操作:

1、访问 DEM,点击“监控-数据库监控”,点击“+”,添加需要监控的数据库实例。



2、点击“系统-系统配置”,在第七项“其他功能”中修改 prometheus_metric_mf_nodes 和 prometheus_metric_db_nodes,分别添加主机和数据库节点,以暴露 Prometheus 指标,修改后点击保存。



3、请求 http://<dem-server>:8080/dem/metrics 端点,如果有 Prometheus 指标输出则配置成功,指标中有以下重要标签:

  • instance,DEM 实例;

  • db,数据库实例名;

  • mf,主机。

观测云

观测云采集器 DataKit 支持 Prometheus 指标采集插件,能够从指标端点自动拉取指标,并在指标上报时附加由用户定义的标签。

部署 DataKit

登录观测云控制台,点击「集成」-「DataKit」-「Linux」,复制安装命令在服务器执行即可,推荐安装在 DEM 所在服务器。



开启 Promv2 插件

按照以下步骤操作:

1、开启插件:

# 进入 Prometheus 采集器配置文件目录cd /usr/local/datakit/conf.d/prom# 创建插件配置文件cp promv2.conf.sample promv2_dem.conf
复制代码

2、修改插件配置,以下是一份完整的配置示例:

# {"version": "1.75.1", "desc": "do NOT edit this line"}
[[inputs.promv2]] ## Collector alias. # 此项将作为 datakit monitor 命令中采集器的名称,设置为指定值便于区分 source = "prom_dem"
# Prometheus 指标端点 url = "http://192.168.195.55:8080/dem/metrics"
## (Optional) Collect interval: (defaults to "30s"). # 采集频率 interval = "30s"
## Measurement name. ## If measurement_name is empty, split metric name by '_', the first field after split as measurement set name, the rest as current metric name. ## If measurement_name is not empty, using this as measurement set name. # 上报至观测云时的指标集名称 measurement_name = "prom_dem"
## Keep Exist Metric Name ## If the keep_exist_metric_name is true, keep the raw value for field names.
## The bearer_token_file specifies the token file, and the Authorization header is added automatically. # bearer_token_file = "" ## TLS config # insecure_skip_verify = true ## Following ca_certs/cert/cert_key are optional, if insecure_skip_verify = true. # ca_certs = ["/opt/tls/ca.crt"] # cert = "/opt/tls/client.root.crt" # cert_key = "/opt/tls/client.root.key"
## Set to 'true' to enable election. election = true
## Add HTTP headers to data pulling (Example basic authentication). # [inputs.promv2.http_headers] # Authorization = ""
[inputs.promv2.tags] # some_tag = "some_value" # more_tag = "some_other_value"
复制代码

3、执行命令 datakit service -R 重启 DataKit,启用采集器,可执行命令 datakit monitor 查看采集器运行情况,稍后,可在观测云「指标」-「指标管理」页面搜索指标集 prome_dem 查看指标。

需要注意的是,DEM 的导出指标并没有其控制台丰富。

场景视图

登录观测云控制台,点击「场景」 -「新建仪表板」,输入“达梦”, 选择 “达梦数据库监控视图” ,点击 “确定” 即可添加视图。视图包含数据库与主机的基本指标。





关键指标


监控器

观测云已内置部分监控器,在「监控」-「监控器」页面启用 达梦数据库检测库




总结

达梦数据库通过自有组件 DEM 导出 Promethues 协议的指标,方便接入到观测云平台。观测云采集这些指标并结合业务形态进行全面可观测,为用户提供良好的产品体验。

用户头像

观测云

关注

还未添加个人签名 2021-02-08 加入

云时代的系统可观测平台

评论

发布
暂无评论
达梦数据库监控观测最佳实践_数据库_观测云_InfoQ写作社区