Slide 1

Slide 1 text

࠷ۙ Mackerel Ͱ ΍ͬͨ͜ͱ 2017.04.27 Mackerel Meetup #10 Hidekazu Tanaka

Slide 2

Slide 2 text

ࣗݾ঺հ • ాதल࿨ • φϏϓϥεגࣜձࣾαʔϏε౷ׅ෦ • ԼهαʔϏεͷ։ൃɾӡ༻ɾอक୲౰ • NaviPlus Ϩίϝϯυ • NaviPlus ϨϏϡʔ

Slide 3

Slide 3 text

ࣗݾ঺հ • ࡞੒ͨ͠ Mackerel ϓϥάΠϯ • mackerel-plugin-aws-waf • mackerel-plugin-aws-rekognition • mackerel-plugin-aws-kinesis-firehose

Slide 4

Slide 4 text

Mackerel ͱ͍͑͹

Slide 5

Slide 5 text

៉ྷͳάϥϑ

Slide 6

Slide 6 text

៉ྷͳάϥϑͰ

Slide 7

Slide 7 text

͍Ζ͍Ζͳ΋ͷΛՄࢹԽʂ

Slide 8

Slide 8 text

ՄࢹԽͨ͠΋ͷ • υϧԁͷϨʔτ • iPhone ͷϔϧεέΞσʔλ

Slide 9

Slide 9 text

υϧԁͷϨʔτ

Slide 10

Slide 10 text

खॱ 1. Yahoo Finance ͔ΒυϧԁͷϨʔτΛऔಘ 2. Mackerel ʹαʔϏεϝτϦοΫͱͯ͠౤ߘ

Slide 11

Slide 11 text

ίʔυ #!/usr/bin/env ruby require 'mackerel' require 'yahoo-finance' MACKEREL_API_KEY = '' MACKEREL_SERVICE_NAME = '' yahoo_client = YahooFinance::Client.new data = yahoo_client.quote('USDJPY=X', [:ask, :bid, :last_trade_date, :last_trade_time]) time = Time.strptime("#{data.last_trade_date} #{data.last_trade_time} +01:00", '%m/%d/ %Y %H:%M%P %:z') mackerel_client = Mackerel::Client.new(mackerel_api_key: MACKEREL_API_KEY) mackerel_client.post_service_metrics(MACKEREL_SERVICE_NAME, [ { name: 'finance.usdjpy.ask', time: time.to_i, value: data.ask.to_f }, { name: 'finance.usdjpy.bid', time: time.to_i, value: data.bid.to_f } ])

Slide 12

Slide 12 text

ੜ੒͞Εͨάϥϑ

Slide 13

Slide 13 text

iPhone ͷϔϧεέΞσʔλ

Slide 14

Slide 14 text

खॱ 1. ʮHealth ExportʯͰา਺σʔλΛ CSV Խ 2. CSV Λ iCloud Drive Ͱ macOS ʹసૹ 3. macOS Ͱ CSV Λϩʔυ 4. Mackerel ʹαʔϏεϝτϦοΫͱͯ͠౤ߘ

Slide 15

Slide 15 text

ίʔυ #!/usr/bin/env ruby require 'csv' require 'mackerel' MACKEREL_API_KEY = '' MACKEREL_SERVICE_NAME = '' metrics = [] CSV.foreach('./iphone_steps_date.csv', headers: true) do |row| metrics << { name: 'iphone.healthcare.steps', time: Time.strptime(row['time'], '%Y/%m/%d %H:%M').to_i, value: row['steps'].to_f } end Mackerel::Client.new(mackerel_api_key: MACKEREL_API_KEY).post_service_metrics(MACKEREL_SERVICE_NAME, metrics)

Slide 16

Slide 16 text

ੜ੒͞Εͨάϥϑ

Slide 17

Slide 17 text

·ͱΊ

Slide 18

Slide 18 text

ՄࢹԽͨ͠΋ͷ • υϧԁͷϨʔτ • iPhone ͷϔϧεέΞσʔλ

Slide 19

Slide 19 text

ՄࢹԽ͍ͨ͠΋ͷ • Sentry ͷΠϕϯτൃੜ݅਺