Mailgun

Overview

Mailgun is an API-based email delivery platform that allows you to:

  • Build and manage large-scale email marking applications.
  • Send and track transactional messages.
  • Remove invalid email addresses from your list.
  • Improve your deliverability and drive higher conversion rates.

Integrate with Datadog to collect email delivery and engagement metrics and logs to track the performance of your Mailgun services.

Setup

Add and verify domain

  1. Log in to your Mailgun account.
  2. In the sidebar on the left, click Sending. The menu expands. Select Domains.
  3. Click Add New Domain at the top right.
  4. Enter your Domain name and region and click Add Domain.
  5. Verify your domain by following the instructions in the Mailgun documentation.

View Mailgun API key

When you sign up for Mailgun, a primary account API key is created for you. This key allows you to perform all CRUD operations through our various API endpoints and for any of your sending domains.

  1. Log in to your Mailgun account.
  2. Click your name on the top right, and open the dropdown.
  3. Click API Keys.
  4. Click the eye icon next to Private API Key.

Enable metrics collection

  1. Navigate to the configuration tab inside the Datadog Mailgun integration tile.
  2. Enter your domain name and the region for your domain.
  3. Paste in the API Key found in the steps above.
  4. Optionally, add custom tags to associate tags with all metrics collected for this integration.

Enable logs collection

You may configure Mailgun to forward events as logs to Datadog. See the section Tracking Messages - Webhooks in the Mailgun documentation for more details.

  1. Copy the generated URL from the instructions on the Mailgun integration tile.
  2. Log in to your Mailgun account.
  3. Click Sending in the left side column.
  4. Click Webhooks in the dropdown.
  5. Click Add webhook in the top right corner.
  6. Select the Event type you want to track.
  7. Paste in the generated URL in step 1 under URL.
  8. Click Create Webhook.

Data Collected

Metrics

mailgun.emails.accepted.total
(count)
Total number of emails accepted including both incoming and outgoing
Shown as email
mailgun.emails.accepted.incoming
(count)
Number of incoming emails accepted
Shown as email
mailgun.emails.accepted.outgoing
(count)
Number of outgoing emails accepted
Shown as email
mailgun.emails.delivered.total
(count)
Total number of emails sent and accepted by recipient email server
Shown as email
mailgun.emails.delivered.smtp
(count)
Number of SMTP emails sent and accepted by recipient email server
Shown as email
mailgun.emails.delivered.http
(count)
Number of HTTP emails sent and accepted by recipient email server
Shown as email
mailgun.emails.delivered.optimized
(count)
Number of Send Time Optimization emails sent and accepted by recipient email server
Shown as email
mailgun.emails.failed.temporary.total
(count)
Number of emails that temporarily failed to be delivered to recipient email server
Shown as email
mailgun.emails.failed.temporary.espblock
(count)
Number of emails that were blocked by the email service provider
Shown as email
mailgun.emails.failed.permanent.total
(count)
Number of emails that permanently failed to be delivered to recipient email server
Shown as email
mailgun.emails.failed.permanent.suppress_bounce
(count)
Number of emails that were dropped due to a previous bounce
Shown as email
mailgun.emails.failed.permanent.suppress_unsubscribe
(count)
Number of emails that were dropped due to a previous unsubscribe
Shown as email
mailgun.emails.failed.permanent.suppress_complaint
(count)
Number of emails that were dropped due to a previous complaint
Shown as email
mailgun.emails.failed.permanent.bounce
(count)
Number of emails that were bounced instead of delivered
Shown as email
mailgun.emails.failed.permanent.delayed_bounce
(count)
Number of emails that were bounced after a delay
Shown as email
mailgun.emails.failed.permanent.webhook
(count)
Number of webhook requests failed
Shown as request
mailgun.emails.failed.permanent.optimized
(count)
Number of Send Time Optimization emails failed
Shown as email
mailgun.emails.opened.total
(count)
Total number of times emails were opened by recipients
Shown as email
mailgun.emails.clicked.total
(count)
Number of times links were clicked in the emails
Shown as email
mailgun.emails.unsubscribed.total
(count)
Number of recipients who unsubscribed
Shown as email
mailgun.emails.complained.total
(count)
Number of recipients who complained
Shown as email
mailgun.emails.stored.total
(count)
Number of stored incoming messages
Shown as email
mailgun.emails.hourly.accepted.total
(count)
Total hourly number of emails accepted including both incoming and outgoing
Shown as email
mailgun.emails.hourly.accepted.incoming
(count)
Hourly number of incoming emails accepted
Shown as email
mailgun.emails.hourly.accepted.outgoing
(count)
Hourly number of outgoing emails accepted
Shown as email
mailgun.emails.hourly.delivered.total
(count)
Total hourly number of emails sent and accepted by recipient email server
Shown as email
mailgun.emails.hourly.delivered.smtp
(count)
Hourly number of SMTP emails sent and accepted by recipient email server
Shown as email
mailgun.emails.hourly.delivered.http
(count)
Hourly number of HTTP emails sent and accepted by recipient email server
Shown as email
mailgun.emails.hourly.delivered.optimized
(count)
Hourly number of Send Time Optimization emails sent and accepted by recipient email server
Shown as email
mailgun.emails.hourly.failed.temporary.total
(count)
Hourly number of emails that temporarily failed to be delivered to recipient email server
Shown as email
mailgun.emails.hourly.failed.temporary.espblock
(count)
Hourly number of emails that were blocked by the email service provider
Shown as email
mailgun.emails.hourly.failed.permanent.total
(count)
Hourly number of emails that permanently failed to be delivered to recipient email server
Shown as email
mailgun.emails.hourly.failed.permanent.suppress_bounce
(count)
Hourly number of emails that were dropped due to a previous bounce
Shown as email
mailgun.emails.hourly.failed.permanent.suppress_unsubscribe
(count)
Hourly number of emails that were dropped due to a previous unsubscribe
Shown as email
mailgun.emails.hourly.failed.permanent.suppress_complaint
(count)
Hourly number of emails that were dropped due to a previous complaint
Shown as email
mailgun.emails.hourly.failed.permanent.bounce
(count)
Hourly number of emails that were bounced instead of delivered
Shown as email
mailgun.emails.hourly.failed.permanent.delayed_bounce
(count)
Hourly number of emails that were bounced after a delay
Shown as email
mailgun.emails.hourly.failed.permanent.webhook
(count)
Hourly number of webhook requests failed
Shown as request
mailgun.emails.hourly.failed.permanent.optimized
(count)
Hourly number of Send Time Optimization emails failed
Shown as email
mailgun.emails.hourly.opened.total
(count)
Total hourly number of times emails were opened by recipients
Shown as email
mailgun.emails.hourly.clicked.total
(count)
Hourly number of times links were clicked in the emails
Shown as email
mailgun.emails.hourly.unsubscribed.total
(count)
Hourly number of recipients who unsubscribed
Shown as email
mailgun.emails.hourly.complained.total
(count)
Hourly number of recipients who complained
Shown as email
mailgun.emails.hourly.stored.total
(count)
Hourly number of stored incoming messages
Shown as email

Logs

Mailgun events will show up as logs under the source mailgun.

Events

The Mailgun integration does not include any events.

Service Checks

The Mailgun integration does not include any service checks.

Troubleshooting

Need help? Contact Datadog support.