Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailchimp report plugin #408

Merged
merged 2 commits into from
Dec 4, 2015
Merged

Mailchimp report plugin #408

merged 2 commits into from
Dec 4, 2015

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Dec 2, 2015

No description provided.

@sparrc sparrc force-pushed the mailchimp branch 4 times, most recently from 5238885 to ecb60c1 Compare December 3, 2015 00:33
@sparrc
Copy link
Contributor Author

sparrc commented Dec 3, 2015

cc @toddboom @pauldix MailChimp plugin is ready to review

I know it's a pretty big chunk of code, the basic config would look like this:

# Gathers metrics from the /3.0/reports MailChimp API
[[plugins.mailchimp]]
  # MailChimp API key
  # get from https://admin.mailchimp.com/account/api/
  api_key = "jibberjabber-us5" # required
  # Reports for campaigns sent more than days_old ago will not be collected.
  # 0 means collect all.
  days_old = 0
  # Campaign ID to get, if empty gets all campaigns, this option overrides days_old
  campaign_id = ""

and output:

% ./telegraf -config ~/ws/telegraf.conf -filter mailchimp -test
* Plugin: mailchimp, Collection 1
> mailchimp_emails_sent,campaign_title=MyCampaign,id=wsws1099 value=7640i 1449103122757261374
> mailchimp_abuse_reports,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_unsubscribed,campaign_title=MyCampaign,id=wsws1099 value=38i 1449103122757261374
> mailchimp_hard_bounces,campaign_title=MyCampaign,id=wsws1099 value=38i 1449103122757261374
> mailchimp_soft_bounces,campaign_title=MyCampaign,id=wsws1099 value=71i 1449103122757261374
> mailchimp_syntax_errors,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_forwards_count,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_forwards_opens,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_opens_total,campaign_title=MyCampaign,id=wsws1099 value=5046i 1449103122757261374
> mailchimp_unique_opens,campaign_title=MyCampaign,id=wsws1099 value=2481i 1449103122757261374
> mailchimp_open_rate,campaign_title=MyCampaign,id=wsws1099 value=0.32943832160404 1449103122757261374
> mailchimp_clicks_total,campaign_title=MyCampaign,id=wsws1099 value=2378i 1449103122757261374
> mailchimp_unique_clicks,campaign_title=MyCampaign,id=wsws1099 value=2100i 1449103122757261374
> mailchimp_unique_subscriber_clicks,campaign_title=MyCampaign,id=wsws1099 value=1315i 1449103122757261374
> mailchimp_click_rate,campaign_title=MyCampaign,id=wsws1099 value=0.17461160536449 1449103122757261374
> mailchimp_facebook_recipient_likes,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_facebook_unique_likes,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_facebook_likes,campaign_title=MyCampaign,id=wsws1099 value=0i 1449103122757261374
> mailchimp_industry_type,campaign_title=MyCampaign,id=wsws1099 value="Software and Web App" 1449103122757261374
> mailchimp_industry_open_rate,campaign_title=MyCampaign,id=wsws1099 value=0.16632430472492 1449103122757261374
> mailchimp_industry_click_rate,campaign_title=MyCampaign,id=wsws1099 value=0.018585169046043 1449103122757261374
> mailchimp_industry_bounce_rate,campaign_title=MyCampaign,id=wsws1099 value=0.016308790373528 1449103122757261374
> mailchimp_industry_unopen_rate,campaign_title=MyCampaign,id=wsws1099 value=0.81736690490155 1449103122757261374
> mailchimp_industry_unsub_rate,campaign_title=MyCampaign,id=wsws1099 value=0.0033967213702405 1449103122757261374
> mailchimp_industry_abuse_rate,campaign_title=MyCampaign,id=wsws1099 value=0.000299620377739 1449103122757261374
> mailchimp_list_stats_sub_rate,campaign_title=MyCampaign,id=wsws1099 value=1 1449103122757261374
> mailchimp_list_stats_unsub_rate,campaign_title=MyCampaign,id=wsws1099 value=52 1449103122757261374
> mailchimp_list_stats_open_rate,campaign_title=MyCampaign,id=wsws1099 value=40.490336679642 1449103122757261374
> mailchimp_list_stats_click_rate,campaign_title=MyCampaign,id=wsws1099 value=16.99382673233 1449103122757261374

So let me know if there's something else you'd like to see!

@sparrc sparrc changed the title [WIP] Mailchimp report plugin Mailchimp report plugin Dec 3, 2015
@sparrc sparrc force-pushed the mailchimp branch 5 times, most recently from 377e8e9 to cc5281c Compare December 4, 2015 16:46
@sparrc sparrc merged commit 9999b2e into master Dec 4, 2015
@sparrc sparrc deleted the mailchimp branch December 4, 2015 20:58
@pauldix
Copy link
Member

pauldix commented Dec 4, 2015

does it keep an internal state about the last time it grabbed data? For instance, if you set days_old to 30, will it request 30 days of data every time or will it request 30 the first time and then only 1 day after that while Telegraf is still running?

@sparrc
Copy link
Contributor Author

sparrc commented Dec 4, 2015

@pauldix Nope, it will always request days_old from time.Now()

@sparrc
Copy link
Contributor Author

sparrc commented Dec 4, 2015

Where time.Now gets updated at each collection

@pauldix
Copy link
Member

pauldix commented Dec 4, 2015

Ok. Would be nice to have the ability to just call Telegraf from the command line to do a single historic collection.

Rewriting 30 day old data on every collection is likely to cause bad performance problems inside InfluxDB

On Dec 4, 2015, at 5:11 PM, Cameron Sparr notifications@github.com wrote:

Where time.Now gets updated at each collection


Reply to this email directly or view it on GitHub.

@sparrc
Copy link
Contributor Author

sparrc commented Dec 4, 2015

@pauldix It won't be overwriting data, it grabs data from the API and puts a timestamp of time.Now(). A lot of the metrics will probably flatline fairly quickly, which is why I put the days_old parameter

@pauldix
Copy link
Member

pauldix commented Dec 5, 2015

Wait, it grabs the same data over and over again, but puts a time.Now() on
it? I guess I'm not getting what that option does because that sounds like
you'd be duplicating data all the time.

On Fri, Dec 4, 2015 at 6:45 PM, Cameron Sparr notifications@github.com
wrote:

@pauldix https://github.com/pauldix It won't be overwriting data, it
grabs data from the API and puts a timestamp of time.Now(). A lot of the
metrics will probably flatline fairly quickly, which is why I put the
days_old parameter


Reply to this email directly or view it on GitHub
#408 (comment).

@sparrc
Copy link
Contributor Author

sparrc commented Dec 7, 2015

I would think that the data would change, but it's grabbing the same metric over and over, (facebook_likes, for example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants