Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

Configuring Log Drains on Gatsby Cloud

Introduction

Gatsby Cloud can deliver hosting logs to the 3rd party services (currently only DataDog), which allows developers and marketers to review server side analytics, and accelerate the troubleshooting process when hosting layer errors occur.

Prerequisites

  • The Log Drains feature is limited to enterprise plans in Gatsby Cloud, therefore this feature will only appear within site settings for sites within enterprise plans.
  • You must have an account with DataDog. Currently, Gatsby Cloud only supports integration with DataDog, but will introduce additional logging targets based on customer demand in the future.

Directions

Enable log drains

  1. Log in to your DataDog account

  2. Add a new API Key, giving it a name that will help you remember that this key is used for receiving logs from Gatsby Cloud.

    Notes:

    • If you’re enabling Log Drains for multiple Gatsby Cloud sites, we recommend that you create a separate API Key for each Gatsby Cloud site.
    • Be sure you create an API Key in DataDog, not an Application Key.
      Be sure to create an API Key, not an Application Key
  3. Copy the newly-created API Key

  4. Take note of the region (“SITE” in DataDog terminology) for your DataDog account.

    Note: Your DataDog region may appear as the subdomain when logged into DataDog

  5. Log in to Gatsby Cloud

  6. Select the site whose logs you’d like to integrate with DataDog

  7. Access “Site Settings” for that site

  8. Select “Log Drains” in the left navigation
    Log Drains Navigation Item

    Note: If you do not see Log Drains, then the selected site is not likely within an enterprise plan. Contact us if you have any questions.

  9. Click Connect
    Click Connect to configure log drains

  10. Select the appropriate region for your DataDog instance
    Select the appropriate region

  11. In DataDog, this is the value for Site

  12. Enter the API Key you created in DataDog from step 3
    Add your Log Analytics service's API Key

  13. Click Connect

  14. You will see a confirmation that DataDog is now connected
    Connected confirmation message

  15. View the Live Tail for this Gatsby site’s logs in your DataDog account to confirm that you’re now receiving logs from Gatsby Cloud

    Note: It can take up to 10 minutes for your initial set of logs to appear

Modify log drains

  1. Access your site’s “Site Settings” in Gatsby Cloud
  2. Navigate to “Log Drains” in the left-hand navigation
  3. Click the ellipsis for Log Drains to expose the actions menu
  4. Click Edit
  5. Update the settings accordingly
  6. Click Save

Disconnect log drains

  1. Access your site’s “Site Settings” in Gatsby Cloud
  2. Navigate to “Log Drains” in the left-hand navigation
  3. Click the ellipsis for Log Drains to expose the actions menu
  4. Click Delete
  5. Confirm Deletion of this configuration
  6. Confirm that you are no longer receiving logs for this site via Live Tail in DataDog

Troubleshooting

  • After selecting the region and specifying my API Key, I receive an error upon clicking Connect from Gatsby Cloud
    • Confirm that you’ve entered the DataDog API Key properly
    • Confirm that you’ve selected the appropriate Region in Step 10
    • If all of these are correct, please Contact us
  • It’s been more than 10 minutes, and I still don’t see any logs in DataDog. What now?
    • Confirm that the corresponding site in Gatsby Cloud has indeed received visitor traffic historically
    • Visit the corresponding site in Gatsby Cloud yourself to ensure activities within the next drain interval and wait another 10 minutes to confirm events via Live Tail
    • If you still see no traffic in DataDog Live Tail, please Contact us

Start building today on Netlify!
Edit this page on GitHub
© 2023 Gatsby, Inc.