influxdb-rails 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd28d1ed1a585a6ad1aef9945e693b2b1d20668de731e35ab0066c2c09ed50a5
4
- data.tar.gz: df3e81593ce080e308018b2f94ea4ff4e3094f3584843051c60d6219ed9fe7aa
3
+ metadata.gz: 613267c17473f3d84942b39e09a34d6e5797edf9bf3974426aea5d979016f5cb
4
+ data.tar.gz: afa98b412ac01fca796d23fcd80a838197c503cf76d2bfb5e921068d82db037d
5
5
  SHA512:
6
- metadata.gz: 8cbea1f68ee5ad8b68f9b8a4ee953999215bf62f6300aff3fb7b679f6d5fa797a49a2c28f9d0d2f0594f14cc15955d34291b6344371ad141d107d6dc8ff7a8c2
7
- data.tar.gz: 6723fc68b1ba75a1efd39e820e9752e757bbb34007763b832ea565942716606a6ee388bfdb967dbabd4790eefb9b7414e6dc0697b7d6388454713b4b879700f6
6
+ metadata.gz: af5f5e21271757564eb91176ee0339e385a56dd130e1d6236d46d3515882d00a749f0c38d1e4920dfc6a24385d838ec8c91b1d8b084015f2394e9448a3282d44
7
+ data.tar.gz: c755671a0160554f0b0012ad32afca0f760f4f98ca49df0854584009fb90c43855e1ce9238189db88482bc2d2ccc00bb06d460e4972d60c75006791c406f4a4f
data/.rubocop.yml CHANGED
@@ -11,7 +11,8 @@ AllCops:
11
11
  - 'vendor/bundle/**/*'
12
12
  DisplayCopNames: true
13
13
  StyleGuideCopsOnly: false
14
- TargetRubyVersion: 2.4
14
+ TargetRubyVersion: 2.5
15
+ NewCops: enable
15
16
 
16
17
  Layout/EmptyLinesAroundArguments:
17
18
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  For the full commit log, [see here](https://github.com/influxdata/influxdb-rails/commits/one-stable).
4
4
 
5
+ ## v1.0.3, released 2021-09-15
6
+
7
+ - In case of unhandled exceptions, set status in measurements like Rails.logger does
8
+ - Require Ruby 2.5
9
+
5
10
  ## v1.0.2, released 2021-04-13
6
11
 
7
12
  Fix passing booleans to custom tags.
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features|smoke)/})
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.required_ruby_version = ">= 2.4.0"
25
+ spec.required_ruby_version = ">= 2.5.0"
26
26
 
27
27
  spec.add_runtime_dependency "influxdb", "~> 0.6", ">= 0.6.4"
28
28
  spec.add_runtime_dependency "railties", ">= 5.0"
@@ -16,7 +16,7 @@ module InfluxDB
16
16
  {
17
17
  method: "#{payload[:controller]}##{payload[:action]}",
18
18
  hook: "process_action",
19
- status: payload[:status],
19
+ status: status,
20
20
  format: payload[:format],
21
21
  http_method: payload[:method],
22
22
  exception: payload[:exception]&.first,
@@ -38,6 +38,14 @@ module InfluxDB
38
38
  configuration.client.time_precision
39
39
  )
40
40
  end
41
+
42
+ def status
43
+ if payload[:exception] && ::Rails::VERSION::MAJOR < 7
44
+ ActionDispatch::ExceptionWrapper.status_code_for_exception(payload[:exception].first)
45
+ else
46
+ payload[:status]
47
+ end
48
+ end
41
49
  end
42
50
  end
43
51
  end
@@ -1,5 +1,5 @@
1
1
  module InfluxDB
2
2
  module Rails
3
- VERSION = "1.0.2".freeze
3
+ VERSION = "1.0.3".freeze
4
4
  end
5
5
  end
@@ -89,7 +89,8 @@ RSpec.describe "ActionController metrics", type: :request do
89
89
  tags: a_hash_including(
90
90
  method: "ExceptionsController#index",
91
91
  hook: "process_action",
92
- exception: "ZeroDivisionError"
92
+ exception: "ActiveRecord::RecordNotFound",
93
+ status: 404
93
94
  )
94
95
  )
95
96
  end
@@ -76,7 +76,7 @@ end
76
76
 
77
77
  class ExceptionsController < ApplicationController
78
78
  def index
79
- 1 / 0
79
+ raise ActiveRecord::RecordNotFound
80
80
  end
81
81
  end
82
82
 
@@ -76,7 +76,7 @@ end
76
76
 
77
77
  class ExceptionsController < ApplicationController
78
78
  def index
79
- 1 / 0
79
+ raise ActiveRecord::RecordNotFound
80
80
  end
81
81
  end
82
82
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Bruckmayer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-13 00:00:00.000000000 Z
12
+ date: 2021-09-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: influxdb
@@ -350,14 +350,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
350
350
  requirements:
351
351
  - - ">="
352
352
  - !ruby/object:Gem::Version
353
- version: 2.4.0
353
+ version: 2.5.0
354
354
  required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  requirements:
356
356
  - - ">="
357
357
  - !ruby/object:Gem::Version
358
358
  version: '0'
359
359
  requirements: []
360
- rubygems_version: 3.1.4
360
+ rubygems_version: 3.1.6
361
361
  signing_key:
362
362
  specification_version: 4
363
363
  summary: InfluxDB bindings for Ruby on Rails.