Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Mackerel standard
@a_know
Mackerel User Group Meeting Vol.1, 2016/6/14 1
Who am I ?
• @a_know / id:a-know / /
• a-know.me
•
• Rails
•
• Chef, serverspec / GCP / Team Building
Mackerel User Group ...
Mackerel User Group Meeting Vol.1, 2016/6/14 3
Mackerel
Mackerel User Group Meeting Vol.1, 2016/6/14 4
• ...
• A Mackerel
• B fluent-plugin-mackerel
• C
• D
Mackerel User Group Meeting Vol.1, 2016/6/14 5
Mackerel User Group Meeting Vol.1, 2016/6/14 6
Mackerel User Group Meeting Vol.1, 2016/6/14 7
... !
Mackerel User Group Meeting Vol.1, 2016/6/14 8
a-know.me
Mackerel User Group Meeting Vol.1, 2016/6/14 9
!
¥ 1,800 / month
Mackerel User Group Meeting Vol.1, 2016/6/14 10
≧
Mackerel User Group Meeting Vol.1, 2016/6/14 11
Mackerel
Mackerel User Group Meeting Vol.1, 2016/6/14 12
Mackerel
•
• fluent-plugin-mackerel
•
•
•
Mackerel User Group Meeting Vol.1, 2016/6/14 13
Mackerel User Group Meeting Vol.1, 2016/6/14 14
Mackerel
Mackerel User Group Meeting Vol.1, 2016/6/14 15
Dashing
• Dashing plugin widget
Mackerel User Group Meeting Vol.1, 2016/6/14 16
Mackerel User Group Meeting Vol.1, 2016/6/14 17
• https://github.com/Shopify/dashing/wiki/Additional-
Widgets
Mackerel User Group Meeting Vol.1, 2016/6/14 18
• Dashing widget Ruby
• fitbit Widget
• Google Analytics visitor count widget
• 1 widget
• Mackerel
• Web API
Mackerel User...
Mackerel User Group Meeting Vol.1, 2016/6/14 20
• fitgem gem
fitbit = Fitbit.new unit_system: 'METRIC'
fluent_logger('a-know-metricks')
.post('activity', { todays_steps: ...
• td-agent.conf
<match a-know-metricks.activity.**>
type mackerel
api_key <%= @mackerel_api_key %>
service <%= @mackerel_s...
Mackerel User Group Meeting Vol.1, 2016/6/14 23
Mackerel User Group Meeting Vol.1, 2016/6/14 24
• google-api-client gem
client = Google::APIClient.new(appinfo_hash)
client.authorization = Signet::OAuth2::Client.new(cre...
• td-agent.conf
<match blog-metricks.active-visitors.**>
type mackerel
api_key <%= @mackerel_api_key %>
service <%= @macke...
Mackerel User Group Meeting Vol.1, 2016/6/14 27
Mackerel User Group Meeting Vol.1, 2016/6/14 28
!
Mackerel User Group Meeting Vol.1, 2016/6/14 29
wkwk ...
Mackerel User Group Meeting Vol.1, 2016/6/14 30
Mackerel
•
• fluent-plugin-mackerel
•
• a-know
•
Mackerel User Group Meeting Vol.1, 2016/6/14 31
(?)
...
Mackerel User Group Meeting Vol.1, 2016/6/14 32
Mackerel User Group Meeting Vol.1, 2016/6/14 33
• API
• standard (?)
• a-know.me https
•
Mackerel User Group Meeting Vol.1, 2016/6/14 34
!
Mackerel User Group Meeting Vol.1, 2016/6/14 35
API
Mackerel User Group Meeting Vol.1, 2016/6/14 36
API
Mackerel User Group Meeting Vol.1, 2016/6/14 37
Mackerel User Group Meeting Vol.1, 2016/6/14 38
nginx
location ~ /(blog_metricks|a_know_metricks)/.+ {
allow 59.106.108.64/26;
deny all;
try_files $uri @unicorn;
}
Macker...
...
Mackerel User Group Meeting Vol.1, 2016/6/14 40
End ✋
• http://goo.gl/fLWGhp
Mackerel User Group Meeting Vol.1, 2016/6/14 41
Upcoming SlideShare
Loading in …5
×

Mackerel の standard プランを個人利用している話

2,604 views

Published on

Mackerel User Group Meeting Vol.1 LT 資料です!

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Mackerel の standard プランを個人利用している話

  1. 1. Mackerel standard @a_know Mackerel User Group Meeting Vol.1, 2016/6/14 1
  2. 2. Who am I ? • @a_know / id:a-know / / • a-know.me • • Rails • • Chef, serverspec / GCP / Team Building Mackerel User Group Meeting Vol.1, 2016/6/14 2
  3. 3. Mackerel User Group Meeting Vol.1, 2016/6/14 3
  4. 4. Mackerel Mackerel User Group Meeting Vol.1, 2016/6/14 4
  5. 5. • ... • A Mackerel • B fluent-plugin-mackerel • C • D Mackerel User Group Meeting Vol.1, 2016/6/14 5
  6. 6. Mackerel User Group Meeting Vol.1, 2016/6/14 6
  7. 7. Mackerel User Group Meeting Vol.1, 2016/6/14 7
  8. 8. ... ! Mackerel User Group Meeting Vol.1, 2016/6/14 8
  9. 9. a-know.me Mackerel User Group Meeting Vol.1, 2016/6/14 9
  10. 10. ! ¥ 1,800 / month Mackerel User Group Meeting Vol.1, 2016/6/14 10
  11. 11. ≧ Mackerel User Group Meeting Vol.1, 2016/6/14 11
  12. 12. Mackerel Mackerel User Group Meeting Vol.1, 2016/6/14 12
  13. 13. Mackerel • • fluent-plugin-mackerel • • • Mackerel User Group Meeting Vol.1, 2016/6/14 13
  14. 14. Mackerel User Group Meeting Vol.1, 2016/6/14 14
  15. 15. Mackerel Mackerel User Group Meeting Vol.1, 2016/6/14 15
  16. 16. Dashing • Dashing plugin widget Mackerel User Group Meeting Vol.1, 2016/6/14 16
  17. 17. Mackerel User Group Meeting Vol.1, 2016/6/14 17
  18. 18. • https://github.com/Shopify/dashing/wiki/Additional- Widgets Mackerel User Group Meeting Vol.1, 2016/6/14 18
  19. 19. • Dashing widget Ruby • fitbit Widget • Google Analytics visitor count widget • 1 widget • Mackerel • Web API Mackerel User Group Meeting Vol.1, 2016/6/14 19
  20. 20. Mackerel User Group Meeting Vol.1, 2016/6/14 20
  21. 21. • fitgem gem fitbit = Fitbit.new unit_system: 'METRIC' fluent_logger('a-know-metricks') .post('activity', { todays_steps: fitbit.todays_steps }) Mackerel User Group Meeting Vol.1, 2016/6/14 21
  22. 22. • td-agent.conf <match a-know-metricks.activity.**> type mackerel api_key <%= @mackerel_api_key %> service <%= @mackerel_service_name %> metrics_name a-know-metricks-activity.todays_steps out_keys todays_steps </match> Mackerel User Group Meeting Vol.1, 2016/6/14 22
  23. 23. Mackerel User Group Meeting Vol.1, 2016/6/14 23
  24. 24. Mackerel User Group Meeting Vol.1, 2016/6/14 24
  25. 25. • google-api-client gem client = Google::APIClient.new(appinfo_hash) client.authorization = Signet::OAuth2::Client.new(credentials_hash) client.authorization.fetch_access_token! analytics = client.discovered_api('analytics','v3') # Execute the query, get the value `[["1"]]` response = client.execute(api_method: analytics.data.realtime.get, parameters: { ids: "ga:" + profile_id, metrics: "ga:activeVisitors", }).data.rows.flatten number = response.empty? ? 0 : response.first.to_i fluent_logger('blog-metricks') .post('active-visitors', { number: number }) Mackerel User Group Meeting Vol.1, 2016/6/14 25
  26. 26. • td-agent.conf <match blog-metricks.active-visitors.**> type mackerel api_key <%= @mackerel_api_key %> service <%= @mackerel_service_name %> metrics_name blog-metricks-active-visitors.number out_keys number </match> Mackerel User Group Meeting Vol.1, 2016/6/14 26
  27. 27. Mackerel User Group Meeting Vol.1, 2016/6/14 27
  28. 28. Mackerel User Group Meeting Vol.1, 2016/6/14 28
  29. 29. ! Mackerel User Group Meeting Vol.1, 2016/6/14 29
  30. 30. wkwk ... Mackerel User Group Meeting Vol.1, 2016/6/14 30
  31. 31. Mackerel • • fluent-plugin-mackerel • • a-know • Mackerel User Group Meeting Vol.1, 2016/6/14 31
  32. 32. (?) ... Mackerel User Group Meeting Vol.1, 2016/6/14 32
  33. 33. Mackerel User Group Meeting Vol.1, 2016/6/14 33
  34. 34. • API • standard (?) • a-know.me https • Mackerel User Group Meeting Vol.1, 2016/6/14 34
  35. 35. ! Mackerel User Group Meeting Vol.1, 2016/6/14 35
  36. 36. API Mackerel User Group Meeting Vol.1, 2016/6/14 36
  37. 37. API Mackerel User Group Meeting Vol.1, 2016/6/14 37
  38. 38. Mackerel User Group Meeting Vol.1, 2016/6/14 38
  39. 39. nginx location ~ /(blog_metricks|a_know_metricks)/.+ { allow 59.106.108.64/26; deny all; try_files $uri @unicorn; } Mackerel User Group Meeting Vol.1, 2016/6/14 39
  40. 40. ... Mackerel User Group Meeting Vol.1, 2016/6/14 40
  41. 41. End ✋ • http://goo.gl/fLWGhp Mackerel User Group Meeting Vol.1, 2016/6/14 41

×