简体   繁体   English

是否可以使用 datadog 或 Prometheus 对应用程序采取行动?

[英]Is it possible to take action on an application using datadog or Prometheus?

I want to take some action on the app server based on the server utilisation.我想根据服务器利用率对应用程序服务器采取一些措施。 The monitoring on the server is done by datadog.服务器上的监控由datadog完成。 So is it possible to take an action on the server using datadog ?那么是否可以使用 datadog 在服务器上采取行动?

The datadog agent you deployed has no power to run scripts or take action.您部署的 datadog 代理无权运行脚本或采取行动。 It is purely a monitoring/data collection tool.它纯粹是一个监控/数据收集工具。


However one of the things your monitors in the Datadog application can do is trigger events when they go into an alert state.但是,Datadog 应用程序中的监视器可以做的一件事是在事件进入警报状态时触发事件。 There are lots of integrations : creating a ticket in Jira, posting a message to Slack, triggering an SNS topic.很多集成:在 Jira 中创建票证、向 Slack 发布消息、触发 SNS 主题。

What I recommend you try to do, is to create some kind of job or script that can be triggered externally, like a lambda function, or a jenkins job, or anything really.我建议您尝试做的是创建某种可以从外部触发的作业或脚本,例如 lambda 函数或 jenkins 作业,或任何真正的东西。 When the monitor goes off you can use a webhook to trigger that script to do whatever you define.当监视器关闭时,您可以使用webhook触发该脚本以执行您定义的任何操作。 Here is a blog post showing how twilio sent out a text message by connecting their api to a webhook .这是一篇博客文章,展示了 twilio 如何通过将他们的 api 连接到 webhook 来发送文本消息

You can configure Prometheus alertmanager.您可以配置 Prometheus 警报管理器。 This can give a callback to webhook configured and this webhook can then execute action upon invocation.这可以为配置的 webhook 提供回调,然后该 webhook 可以在调用时执行操作。

https://prometheus.io/docs/alerting/latest/configuration/ https://prometheus.io/docs/alerting/latest/configuration/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM