跳到正文
LEo的网络日志
返回

如何在azure postgresql中触发failed connections指标数据

工作中遇到一个需求,需要定义alert去监控azure postgresql的连接失败次数,但是默认情况下,azure postgresql的这个指标数据是没有值的。所以如果想触发定义的alert,需要想办法触发这指标产生数据,以下是一些可能导致连接失败的常见情况:

这里采用最简单的方式实现,使用无效的密码连接数据库,会触发azure postgresql的failed connections指标产生数据。在azure postgresql的页面找到数据看的连接字符串connection strings,选择postgresql connection url命令行,比如:

postgres://user1:{your_password}@your_db.postgres.database.azure.com/postgres?sslmode=require

然后通过psql执行上面的命令,就会触发azure postgresql的failed connections指标产生数据:

psql "postgres://user1:{your_password}@your_db.postgres.database.azure.com/postgres?sslmode=require"


上一篇
降级olm管理的operator版本
下一篇
azure vnet peering