├── .gitignore ├── CNAME ├── README.md ├── index.html ├── monitors.json ├── monitors.txt ├── monitors.xml └── monitors.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | monitorstxt.org 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | For info on monitors.txt see http://monitorstxt.org 2 | 3 | Sample formats: 4 | 5 | - Cucumber/Gherkin: http://monitorstxt.org/monitors.txt 6 | - YAML: http://monitorstxt.org/monitors.yml 7 | - JSON: http://monitorstxt.org/monitors.json 8 | - XML: http://monitorstxt.org/monitors.xml 9 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | monitors.txt - lazy web app monitoring 7 | 8 | 75 | 88 | 89 | 90 | 91 |
92 | 93 |

monitors.txt 94 | lazy web app monitoring

95 | 96 |
97 | TL;DR An idea to specify your web app’s monitoring in a plain text file that any 98 | monitoring provider reads at http://yoursite.tld/monitors.txt to setup your monitors.
99 |
100 | 101 |

What is monitors.txt?

102 | 103 |

104 | A text file that lives at www.yoursite.tld/monitors.txt and describes in plain text what monitoring 105 | you want done on your site. 106 |

107 | 108 |

109 | Your monitoring provider regularly reads your monitors.txt file to configure your application’s monitors. Due to the 110 | open nature of monitors.txt, 111 | you’ll be able to quickly switch monitor providers or even add new providers without hassle. 112 |

113 | 114 |

Define monitors where they belong

115 | 116 |

117 | One intention of monitors.txt is to encourage developers to improve monitoring for their web sites by making it easy 118 | to setup new monitors; 119 | I don’t enjoy logging into some monitoring service web app to setup monitors, but I do enjoy writing readable 120 | monitoring tests right there in my code, 121 | where they belong. 122 |

123 | 124 |

What if I want to keep my monitor configuration private?

125 | 126 |

127 | Two ways spring to mind: 128 |

129 |
    130 |
  1. Restrict access to the file so only your monitoring provider can read it

  2. 131 |
  3. For the more gung-ho, obfuscate the URL and use SSL (e.g. https://yoursite.tld/something-unguessable/monitors.txt) 132 | and tell your provider where to find your monitors.txt 133 |
  4. 134 |
135 | 136 |

Show me a sample monitors.txt already

137 | 138 |

139 | Perhaps a service could support multiple formats for monitors.txt: 140 |

141 | 147 | 148 |

Can I start using monitors.txt?

149 | 150 |

151 | If you build it, yep. Sorry, this monitors.txt article is just an idea I had one weekend that I hastily decided to publish. It got some useful feedback on Hacker News if you would like 152 | to read more. 153 |

154 | 155 |

Update, 29th Jan 2013

156 |

157 | I did toy with the idea of providing a service to do this, and produced a prototype that worked with a Cucumber/Gherkin format monitors.txt. However, my monitoring needs and views have evolved since then and I’ve stopped work on it. 158 |

159 | 160 |

Author

161 | 162 |

Eliot Sykes (e -at- jetbootlabs.com)

163 | 164 |
165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /monitors.json: -------------------------------------------------------------------------------- 1 | { 2 | "monitors": { 3 | 4 | "homepage performance": { 5 | "visit": "http://monitorstxt.org", 6 | "page": { 7 | "should have": { 8 | "download time": { "maximum": "0.5 seconds" } 9 | } 10 | }, 11 | "assets": { 12 | "should have": { 13 | "download time": { "maximum": "2 seconds" } 14 | } 15 | } 16 | }, 17 | 18 | "monitorstxt.com redirect": { 19 | "visit": "http://monitorstxt.com", 20 | "should redirect to": "http://monitorstxt.org" 21 | }, 22 | 23 | "homepage content": { 24 | "visit": "http://monitorstxt.org", 25 | "page": { 26 | "should have": { 27 | "content": { 28 | "body": "The homepage should show the sample monitors.txt file", 29 | "h1": "monitors.txt" 30 | } 31 | } 32 | } 33 | }, 34 | 35 | "monitorstxt.org DNS": { 36 | "dns": { 37 | "should resolve": { 38 | "host": "monitorstxt.org", 39 | "ip address": "207.97.227.245" 40 | } 41 | } 42 | }, 43 | 44 | "indexed in search engine": { 45 | "visit": "http://www.duckduckgo.com", 46 | "fill in": { "q": "site:monitorstxt.org" }, 47 | "click button": "submit", 48 | "page": { 49 | "should have": { 50 | "content": { "h2": "monitors.txt" } 51 | } 52 | } 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /monitors.txt: -------------------------------------------------------------------------------- 1 | # monitors.txt - see http://monitorstxt.org for more info 2 | 3 | # This is the Gherkin/Cucumber format, other formats available at: 4 | # YAML: http://monitorstxt.org/monitors.yml 5 | # JSON: http://monitorstxt.org/monitors.json 6 | # XML : http://monitorstxt.org/monitors.xml 7 | 8 | # - Gherkin/Cucumber format 9 | Scenario: Homepage performance 10 | When I visit http://monitorstxt.org 11 | Then the page should download in 0.5 seconds or less 12 | And the assets should download in 2 seconds or less 13 | 14 | Scenario: The monitorstxt.com domain should redirect to monitorstxt.org 15 | When I visit http://monitorstxt.com 16 | Then I should be redirected to http://monitorstxt.org 17 | 18 | Scenario: The home page should show the sample monitors.txt file 19 | When I visit http://monitorstxt.org 20 | Then the page should have content "The home page should show the sample monitors.txt file" within "body" 21 | And the page should have content "monitors.txt" within "h1" 22 | 23 | Scenario: DNS should resolve monitorstxt.org to the correct IP address 24 | Then DNS should resolve host "monitorstxt.org" to "207.97.227.245" 25 | 26 | Scenario: Site appears in search engine 27 | Given I visit http://www.duckduckgo.com 28 | When I fill in "q" with "site:monitorstxt.org" 29 | And I click button "submit" 30 | Then the page should have content "monitors.txt" within "h2" 31 | -------------------------------------------------------------------------------- /monitors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://monitorstxt.org 4 | 5 | 6 | 7 | 8 | 0.5 9 | seconds 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 2 19 | seconds 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | http://monitorstxt.com 28 | http://monitorstxt.org 29 | 30 | 31 | 32 | http://monitorstxt.org 33 | 34 | 35 | 36 | The homepage should show the sample monitors.txt 37 | body 38 | 39 | 40 | 41 | monitors.txt 42 | h1 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | monitorstxt.org 52 | 207.97.227.245 53 | 54 | 55 | 56 | 57 | 58 | http://www.duckduckgo.com 59 | 60 | q 61 | site:monitorstxt.org 62 | 63 | 64 | submit 65 | 66 | 67 | 68 | 69 | monitors.txt 70 | h2 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /monitors.yml: -------------------------------------------------------------------------------- 1 | # SYNTAX OPTION 1, bit of a deviation from the others but interesting, not sure how to get multi-step interactions working 2 | monitors: 3 | monitorstxt redirects: 4 | redirect: http://monitorstxt.com -> http://monitorstxt.org (301) 5 | 6 | home page performance and content: 7 | url: http://monitorstxt.org 8 | performance: <= 0.5s 9 | content: 10 | body: *The home page should show the sample monitors.txt file* 11 | h1: monitors.txt 12 | 13 | cdn performance: 14 | url: http://cdn.monitorstxt.org/logo.png 15 | performance: <= 2s 16 | 17 | DNS resolving correctly: 18 | dns resolve: monitorstxt.org -> 207.97.227.245 19 | 20 | Login stats: 21 | guage: http://domain/stats/logins 60s 22 | count: http://domain/stats/logins 60s 23 | avg: http://domain/stats/logins 24h 24 | 25 | # SYNTAX OPTION 2 26 | monitors: 27 | homepage performance: 28 | visit: http://monitorstxt.org 29 | page: 30 | should have: 31 | download time: 32 | maximum: 0.5 seconds 33 | assets: 34 | should have: 35 | download time: 36 | maximum: 2 seconds 37 | 38 | monitorstxt redirect: 39 | visit: http://monitorstxt.com 40 | should redirect to: http://monitorstxt.org 41 | 42 | homepage content: 43 | visit: http://monitorstxt.org 44 | page: 45 | should have: 46 | content: 47 | - { body: The homepage should show the sample monitors.txt file } 48 | - { h1: monitors.txt } 49 | 50 | monitorstxt DNS: 51 | dns: 52 | should resolve: 53 | host: monitorstxt.org 54 | ip address: 207.97.227.245 55 | 56 | indexed in search engine: 57 | visit: http://www.duckduckgo.com 58 | fill in: { q: "site:monitorstxt.org" } 59 | click button: submit 60 | page: 61 | should have: 62 | content: { h2: monitors.txt } 63 | 64 | --------------------------------------------------------------------------------