This repository was archived by the owner on Sep 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +4
-10
lines changed Expand file tree Collapse file tree 4 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 11AllCops :
22 Exclude :
3- - lib/prometheus/api_client /version.rb
3+ - lib/prometheus/alert_buffer_client /version.rb
44
55AlignHash :
66 EnforcedHashRocketStyle : table
@@ -22,6 +22,7 @@ Metrics/BlockLength:
2222 - ' spec/**/*.rb'
2323
2424Metrics/LineLength :
25+ Max : 120
2526 Exclude :
2627 - ' spec/**/*.rb'
2728
Original file line number Diff line number Diff line change 55
66prometheus . post '{"posted":"alert"}'
77prometheus . post '{"alertId":12}'
8-
Original file line number Diff line number Diff line change 55require 'prometheus/alert_buffer_client/client'
66
77module Prometheus
8-
98 # Alert Client is a ruby implementation for a Prometheus-alert-buffer client.
109 module AlertBufferClient
11-
1210 def self . client ( options = { } )
1311 Client . new ( options )
1412 end
15-
1613 end
1714end
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ class RequestError < StandardError; end
2121 } ,
2222 } . freeze
2323
24-
2524 # Create a Prometheus Alert client:
2625 #
2726 # @param [Hash] options
@@ -40,13 +39,12 @@ def initialize(options = {})
4039
4140 @client = Faraday . new (
4241 faraday_options ( options ) ,
43- ) do |conn |
42+ ) do |conn |
4443 conn . response ( :json )
4544 conn . adapter ( Faraday . default_adapter )
4645 end
4746 end
4847
49-
5048 # Get alerts:
5149 #
5250 # @param [Hash] options
@@ -101,7 +99,7 @@ def faraday_headers(options)
10199 return unless headers && headers [ :token ]
102100
103101 {
104- Authorization : "Bearer #{ headers [ :token ] . to_s } " ,
102+ Authorization : "Bearer #{ headers [ :token ] } " ,
105103 }
106104 end
107105
@@ -128,7 +126,6 @@ def faraday_options(options)
128126 request : faraday_request ( options ) ,
129127 }
130128 end
131-
132129 end
133130 end
134131end
You can’t perform that action at this time.
0 commit comments