iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐶

Implementing Simple Tools with Datadog Workflow Automation and Datastore featuring Bits AI

に公開

Introduction

Datadog has a tool for creating workflows called Workflow Automation.

https://www.datadoghq.com/product/workflow-automation/

With this tool, you can create workflows linked to various events and triggers on Datadog.

For example,
"Create a ticket in Asana when an alert occurs"
"Restart a database when an alert occurs"
"Send a Slack reminder to the Datadog On-Call person every day at 9:00 AM"

You can create workflows that integrate not only with internal Datadog features but also with external services.

Today, I would like to introduce my personal favorite features within Workflow Automation: Edit with AI and Datastore.

By combining these two features, you can create workflows that include simple data exchanges using natural language, without having to set up a database on the user side.

I suspect many people will find that several of their existing tools are no longer necessary once they can do this.

Edit with AI

Edit with AI is a feature that appears on the Workflow Automation top page or in the upper left of the editor screen.

On the top page, a text box is displayed along with Build a workflow with AI, allowing you to enter workflow requirements in natural language.

In the Workflow Automation editor, the Edit with AI button is shown in the upper left; clicking it will display a similar text box.

For example, let's enter the following prompt as shown in the previous screenshot:

I want you to post a list of users who logged into Datadog today to Slack

Then, Bits AI starts working.

Of course, you can also manually edit the generated workflow.

If you Run it directly from the workflow creation screen, a notification will be sent to Slack as follows:

In this instance, no target users were found because it was executed right after the date changed.
So, let's try changing it to notify users who accessed Datadog yesterday instead.

Then, Bits AI starts working again and updates the workflow.

When I ran the updated workflow, the "users who logged into Datadog yesterday" were notified on Slack.


I feel like the number of users is a bit too small, but I'll skip that for now as it's off-topic
(You can also handle debugging from here together with Bits AI)

In this way, you can leverage the currently popular AI-driven development even within Datadog.

Datastore

Next, I'll introduce Datastore.

https://docs.datadoghq.com/actions/datastores/

Datastore is a database service available within Workflow Automation.

Since it allows you to store data outside of workflows, you can persist data used within a workflow or share data across different workflows.

In this example, let's create a workflow to "post a list of applications managed by a team to that team's Slack channel." In this workflow, we will store a mapping of teams to their notification channels in Datastore and reference it within the workflow.

Without Datastore, you would have to either hardcode information within the workflow's logic or set up an external database. We'll see how using Datastore simplifies the workflow and makes it easier to add or update teams.

First, create a Datastore.

From Create Datastore, you can configure settings such as the name, Primary key, and access permissions. You can also upload initial data from a file here, or add it later.

Now, let's actually add data to the Datastore.

In this case, I created a datastore with two columns: team_id and slack_channel_id.

{
  "team_id": "xxx",
  "slack_channel_id": "#xxx"
}

By creating a workflow that uses this Datastore, you can execute workflows while persisting data without having to set up a separate database.

Summary

In this article, I introduced Datadog Workflow Automation's Edit with AI and Datastore features.

Datadog is useful not only as an application monitoring tool like APM but also as a convenient tool for the surrounding DevOps ecosystem.

Please note that Datadog Workflow Automation, which was used this time, is based on pay-as-you-go pricing, so caution is required when using it.

https://www.datadoghq.com/ja/pricing/?product=workflow-automation#products

Discussion