This is a simple example of integrating Datadog with an Amazon Echo. This is written on top of the Serverless framework to simplify development and deployment, but that's not important to the implementation.
Currently the only supported query is to ask for CPU levels, which will list out the current CPU values for all hosts in your account. For example, saying:
Alexa, ask Datadog to check the CPU
will result in a response along the lines of:
<iframe width="100%" height="80" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/269945578&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></iframe>Here are the current CPU loads. Gregs MacBook Pro is at 7%. Gregs iMac is at 4%
Here's an example of how to set up an interaction model for this skill.
{
"intents": [
{
"intent": "QueryIntent",
"slots": [
{
"name": "Query",
"type": "QUERY_LIST"
}
]
}
]
}
Type | Values |
---|---|
QUERY_LIST | cpu |
QueryIntent query {Query}
QueryIntent check {Query}
QueryIntent to query {Query}
QueryIntent to check {Query}
QueryIntent to query the {Query}
QueryIntent to check the {Query}
You'll also need to supply your Datadog API and app keys in order for the queries to work properly. You can set these in handler.js
:
dogapi.initialize({
api_key: 'TODO',
app_key: 'TODO'
});