Mitch Seaman
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Datadog data source for Grafana The Datadog data source for Grafana allows you to query and visualize Datadog metrics from within Grafana. ## Requirements The Datadog data source has the following requirements: * Grafana Enterprise with a valid license. Refer to [Activate an Enterprise license](https://grafana.com/docs/grafana/latest/enterprise/activate-license/). * Grafana user with a server or organization administrator role. Refer to [Permissions](https://grafana.com/docs/grafana/latest/permissions/). * An active Datadog account. <!-- ???: figure out which permissions are required in Datadog --> ## Known limitations * Although this data source supports metrics from Datadog, it does not support logs, traces, or monitors from Datadog. ## Install the data source plugin To install the data source, refer to [Installation](https://grafana.com/grafana/plugins/grafana-datadog-datasource/?tab=installation). ### Conform to compatibility requirements For this plugin, there are no compatibility requirements. ### Verify that the plugin is installed 1. In Grafana Enterprise from the left-hand menu, navigate to **Configuration** > **Data sources**. 2. From the top-right corner, click the **Add data source** button. 3. Search for `Datadog` in the search field, and hover over the Datadog search result. 5. Click the **Select** button for Datadog. * If you can click the **Select** button, then it is installed. * If the button is missing or disabled, then the plugin is not installed. Check to see if your Grafana Enterprise license is valid, and reinstall the plugin. If you still need help, [contact Grafana Labs](https://grafana.com/contact). > **Note:** On Grafana Cloud, it can take up to 15 minutes to see the data source plugin within Grafana. ## Get an API key and application key from Datadog The following procedure assumes you have installed the Datadog plugin. 1. Go to [https://datadoghq.com](https://datadoghq.com). 2. Set up an API key and copy your application key. 3. Add the API key to the Datadog plugin: a. Navigate to [Integration -> APIs](https://app.datadoghq.com/account/settings#api), enter a unique key name, and click `Create API key`. Get your Application Key by navigate to [Teams -> Application Key](https://app.datadoghq.com/access/application-keys) and copying the desired `KEY ID`. ### Configure the data source To add a new Datadog data source, refer to [Add a data source](https://grafana.com/docs/grafana/latest/datasources/add-a-data-source/), and fill in the following fields: #### Datadog settings | Field | Description | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Name | A name for this particular Datadog data source. | | API URL | URL to the Datadog API. For example, `https://api.datadoghq.com`. | | API Key | [API key from Datadog](#get-api-key-and-application-key-from-datadog). | | APP Key | [Application key from Datadog](#get-api-key-and-application-key-from-datadog). | | Cache Interval | Caching is used to limit the number of API calls. The default cache period is 60 seconds. | | Cache Size | Caching is used to limit the size of API calls. The default cache size is 100 MB. | | Show API rate limits | Show Datadog API limits for each queried endpoint. To view the API rate limits, go to the **JSON** tab > **Query Inspector**, and set **Select source** to `DataFrame structure` | | Enable Basic Auth | Use Basic authentication when calling the API URL. This is useful when using a proxy. | ### Configure the data source with provisioning It is possible to configure data sources using configuration files with Grafana’s provisioning system. To understand how the provisioning system works, including all of the data source settings, refer to [Povisioning Grafana](https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources). Here is a provisioning example for this data source: ```yaml apiVersion: 1 datasources: - name: DATADOG type: grafana-datadog-datasource access: proxy basicAuth: false jsonData: url: https://api.datadoghq.com api_key: API Key app_key: Application Key cacheInterval: 60 cacheSize: 100 logApiRateLimits: false ``` ## Query the data source The query editor allows you to query Datadog, get service-level objectives (SLOs), perform arithmetic, and alias the graph’s legend. ### Query Get metric queries by setting Query type to `Arithmetic`. * Select the metric or click the query edit button to type your metric * Select the aggregation type (default is average) * Optionally select one or more tags if you want to filter results with `From` and `Group By` * Optionally select the functions dropdown to select a Datadog function. These can be reordered and removed by clicking on them and clicking the arrows or x ### Service-level objectives (SLOs) Get SLOs by setting **Query type** to `SLO`. Select an objective from the list. The SLOs are populated from your Datadog account. #### Arithmetic Use metric arithmetic by setting **Query type** to `Arithmetic`. * To perform an arithmetic operation, there must be at least one other query in the query editor. * The supported arithmetic operations are `+`, `-`, `*`, `/`, and `()`. * To refer to a metric, use `#` followed by the query’s name. For example, `#A`. ##### Expression example `#A * 2` doubles the result of query *A*. `#A / #B` divides the results of query *A* by query *B*. ### Aliasing the legend You can use `Alias By` and `Alias RegExp` to change the text in the graph’s legend. For `Alias By`, use plain text, scoped variables listed as follows, or both. | Scoped variables for metics | Replaced with | | --------------------------- | ----------------------------------------------------- | | $__metric | metric name | | $__display_name | metric name | | $__expression | full metric expression | | $__aggr | metric aggregation function (e.g. avg, max, min, sum) | | $__scope | metric scope (e.g. region, site, env, host) | | Scoped variables for (SLOs) | Replaced with | | --------------------------- | ----------------------------------------------------------- | | $__name | name (same as what is selected in the `Objective` dropdown) | | $__aggr | aggregation function (e.g. avg, max, min, sum) | | $__metric | metric name | | $__scope | scope name | | $__numerator | metric used as the numerator in the SLO calculation | | $__denominator | metric used as the denominator in the SLO calculation | To use regular-expression aliasing, fill out `Alias RegExp` with a regular expressions to find matches that are separated by commas. ### Templates and variables To add a new Datadog query variable, refer to [Add a query variable](https://grafana.com/docs/grafana/latest/variables/variable-types/add-query-variable/). Use your Datadog data source as your data source. The following queries are available: | Query | Description | | ------- | ---------------------------------------------- | | * | Fetches the list of available metrics | | tag | Returns all `tag` tags using the value tag | | scope | Returns all `scope` tags using the value scope | | host | Returns all `host` tags | | device | Returns all `device` tags | | env | Returns all `env` tags | | region | Returns all `region` tags | | site | Returns all `site` tags | | status | Returns all `status` tags | | version | Returns all `version` tags | For custom tag groups, enter the tag group name. For example, if your custom tag group name is `subscription_name`, then enter that in the **Query** field. After you create a variable, you can it in your Datadog queries. For more information, refer to [Variable syntax](https://grafana.com/docs/grafana/latest/variables/syntax/). For more information about variables, refer [Templates and variables](https://grafana.com/docs/grafana/latest/variables/). ## Get the most out of the plugin <!-- ??? ---> ### Import a dashboard for Datadog To import a dashboard, refer to [Import a dashboard](https://grafana.com/docs/grafana/latest/dashboards/export-import/#importing-a-dashboard). To find your imported dashboards, go to **Configuration** > **Data sources**. To see the available pre-made dashboards, select the **Datadog** data source, and select the **Dashboards** tab. ### Ad-hoc filters Grafana Enterprise type of template variable called *Ad-hoc filters*, which applies to all the Datadog queries in a dashboard. This filter acts as sa quick filter. An ad-hoc variable for Datadog fetches all the key-value pairs from tags, such as `region:east` or `region:west`, and uses them as query tags. To create this variable, select the **Ad-hoc filters** type and choose your Datadog data source. You can name this variable anything. ## Learn more * Add [Annotations](https://grafana.com/docs/grafana/latest/dashboards/annotations/). * Configure and use [Templates and variables](https://grafana.com/docs/grafana/latest/variables/). * Add [Transformations](https://grafana.com/docs/grafana/latest/panels/transformations/). * Set up alerting; refer to [Alerts overview](https://grafana.com/docs/grafana/latest/alerting/).

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully