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 +4 -4
- data/CHANGELOG.md +4 -0
- data/gruf-prometheus.gemspec +1 -0
- data/lib/gruf/prometheus/hook.rb +15 -0
- data/lib/gruf/prometheus/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cc1bfd65b8d6b2bd2f9cf037b0f555db7050bb2e904b0bff974d0c25661693f
|
4
|
+
data.tar.gz: acc67e687db127073c4d910f5df49deae1aaafa2cb2a51c42a656e3374eaab46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06b59c18c94ad363c92d2e6d6926a4c15d202baea8cd1a6ebd53f3a98806d7940f81dd08d128244efe0d7c568132663bca72084af8e03c6e13305d8f1ea8f6a2
|
7
|
+
data.tar.gz: 1271bbc43c962c2c028801eda96394df3e777c80ca917d895494b3f4cb58b3d490382f86652a87c6724ebd6fe0f522bb00637c5945c0e475a3dc7f64f2eda61e
|
data/CHANGELOG.md
CHANGED
data/gruf-prometheus.gemspec
CHANGED
@@ -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']
|
data/lib/gruf/prometheus/hook.rb
CHANGED
@@ -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
|
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.
|
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-
|
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:
|