Get your Datadog billing info in Slack with Nimbella Commander
Tags: serverless, cloud, slack, datadog
Published: 2020-02-19 17:28:39


   ![The banner to introduce the Nimbella serverless cloud Slack platform that will let users get their Datadob billing info.](https://miro.medium.com/max/1235/1*rxtOHl-6l68okC3y9BG6gw.png)
*Contact Nimbella on [Twitter](https://twitter.com/nimbella?lang=en), [LinkedIn](https://www.linkedin.com/company/nimbella/), or [Slack](https://nimbella.com/slack/)*

Have you ever wanted a simple way of displaying your [Datadog](https://www.datadoghq.com/) billing info? With [Nimbella Commander](https://nimbella.com/product/commander), you can have your current bill and next month's projected bill displayed in one command to your [Slack workspace](https://nimbella-community.slack.com/apps/AS833QXL0-nimbella-commander?next_id=0).



   ![The banner to introduce the Nimbella serverless cloud Slack platform that will let users get their Datadob billing info.](https://miro.medium.com/max/674/1*mq4jN70odSQ4yMAx8FA8Lw.png)

Later, I'll show you how to restrict who can access this Slack command so it's only available to people who need to know. Here's how to do it:

1. Inside your [Datadog API settings](https://app.datadoghq.com/account/login?next=%2Faccount%2Fsettings#api), Create a Datadog API key and Application key in Datadog's UI. You must name your API key datadogApiKey and your Application Key datadogApplicationKey.

    ![An example of Datadog billing information for Slack. Created by Nimbella](https://miro.medium.com/max/800/0*afyQ8_vDB9OE-AGA)

2. Add [Nimbella Commander to your Slack page](https://nimbella-community.slack.com/apps/AS833QXL0-nimbella-commander?next_id=0). You can add it by searching "Nimbella" in the apps tab on Slack. You can also add it by [going to our official website](https://nimbella.com/) and clicking the "Add to Slack" button.

    ![What our website looks like when you want to download Commander to Slack for Datadog billing information](https://miro.medium.com/max/715/1*qIyGMGfyJdVo-AP2t0HU9w.png)


3. In order to get your Datadog billing details, you'll need to install the [billing Command Set](https://github.com/nimbella/command-sets). Command Sets are a packaging specification for Slack commands, and a convenient way to share commands via GitHub or open source. Command Sets are installed into your Slack teams via the Nimbella Commander by typing the command /nc csm_install billing in your Slack prompt.

    ![Datadog billing info for Slack. Datadog apiKey and ApplicationKey](https://miro.medium.com/max/561/0*6RMVv0V15PejGTIr)


4. Next we need to bind some secrets to the billing commands. Specifically, the API keys you generated earlier for the Datadog API will be encrypted (outside of Slack) and attached to the slash command. To do this, type /nc secret_create to bring up the Nimbella Secret Creator. We're creating the secrets outside of Slack so that Slack will only see encrypted strings and not your API keys. When you run the secrets command, you will see an output that looks like this:

    ![What our website looks like when you want to download Commander to Slack for Datadog billing information](https://miro.medium.com/max/670/0*WIgVRs9mv63kct1y)

5. Click on the Secret Creator link to be redirected to the page which encrypts your API keys.

    ![Add default app to Commander. Datadog will need it to display billing information](https://miro.medium.com/max/700/1*7LM4wD6FnA7K5s3K_cwS-g.png)


6. Add your Datadog API Key and Application Key from Step 1 to the fields in the Secret Creator as illustrated in the following figure. Next, click the "Make Secrets" button to generate the commands you'll need to copy and paste into your Slack prompt.

    ![Datadog secret creator for devops datadogApiKey ApplicationKey](https://miro.medium.com/max/696/1*yBynU32l_Ze3vRJP7k_tuA.png)

7. After clicking the "Make Secrets" button, the commands you'll need to run on your Slack page will appear. Copy each command one at a time and paste them into Slack. This will take your API Key and Application Key and apply them.

    ![Datadog secret creator devops ApiKey and ApplicationKey](https://miro.medium.com/max/701/1*LXW4CW4GLwT7WEkOTdIfDA.png)

8. Finally, run the built-in command /nc datadogbill to see your Datadog billing info.

    ![An example of Datadog billing information for Slack. Created by Nimbella](https://miro.medium.com/max/674/1*mq4jN70odSQ4yMAx8FA8Lw.png)

9. To see more details about your bill, try /nc datadogbill -detail

    ![Datadog billing info for devops. Shows more details about your bill and upcoming bill on Slack](https://miro.medium.com/max/636/1*KUDwMwqGFrIr1ahhV5yZOQ.png)

10. You likely don't want everyone in your Slack team to run this command. Nimbella Commander offers a neat feature to allow only certain users to run specific commands. For example, you can restrict access to the Datadog billing command to specific users using /nc command_runners datadogbill + @user1 + @user2, substituting for "user1" and "user2" the Slack names of your teammates that should have access to the Datadog billing details.

    ![Datadog billing info for Slack. Select which users can access billing information](https://miro.medium.com/max/639/0*k65tZOEHbpwOnWff)

11. It's worth also mentioning that you have access to an audit trail to see who's run your commands. This is useful for administrators and team oversight where appropriate. Type /nc command_log datadogbill

     ![Datadog billing info for Slack. Shows command log of who ran the command on Slack for Datadog billing info.](https://miro.medium.com/max/651/1*l9Yva9rLt-Npzky-5C8-tw.png)

Using Nimbella's access control you can also limit who can view and edit the code that implements a particular command as well. The built-in Secret Creator means your sensitive data remains outside of Slack and accessible only to the code you run. And with Audit Logs, you have accountability and historical data readily available at your fingertips. These are powerful features of the Commander that don't exist in Slack otherwise. For more information about Commander, [visit our website](https://nimbella.com/product/commander). We'd also love to hear from you via our community [Slack channel](https://app.slack.com/client/TL64TJWVB/CQE95GHB4) or on [GitHub](https://github.com/nimbella/command-sets).

If you wish to add Commander to your Slack account, [click this link to get started today](https://nimbella-community.slack.com/apps/AS833QXL0-nimbella-commander?next_id=0)

Video tutorial on how to get your Datadog billing info in Slack with Nimbella Commander:

{% youtube T-7qQU9iIgo %}