bc-prometheus-ruby 0.1.3 → 0.1.4
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/bigcommerce/prometheus/integrations/puma.rb +16 -7
- data/lib/bigcommerce/prometheus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c0e12140ddec68a3948d287f64447dd3bfc431a26cdb1c5bee3148732263396
|
|
4
|
+
data.tar.gz: 60d57ee94401660ee6f9fa980106d70f9e158b29c03de6b7f28a6965effabe4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e60684700496ab86fc11451bb472e5747103f6c100724959b3477859ed89f4d21b392894bcac431cb740501bca7e4878b65c8b33a9c6e8b78c96bddea1ae042f
|
|
7
|
+
data.tar.gz: 46b989c7bd48a418944adfc477cd870962e9ab0bb02d0645f5a31f99848cef8fb0262df10f049b3ddec8c2dbf30c6e7efae5fd31867bb9bc3b5f13a14eb0856e
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@ Changelog for the bc-prometheus-ruby gem.
|
|
|
2
2
|
|
|
3
3
|
h3. Pending Release
|
|
4
4
|
|
|
5
|
+
h3. 0.1.4
|
|
6
|
+
|
|
7
|
+
- Handle circumstances when before_fork_callbacks is called outside of the web process
|
|
8
|
+
|
|
5
9
|
h3. 0.1.3
|
|
6
10
|
|
|
7
11
|
- Move to bigcommerce fork of multitrap to handle IGNORE clauses more cleanly
|
|
@@ -25,21 +25,23 @@ module Bigcommerce
|
|
|
25
25
|
##
|
|
26
26
|
# Start the puma collector
|
|
27
27
|
#
|
|
28
|
-
def self.start
|
|
28
|
+
def self.start(client: nil, frequency: nil)
|
|
29
|
+
return unless puma_enabled?
|
|
30
|
+
|
|
29
31
|
::PrometheusExporter::Instrumentation::Puma.start(
|
|
30
|
-
client: ::Bigcommerce::Prometheus.client,
|
|
31
|
-
frequency: ::Bigcommerce::Prometheus.puma_collection_frequency
|
|
32
|
+
client: client || ::Bigcommerce::Prometheus.client,
|
|
33
|
+
frequency: frequency || ::Bigcommerce::Prometheus.puma_collection_frequency
|
|
32
34
|
)
|
|
33
35
|
if active_record_enabled?
|
|
34
36
|
::PrometheusExporter::Instrumentation::ActiveRecord.start(
|
|
35
|
-
client: ::Bigcommerce::Prometheus.client,
|
|
36
|
-
frequency: ::Bigcommerce::Prometheus.puma_collection_frequency
|
|
37
|
+
client: client || ::Bigcommerce::Prometheus.client,
|
|
38
|
+
frequency: frequency || ::Bigcommerce::Prometheus.puma_collection_frequency
|
|
37
39
|
)
|
|
38
40
|
end
|
|
39
41
|
::PrometheusExporter::Instrumentation::Process.start(
|
|
40
|
-
client: ::Bigcommerce::Prometheus.client,
|
|
42
|
+
client: client || ::Bigcommerce::Prometheus.client,
|
|
41
43
|
type: ::Bigcommerce::Prometheus.puma_process_label,
|
|
42
|
-
frequency: ::Bigcommerce::Prometheus.puma_collection_frequency
|
|
44
|
+
frequency: frequency || ::Bigcommerce::Prometheus.puma_collection_frequency
|
|
43
45
|
)
|
|
44
46
|
end
|
|
45
47
|
|
|
@@ -49,6 +51,13 @@ module Bigcommerce
|
|
|
49
51
|
def self.active_record_enabled?
|
|
50
52
|
defined?(ActiveRecord) && ::ActiveRecord::Base.connection_pool.respond_to?(:stat)
|
|
51
53
|
end
|
|
54
|
+
|
|
55
|
+
##
|
|
56
|
+
# @return [Boolean]
|
|
57
|
+
#
|
|
58
|
+
def self.puma_enabled?
|
|
59
|
+
defined?(Puma) && Puma.respond_to?(:stats)
|
|
60
|
+
end
|
|
52
61
|
end
|
|
53
62
|
end
|
|
54
63
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bc-prometheus-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shaun McCormick
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-11-
|
|
11
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|