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

status.cocoapods.org #25

Closed
10 tasks
orta opened this issue Jan 27, 2014 · 7 comments
Closed
10 tasks

status.cocoapods.org #25

orta opened this issue Jan 27, 2014 · 7 comments

Comments

@orta
Copy link
Owner

orta commented Jan 27, 2014

A simple appfog/dotcoud app that receives pings from some cocoapods components and has a js page that does a look at whether things are up or not.

Requires:

  • adding a DB for storing the last

externals

  • adding a status command to search
  • adding a status command to trunk
  • adding a status command to cocoadocs

internals

  • receives a ping for when cocoadocs last updated
  • receives a ping for when search last updated
  • receives a ping for when trunk last updated

web page

  • JS check that heroku is up ( trunk / search )
  • JS check that AWS is up ( cocoadocs files )
  • JS check that github pages are up ( blog / cocoadocs.org / guides )
@orta
Copy link
Owner Author

orta commented Jan 27, 2014

Prototype it in https://app.ducksboard.com/ and see if that will deal with being the server.

@orta
Copy link
Owner Author

orta commented Jan 30, 2014

https://www.statuspage.io offered us a free account

@kylef
Copy link

kylef commented Feb 19, 2014

I've just had a look around with StatusPage and it looks like a nice and flexible system. However we will also need a secondary "provider" to tie into StatusPage to provide metrics.

They support the following:

  • Pingdom
  • Librato
  • New Relic - Have a free tier with low data retention (not sure what that means for us, I think that's fine since status page are retaining the data).
  • TempoDB
  • Datadog (they have a free tier for up to 5 hosts)

We can use "subscribers" to give us campfire notifications when something is down.

There is an API, however I can't determine if it let's us view a public status without authentication for use in the command line status. I've tweeted them and will update when I find out.

Custom metrics

We can also manually add metrics from code (example in Ruby). This means that trunk/search/cocoadocs can actually send data in such as the following metrics:

  • CocoaDocs: Docset generations
  • Trunk imports
  • Search: Count of indexed pod's

Here are the rules for metrics:

  • At minimum, one data point must be submitted every 5 minutes. If there is a lag in data, the gap will be reflected on the charts for the "Day" view.
  • Each data point is cast to its nearest 30s interval, giving us a maximum of 10 data points per 5 minute period. Submitting multiple data points near each other will result in the last data point being the only one stored.
  • Data can, and should, be backfilled up to 28 days in the past.

Example code in Ruby for sending a metric

require 'rubygems'
require 'httparty'

# the following 4 are the actual values that pertain to your account and this specific metric
api_key = 'REDCATED'
page_id = 'REDCATED'
metric_id = 'REDCATED'
api_base = 'https://api.statuspage.io/v1'

# need at least 1 data point for every 5 minutes
# submit random data for the whole day
total_points = (60 / 5 * 24)
total_points.times.each do |i|
  dhash = {
    :timestamp => Time.now.to_i - i * 5 * 60,
    :value => rand(100)
  }

  HTTParty.post(
    "#{api_base}/pages/#{page_id}/metrics/#{metric_id}/data.json", 
    :headers => {
      'Authorization' => "OAuth #{api_key}",
    },
    :body => {
      :data => dhash
    }
  )

  puts "Submitted point #{i+1} of #{total_points}"
end

Documentation: http://doers.statuspage.io/api/v1/metrics/

@kylef
Copy link

kylef commented Feb 19, 2014

"Unofficial" way to view status page is the /index.json. This could be something we can pull from the pod command. Example: http://status.travis-ci.com/index.json

There sure is. adding /index.json to the end of any status page is our "unofficial" way right now but will give component status
If you're a customer, we provide an embedded javascript file you can use to show your status in a web app

https://twitter.com/statuspageio/status/436146802132537344
https://twitter.com/statuspageio/status/436147190135001089

@floere
Copy link

floere commented Feb 19, 2014

@kylef Can they also pull a metric?

@kylef
Copy link

kylef commented Feb 20, 2014

@floere I can't find any API/method for setting that up, I think it's push only.

@orta orta added the CocoaPods label Apr 3, 2014
@orta
Copy link
Owner Author

orta commented Jul 13, 2015

This now exists 👍

@orta orta closed this as completed Jul 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants