gruf-prometheus 2.3.0 → 2.3.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
2
  SHA256:
3
- metadata.gz: cd4a02507521f0e59c1242e42396a2ce66a33c1d6152268c1479239abed3f00b
4
- data.tar.gz: 01b68639aa687e63d9fd525c69fe968100e00c7d75fcf61d7a0f21d0e47247d9
3
+ metadata.gz: 7cc1bfd65b8d6b2bd2f9cf037b0f555db7050bb2e904b0bff974d0c25661693f
4
+ data.tar.gz: acc67e687db127073c4d910f5df49deae1aaafa2cb2a51c42a656e3374eaab46
5
5
  SHA512:
6
- metadata.gz: 99ba9ca706e42f165d08464d94ba92fc3c7450f68e91062b7717d66124c0f8108d6aaa3d119d1193ae68aeb2898a6d7b1266576919e757fe799d5f7e8f64b191
7
- data.tar.gz: 8a05f7a59227f5ac0f428cd4b8e4d4fc384363337f5e7d93db2326c56be2de4effb6493c5f1e42ad6b35793bbb9a99e6098a86382723936909e1c908052aaebf
6
+ metadata.gz: 06b59c18c94ad363c92d2e6d6926a4c15d202baea8cd1a6ebd53f3a98806d7940f81dd08d128244efe0d7c568132663bca72084af8e03c6e13305d8f1ea8f6a2
7
+ data.tar.gz: 1271bbc43c962c2c028801eda96394df3e777c80ca917d895494b3f4cb58b3d490382f86652a87c6724ebd6fe0f522bb00637c5945c0e475a3dc7f64f2eda61e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ Changelog for the gruf-prometheus gem.
2
2
 
3
3
  ### Pending Release
4
4
 
5
+ ### 2.3.1
6
+
7
+ - Ensure ActiveRecord collector is started on gruf hook
8
+
5
9
  ### 2.3.0
6
10
 
7
11
  - Add server collector and interceptor for measuring server failures
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.description = spec.summary
29
29
  spec.homepage = 'https://github.com/bigcommerce/gruf-prometheus'
30
30
  spec.license = 'MIT'
31
+ spec.metadata['rubygems_mfa_required'] = 'true'
31
32
 
32
33
  spec.files = Dir['README.md', 'CHANGELOG.md', 'CODE_OF_CONDUCT.md', 'lib/**/*', 'gruf-prometheus.gemspec']
33
34
  spec.require_paths = ['lib']
@@ -63,6 +63,12 @@ module Gruf
63
63
  client: ::Bigcommerce::Prometheus.client,
64
64
  frequency: ::Gruf::Prometheus.collection_frequency
65
65
  )
66
+ if active_record_enabled?
67
+ ::PrometheusExporter::Instrumentation::ActiveRecord.start(
68
+ client: ::Bigcommerce::Prometheus.client,
69
+ frequency: ::Gruf::Prometheus.collection_frequency
70
+ )
71
+ end
66
72
  ::Gruf::Prometheus::Collector.start(
67
73
  options: {
68
74
  server: server
@@ -110,6 +116,15 @@ module Gruf
110
116
  def custom_collectors
111
117
  @options.fetch(:collectors, []) || []
112
118
  end
119
+
120
+ ##
121
+ # @return [Boolean]
122
+ #
123
+ def active_record_enabled?
124
+ defined?(ActiveRecord) && ::ActiveRecord::Base.connection_pool.respond_to?(:stat)
125
+ rescue StandardError => _e
126
+ false
127
+ end
113
128
  end
114
129
  end
115
130
  end
@@ -17,6 +17,6 @@
17
17
  #
18
18
  module Gruf
19
19
  module Prometheus
20
- VERSION = '2.3.0'
20
+ VERSION = '2.3.1'
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf-prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-21 00:00:00.000000000 Z
11
+ date: 2022-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bc-prometheus-ruby
@@ -205,7 +205,8 @@ files:
205
205
  homepage: https://github.com/bigcommerce/gruf-prometheus
206
206
  licenses:
207
207
  - MIT
208
- metadata: {}
208
+ metadata:
209
+ rubygems_mfa_required: 'true'
209
210
  post_install_message:
210
211
  rdoc_options: []
211
212
  require_paths: