puma-plugin-telemetry 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/build.yml +20 -3
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +4 -4
- data/README.md +6 -1
- data/lib/puma/plugin/telemetry/version.rb +1 -1
- data/lib/puma/plugin/telemetry.rb +16 -5
- data/puma-plugin-telemetry.gemspec +17 -8
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3992737163fb68bb64e961ac4012e8d00b43e4464cd37b945a62495d8acdef8
|
4
|
+
data.tar.gz: bc723cd155b0104b563c9795e3598a14ba4c24c53990b87050ba5aacce7fb831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 111bbc32976f4fbb619b2240a1229ae376e56a5c9269f138507528b851e2824048730660719da512b85069a93c05fe24d9419a4a70ac0c3c95ba64752f69725a
|
7
|
+
data.tar.gz: 7c57a55fd2701507f9eeb23d4231041ab41321b3a365f11af42ca70cdb768abc6c5421ace812c868277fdd3234c1997b453b3aca62f6bd82380b03679a82100f
|
data/.github/CODEOWNERS
CHANGED
data/.github/workflows/build.yml
CHANGED
@@ -37,10 +37,27 @@ jobs:
|
|
37
37
|
echo "build complete"
|
38
38
|
|
39
39
|
release:
|
40
|
-
needs: build
|
41
|
-
if: contains(github.ref, 'tags') && github.event_name == 'create'
|
42
40
|
runs-on: ubuntu-20.04
|
41
|
+
|
42
|
+
needs:
|
43
|
+
- build
|
44
|
+
|
45
|
+
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
|
46
|
+
|
43
47
|
steps:
|
44
48
|
- uses: actions/checkout@v3
|
45
49
|
- uses: ruby/setup-ruby@v1
|
46
|
-
|
50
|
+
|
51
|
+
- name: Create credentials
|
52
|
+
run: |
|
53
|
+
mkdir -p ~/.gem
|
54
|
+
cat << EOF > ~/.gem/credentials
|
55
|
+
---
|
56
|
+
:rubygems_api_key: ${{ secrets.RUBYGEMS_TOKEN }}
|
57
|
+
EOF
|
58
|
+
chmod 0600 /home/runner/.gem/credentials
|
59
|
+
|
60
|
+
- name: Publish gem
|
61
|
+
run: |
|
62
|
+
gem build puma-plugin-telemetry.gemspec
|
63
|
+
gem push puma-plugin-telemetry-*.gem
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [1.1.2]
|
11
|
+
|
12
|
+
- Add Puma 6 compatibility
|
13
|
+
## [1.1.1]
|
14
|
+
|
15
|
+
Public release.
|
16
|
+
|
10
17
|
## [1.1.0]
|
11
18
|
|
12
19
|
Out of beta testing, reading for usage. Following is a recap from Alpha & Beta releases.
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puma-plugin-telemetry (1.1.
|
5
|
-
puma (
|
4
|
+
puma-plugin-telemetry (1.1.2)
|
5
|
+
puma (< 7)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
parallel (1.22.1)
|
15
15
|
parser (3.1.2.0)
|
16
16
|
ast (~> 2.4.1)
|
17
|
-
puma (
|
17
|
+
puma (6.0.1)
|
18
18
|
nio4r (~> 2.0)
|
19
19
|
rack (2.2.3.1)
|
20
20
|
rainbow (3.1.1)
|
@@ -64,4 +64,4 @@ DEPENDENCIES
|
|
64
64
|
rubocop-performance (~> 1.9)
|
65
65
|
|
66
66
|
BUNDLED WITH
|
67
|
-
2.
|
67
|
+
2.3.12
|
data/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Puma::Plugin::Telemetry
|
2
2
|
|
3
|
-
Puma plugin
|
3
|
+
Puma plugin which should be able to handle all your metric needs regarding your webserver:
|
4
|
+
|
5
|
+
- ability to publish basic puma statistics (like queue backlog) to both logs and datadog
|
6
|
+
- ability to add custom target whenever you need it
|
7
|
+
- ability to monitor puma socket listen queue (!)
|
8
|
+
- ability to report requests queue time via custom rack middleware - the time request spent between being accepted by Load Balancer and start of its processing by Puma worker
|
4
9
|
|
5
10
|
## Install
|
6
11
|
|
@@ -63,13 +63,14 @@ module Puma
|
|
63
63
|
#
|
64
64
|
module PluginInstanceMethods
|
65
65
|
def start(launcher)
|
66
|
+
@launcher = launcher
|
67
|
+
|
66
68
|
unless Puma::Plugin::Telemetry.config.enabled?
|
67
|
-
|
69
|
+
log_writer.log 'plugin=telemetry msg="disabled, exiting..."'
|
68
70
|
return
|
69
71
|
end
|
70
72
|
|
71
|
-
|
72
|
-
@launcher.events.log 'plugin=telemetry msg="enabled, setting up runner..."'
|
73
|
+
log_writer.log 'plugin=telemetry msg="enabled, setting up runner..."'
|
73
74
|
|
74
75
|
in_background do
|
75
76
|
sleep Puma::Plugin::Telemetry.config.initial_delay
|
@@ -79,13 +80,13 @@ module Puma
|
|
79
80
|
|
80
81
|
def run!
|
81
82
|
loop do
|
82
|
-
|
83
|
+
log_writer.debug 'plugin=telemetry msg="publish"'
|
83
84
|
|
84
85
|
call(Puma::Plugin::Telemetry.build(@launcher))
|
85
86
|
rescue Errno::EPIPE
|
86
87
|
# Occurs when trying to output to STDOUT while puma is shutting down
|
87
88
|
rescue StandardError => e
|
88
|
-
|
89
|
+
log_writer.error "plugin=telemetry err=#{e.class} msg=#{e.message.inspect}"
|
89
90
|
ensure
|
90
91
|
sleep Puma::Plugin::Telemetry.config.frequency
|
91
92
|
end
|
@@ -96,6 +97,16 @@ module Puma
|
|
96
97
|
target.call(telemetry)
|
97
98
|
end
|
98
99
|
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def log_writer
|
104
|
+
if Puma::Const::PUMA_VERSION.to_i < 6
|
105
|
+
@launcher.events
|
106
|
+
else
|
107
|
+
@launcher.log_writer
|
108
|
+
end
|
109
|
+
end
|
99
110
|
end
|
100
111
|
end
|
101
112
|
end
|
@@ -2,16 +2,25 @@
|
|
2
2
|
|
3
3
|
require_relative 'lib/puma/plugin/telemetry/version'
|
4
4
|
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
5
|
+
Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
6
|
+
spec.name = 'puma-plugin-telemetry'
|
7
|
+
spec.version = Puma::Plugin::Telemetry::VERSION
|
8
|
+
spec.authors = ['Leszek Zalewski']
|
9
|
+
spec.email = ['tnt@babbel.com']
|
10
10
|
|
11
|
-
spec.license
|
11
|
+
spec.license = 'MIT'
|
12
12
|
|
13
13
|
spec.summary = 'Puma plugin, adding ability to publish various metrics to your prefered targets.'
|
14
|
-
spec.
|
14
|
+
spec.description = <<~TXT
|
15
|
+
Puma plugin which should be able to handle all your metric needs regarding your webserver:
|
16
|
+
|
17
|
+
- ability to publish basic puma statistics (like queue backlog) to both logs and datadog
|
18
|
+
- ability to add custom target whenever you need it
|
19
|
+
- ability to monitor puma socket listen queue (!)
|
20
|
+
- ability to report requests queue time via custom rack middleware - the time request spent between being accepted by Load Balancer and start of its processing by Puma worker
|
21
|
+
TXT
|
22
|
+
|
23
|
+
spec.homepage = 'https://github.com/babbel/puma-plugin-telemetry'
|
15
24
|
|
16
25
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
|
17
26
|
|
@@ -30,5 +39,5 @@ Gem::Specification.new do |spec|
|
|
30
39
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
40
|
spec.require_paths = ['lib']
|
32
41
|
|
33
|
-
spec.add_dependency 'puma', '
|
42
|
+
spec.add_dependency 'puma', '< 7'
|
34
43
|
end
|
metadata
CHANGED
@@ -1,30 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma-plugin-telemetry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leszek Zalewski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puma
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "<"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
description:
|
26
|
+
version: '7'
|
27
|
+
description: |
|
28
|
+
Puma plugin which should be able to handle all your metric needs regarding your webserver:
|
29
|
+
|
30
|
+
- ability to publish basic puma statistics (like queue backlog) to both logs and datadog
|
31
|
+
- ability to add custom target whenever you need it
|
32
|
+
- ability to monitor puma socket listen queue (!)
|
33
|
+
- ability to report requests queue time via custom rack middleware - the time request spent between being accepted by Load Balancer and start of its processing by Puma worker
|
28
34
|
email:
|
29
35
|
- tnt@babbel.com
|
30
36
|
executables: []
|
@@ -81,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '0'
|
83
89
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
90
|
+
rubygems_version: 3.0.3
|
85
91
|
signing_key:
|
86
92
|
specification_version: 4
|
87
93
|
summary: Puma plugin, adding ability to publish various metrics to your prefered targets.
|