app_status 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3f92be251f2e5e1e9663ca7fbd128c37d8cef85b
4
- data.tar.gz: a376f86a882cc42e2e4deeb5953dda8a45151999
2
+ SHA256:
3
+ metadata.gz: 46ea6b514829437f9e026f13f298a68ef3e9fdac9b19bfe52aefc5415867001c
4
+ data.tar.gz: 3a7126c9a9741bc9286e65fe945b0a2a174dd9ba0b0a3f7509ded5b735569d9a
5
5
  SHA512:
6
- metadata.gz: 219bdfb084a8dd3b26f0db68dc8026e7f5fd770ae0a2a611745435d99beaf354a5ee8da8bfb496d0e4cae3d66470ff4f836acb693385ecb8f0841594087e5bca
7
- data.tar.gz: c92ddd4bc3d6352df646c92a96f024ecac48bf95b8e243a60f26b3a0affc0d09807a9db10b3a7d77376f50fe6dfae8d7c77ad18e3dddec6da12e49e572d515d3
6
+ metadata.gz: 06ec7104c17a631a9de11ef98fc2950f12b44048a02f503c5f2dd7c597b08ccfcd93e18cd6d40c350e09c47b040dba003c7ac9513055535f95f10679b880fe5a
7
+ data.tar.gz: 3233c1b5b3f23256f5f3cf590e5f3a9c6c232357ebaaa6bf779203380f423c701c95db1b1b6d130c1f2b83eff6fc948639659548c5f0dd8a148c6412d5abe906
data/README.md CHANGED
@@ -50,15 +50,8 @@ gem 'app_status'
50
50
  mount AppStatus::Engine => "/status(.:format)", defaults: {format: 'json'}
51
51
  ```
52
52
 
53
- This exposes the following URLs
54
- - `http://localhost:3000/status`
55
- renders html or json according to Accept headers. Defaults to JSON.
56
- - `http://localhost:3000/status.json`
57
- - `http://localhost:3000/status.html`
58
-
59
- The HTML status page will use your application's default layout.
60
-
61
- **NOTE :** The engine assumes that you have a top-level `::ApplicationController`.
53
+ This exposes `http://localhost:3000/status.json`. (Support for HTML output was
54
+ dropped in v2.0. see [PR #3](https://github.com/alexdean/app_status/pull/3).)
62
55
 
63
56
  ### `config/initializers/app_status.rb`
64
57
 
@@ -104,12 +97,8 @@ These are set up to be compatible with Nagios.
104
97
  `add_description` allows you to specify extended description and troubleshooting
105
98
  information for any check which has been added via `add_check`.
106
99
 
107
- Currently these are not returned via the JSON endpoint, but are available
108
- via the HTML status page.
109
-
110
- Description information is parsed by kramdown for display. Refer to the
111
- [kramdown style guide](http://kramdown.rubyforge.org/quickref.html) for
112
- usage information.
100
+ These descriptions are not included in the `status.json` payload by default.
101
+ Add `?descriptions=1` to include them.
113
102
 
114
103
  ```ruby
115
104
  AppStatus::CheckCollection.configure do |c|
@@ -6,12 +6,8 @@ module AppStatus
6
6
 
7
7
  json_data = @checks.as_json(include_descriptions: params[:descriptions])
8
8
 
9
- more_info = app_status_engine.root_url
10
- # try to build html url, when main app has route like '/status(.:format)'
11
- if match = more_info.match(/(.*)\.json/)
12
- more_info = match[1]+'.html'
13
- end
14
- json_data['more_info'] = more_info
9
+ more_info_url = app_status_engine.root_url(descriptions: true)
10
+ json_data['more_info'] = more_info_url
15
11
 
16
12
  render json: json_data
17
13
  end
@@ -1,3 +1,3 @@
1
1
  module AppStatus
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -2554,3 +2554,155 @@ Completed 200 OK in 1ms (Views: 0.3ms)
2554
2554
  Started GET "/status.json" for 127.0.0.1 at 2018-02-16 16:08:37 -0600
2555
2555
  Processing by AppStatus::StatusController#index as JSON
2556
2556
  Completed 200 OK in 0ms (Views: 0.2ms)
2557
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 09:59:44 -0600
2558
+ Processing by AppStatus::StatusController#index as JSON
2559
+ Completed 200 OK in 2ms (Views: 0.3ms)
2560
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 09:59:44 -0600
2561
+ Processing by AppStatus::StatusController#index as JSON
2562
+ Completed 200 OK in 0ms (Views: 0.2ms)
2563
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 09:59:44 -0600
2564
+ Processing by AppStatus::StatusController#index as JSON
2565
+ Parameters: {"descriptions"=>"1"}
2566
+ Completed 200 OK in 0ms (Views: 0.2ms)
2567
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 09:59:44 -0600
2568
+ Processing by AppStatus::StatusController#index as JSON
2569
+ Completed 200 OK in 0ms (Views: 0.1ms)
2570
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 09:59:44 -0600
2571
+ Processing by AppStatus::StatusController#index as JSON
2572
+ Completed 200 OK in 0ms (Views: 0.2ms)
2573
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 09:59:44 -0600
2574
+ Processing by AppStatus::StatusController#index as JSON
2575
+ Completed 200 OK in 0ms (Views: 0.1ms)
2576
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:00:35 -0600
2577
+ Processing by AppStatus::StatusController#index as JSON
2578
+ Completed 200 OK in 2ms (Views: 0.3ms)
2579
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:00:35 -0600
2580
+ Processing by AppStatus::StatusController#index as JSON
2581
+ Completed 200 OK in 0ms (Views: 0.1ms)
2582
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:00:35 -0600
2583
+ Processing by AppStatus::StatusController#index as JSON
2584
+ Parameters: {"descriptions"=>"1"}
2585
+ Completed 200 OK in 0ms (Views: 0.1ms)
2586
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:00:35 -0600
2587
+ Processing by AppStatus::StatusController#index as JSON
2588
+ Completed 200 OK in 0ms (Views: 0.1ms)
2589
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:00:35 -0600
2590
+ Processing by AppStatus::StatusController#index as JSON
2591
+ Completed 200 OK in 0ms (Views: 0.1ms)
2592
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:00:35 -0600
2593
+ Processing by AppStatus::StatusController#index as JSON
2594
+ Completed 200 OK in 0ms (Views: 0.1ms)
2595
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:01:04 -0600
2596
+ Processing by AppStatus::StatusController#index as JSON
2597
+ Completed 500 Internal Server Error in 6ms
2598
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:01:04 -0600
2599
+ Processing by AppStatus::StatusController#index as JSON
2600
+ Completed 500 Internal Server Error in 5ms
2601
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:01:04 -0600
2602
+ Processing by AppStatus::StatusController#index as JSON
2603
+ Completed 500 Internal Server Error in 5ms
2604
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:01:04 -0600
2605
+ Processing by AppStatus::StatusController#index as JSON
2606
+ Completed 500 Internal Server Error in 5ms
2607
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:01:04 -0600
2608
+ Processing by AppStatus::StatusController#index as JSON
2609
+ Completed 500 Internal Server Error in 5ms
2610
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:01:04 -0600
2611
+ Processing by AppStatus::StatusController#index as JSON
2612
+ Parameters: {"descriptions"=>"1"}
2613
+ Completed 500 Internal Server Error in 6ms
2614
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:01:15 -0600
2615
+ Processing by AppStatus::StatusController#index as JSON
2616
+ Completed 200 OK in 2ms (Views: 0.3ms)
2617
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:01:15 -0600
2618
+ Processing by AppStatus::StatusController#index as JSON
2619
+ Completed 200 OK in 0ms (Views: 0.1ms)
2620
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:01:15 -0600
2621
+ Processing by AppStatus::StatusController#index as JSON
2622
+ Completed 200 OK in 0ms (Views: 0.1ms)
2623
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:01:15 -0600
2624
+ Processing by AppStatus::StatusController#index as JSON
2625
+ Completed 200 OK in 0ms (Views: 0.1ms)
2626
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:01:15 -0600
2627
+ Processing by AppStatus::StatusController#index as JSON
2628
+ Completed 200 OK in 0ms (Views: 0.2ms)
2629
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:01:15 -0600
2630
+ Processing by AppStatus::StatusController#index as JSON
2631
+ Parameters: {"descriptions"=>"1"}
2632
+ Completed 200 OK in 0ms (Views: 0.2ms)
2633
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:02:39 -0600
2634
+ Processing by AppStatus::StatusController#index as JSON
2635
+ Completed 200 OK in 1ms (Views: 0.2ms)
2636
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:02:39 -0600
2637
+ Processing by AppStatus::StatusController#index as JSON
2638
+ Completed 200 OK in 0ms (Views: 0.2ms)
2639
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:02:39 -0600
2640
+ Processing by AppStatus::StatusController#index as JSON
2641
+ Completed 200 OK in 0ms (Views: 0.1ms)
2642
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:02:40 -0600
2643
+ Processing by AppStatus::StatusController#index as JSON
2644
+ Completed 200 OK in 0ms (Views: 0.2ms)
2645
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:02:40 -0600
2646
+ Processing by AppStatus::StatusController#index as JSON
2647
+ Parameters: {"descriptions"=>"1"}
2648
+ Completed 200 OK in 0ms (Views: 0.1ms)
2649
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:02:40 -0600
2650
+ Processing by AppStatus::StatusController#index as JSON
2651
+ Completed 200 OK in 0ms (Views: 0.2ms)
2652
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:05:34 -0600
2653
+ Processing by AppStatus::StatusController#index as JSON
2654
+ Completed 200 OK in 1ms (Views: 0.2ms)
2655
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:05:34 -0600
2656
+ Processing by AppStatus::StatusController#index as JSON
2657
+ Parameters: {"descriptions"=>"1"}
2658
+ Completed 200 OK in 0ms (Views: 0.2ms)
2659
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:05:34 -0600
2660
+ Processing by AppStatus::StatusController#index as JSON
2661
+ Completed 200 OK in 0ms (Views: 0.1ms)
2662
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:05:34 -0600
2663
+ Processing by AppStatus::StatusController#index as JSON
2664
+ Completed 200 OK in 0ms (Views: 0.1ms)
2665
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:05:34 -0600
2666
+ Processing by AppStatus::StatusController#index as JSON
2667
+ Completed 200 OK in 0ms (Views: 0.2ms)
2668
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:05:34 -0600
2669
+ Processing by AppStatus::StatusController#index as JSON
2670
+ Completed 200 OK in 0ms (Views: 0.1ms)
2671
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:05:49 -0600
2672
+ Processing by AppStatus::StatusController#index as JSON
2673
+ Completed 200 OK in 2ms (Views: 0.2ms)
2674
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:05:49 -0600
2675
+ Processing by AppStatus::StatusController#index as JSON
2676
+ Completed 200 OK in 1ms (Views: 0.5ms)
2677
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:05:49 -0600
2678
+ Processing by AppStatus::StatusController#index as JSON
2679
+ Completed 200 OK in 0ms (Views: 0.2ms)
2680
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:05:49 -0600
2681
+ Processing by AppStatus::StatusController#index as JSON
2682
+ Completed 200 OK in 0ms (Views: 0.2ms)
2683
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:05:49 -0600
2684
+ Processing by AppStatus::StatusController#index as JSON
2685
+ Completed 200 OK in 0ms (Views: 0.1ms)
2686
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:05:49 -0600
2687
+ Processing by AppStatus::StatusController#index as JSON
2688
+ Parameters: {"descriptions"=>"1"}
2689
+ Completed 200 OK in 0ms (Views: 0.2ms)
2690
+ Started GET "/status" for 127.0.0.1 at 2019-02-27 10:07:01 -0600
2691
+ Processing by AppStatus::StatusController#index as JSON
2692
+ Completed 200 OK in 2ms (Views: 0.5ms)
2693
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:07:01 -0600
2694
+ Processing by AppStatus::StatusController#index as JSON
2695
+ Completed 200 OK in 1ms (Views: 0.2ms)
2696
+ Started GET "/status/index.json" for 127.0.0.1 at 2019-02-27 10:07:01 -0600
2697
+ Processing by AppStatus::StatusController#index as JSON
2698
+ Completed 200 OK in 0ms (Views: 0.2ms)
2699
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:07:01 -0600
2700
+ Processing by AppStatus::StatusController#index as JSON
2701
+ Completed 200 OK in 0ms (Views: 0.1ms)
2702
+ Started GET "/status.json?descriptions=1" for 127.0.0.1 at 2019-02-27 10:07:01 -0600
2703
+ Processing by AppStatus::StatusController#index as JSON
2704
+ Parameters: {"descriptions"=>"1"}
2705
+ Completed 200 OK in 0ms (Views: 0.1ms)
2706
+ Started GET "/status.json" for 127.0.0.1 at 2019-02-27 10:07:01 -0600
2707
+ Processing by AppStatus::StatusController#index as JSON
2708
+ Completed 200 OK in 0ms (Views: 0.1ms)
@@ -43,12 +43,12 @@ describe "status", type: :feature do
43
43
  page.should have_content_type('application/json')
44
44
  end
45
45
 
46
- it "links to html status page" do
46
+ it "links to more-details page" do
47
47
  visit '/status.json'
48
48
  page.should have_content_type('application/json')
49
49
  data = JSON.parse(page.body)
50
50
 
51
- data['more_info'].should eq 'http://www.example.com/status.html'
51
+ data['more_info'].should eq 'http://www.example.com/status/?descriptions=true'
52
52
  end
53
53
 
54
54
  it "contains status information" do
@@ -150,38 +150,38 @@ describe AppStatus::CheckCollection do
150
150
  expect(c.as_json).to match({
151
151
  "status" => :unknown,
152
152
  "status_code" => 3,
153
- "ms" => an_instance_of(Fixnum),
153
+ "ms" => an_instance_of(Integer),
154
154
  "finished" => "2013-10-05T12:00:00Z",
155
155
  "checks" => {
156
156
  "test1" => {
157
157
  "status" => :ok,
158
158
  "status_code" => 0,
159
159
  "details" => "looks good",
160
- "ms" => an_instance_of(Fixnum)
160
+ "ms" => an_instance_of(Integer)
161
161
  },
162
162
  "test2" => {
163
163
  "status" => :unknown,
164
164
  "status_code" => 3,
165
165
  "details" => "Check returned invalid status 'huh'. invalid",
166
- "ms" => an_instance_of(Fixnum)
166
+ "ms" => an_instance_of(Integer)
167
167
  },
168
168
  "test3" => {
169
169
  "status" => :warning,
170
170
  "status_code" => 1,
171
171
  "details" => "not good",
172
- "ms" => an_instance_of(Fixnum)
172
+ "ms" => an_instance_of(Integer)
173
173
  },
174
174
  "test4" => {
175
175
  "status" => :critical,
176
176
  "status_code" => 2,
177
177
  "details" => "on fire",
178
- "ms" => an_instance_of(Fixnum)
178
+ "ms" => an_instance_of(Integer)
179
179
  },
180
180
  "test5" => {
181
181
  "status" => :unknown,
182
182
  "status_code" => 3,
183
183
  "details" => "no idea",
184
- "ms" => an_instance_of(Fixnum)
184
+ "ms" => an_instance_of(Integer)
185
185
  }
186
186
  }
187
187
  })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dean
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2019-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.5.1
180
+ rubygems_version: 2.7.6
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: AppStatus is a Rails engine for exposing app data to Nagios.