0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DatadogのDBMにおけるQuery InsightをMonitorで通知する

Last updated at Posted at 2024-09-06

Monitorで通知したい対象:

DatadogでDBMを有効化すると自動で検知される"Query Insights"
image.png

設定方法:

Explain Planに"@db.insights.type"というAttributeが付与されており、"Index Recommendation"など、一部の"Query Insight"はこちらのAttributteで引っ掛けることで、Monitorで通知可能

Monitorの設定例:

image.png

実際の通知:

image.png

通知に自動付与されるURLからInsightとして検知された内容を確認可能
image.png

設定をExportしたJSON Config

Monitor設定右上の"New from JSON"からImportして設定可
image.png

{
	"id": 153136904,
	"name": "DBM Query Insight Monitor",
	"type": "database-monitoring alert",
	"query": "database-monitoring(\"dbm_type:plan @db.insights.type:*\").rollup(\"count\").by(\"@db.plan.signature,@db.statement\").last(\"5m\") > 0",
	"message": "There is a Query Insight.\n\nthe query signature:  \"{{[@db.plan.signature].name}}\"\nquery statment:\n{{[@db.statement].name}} \n\n\n{{databasemonitoring.link}}\n@slack-Datadog_Incidents-team-taka2",
	"options": {
		"thresholds": {
			"critical": 0
		},
		"enable_logs_sample": true,
		"notify_audit": false,
		"on_missing_data": "default",
		"include_tags": true,
		"new_group_delay": 60,
		"groupby_simple_monitor": false,
		"silenced": {
			"*": null
		}
	},
	"priority": 5,
	"restriction_policy": {
		"bindings": []
	}
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?