instana 1.206.0 → 1.207.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01f078ad2a63d8cd71303a9bf7b413209eda0b2f464ce72f88c84ae05bf797da
|
4
|
+
data.tar.gz: d547946bdbb52ea3c3c3a7fc317f7bcd2dd8ccf37d52507788bff1b85fc4434c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3a3926477ab6842628f7fe1062655e63760c0fc1e5100912c8191f5894b8b4dabb1e030441b0b924d379bd6be56a9b69e877c22220153acba3393af59e4b51
|
7
|
+
data.tar.gz: 05fd9a76497614afca946d9538577bdfda21bd3a901759b285d7033425610206fd5a88405f86e86d52928da8f9324798cbf579bb516d845a8749f7c000d98fdf
|
@@ -102,17 +102,27 @@ module Instana
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def metrics_payload(discovery)
|
105
|
-
|
106
|
-
process = ProcessInfo.new(proc_table)
|
107
|
-
|
108
|
-
{
|
105
|
+
payload = {
|
109
106
|
pid: discovery['pid'],
|
110
|
-
name: Util.get_app_name
|
111
|
-
exec_args: process.arguments,
|
112
|
-
gc: GCSnapshot.instance.report,
|
113
|
-
thread: {count: ::Thread.list.count},
|
114
|
-
memory: {rss_size: process.memory_used}
|
107
|
+
name: Util.get_app_name
|
115
108
|
}
|
109
|
+
|
110
|
+
if ::Instana.config[:metrics][:memory][:enabled]
|
111
|
+
proc_table = Sys::ProcTable.ps(pid: Process.pid)
|
112
|
+
process = ProcessInfo.new(proc_table)
|
113
|
+
payload[:exec_args] = process.arguments
|
114
|
+
payload[:memory] = {rss_size: process.memory_used}
|
115
|
+
end
|
116
|
+
|
117
|
+
if ::Instana.config[:metrics][:gc][:enabled]
|
118
|
+
payload[:gc] = GCSnapshot.instance.report
|
119
|
+
end
|
120
|
+
|
121
|
+
if ::Instana.config[:metrics][:thread][:enabled]
|
122
|
+
payload[:thread] = {count: ::Thread.list.count}
|
123
|
+
end
|
124
|
+
|
125
|
+
payload
|
116
126
|
end
|
117
127
|
end
|
118
128
|
end
|
data/lib/instana/version.rb
CHANGED
@@ -127,6 +127,75 @@ class HostAgentReportingObserverTest < Minitest::Test
|
|
127
127
|
::Instana.config[:metrics][:enabled] = true
|
128
128
|
end
|
129
129
|
|
130
|
+
def test_disable_metrics_memory
|
131
|
+
::Instana.config[:metrics][:memory][:enabled] = false
|
132
|
+
|
133
|
+
stub_request(:post, "http://10.10.10.10:9292/tracermetrics")
|
134
|
+
.to_return(status: 200)
|
135
|
+
|
136
|
+
stub_request(:post, "http://10.10.10.10:9292/com.instana.plugin.ruby.0")
|
137
|
+
.with(body: ->(data) { (JSON.parse(data).keys & ['exec_args', 'memory']).length.eql?(0) })
|
138
|
+
.to_return(status: 200)
|
139
|
+
|
140
|
+
stub_request(:post, "http://10.10.10.10:9292/com.instana.plugin.ruby/traces.0")
|
141
|
+
.to_return(status: 200)
|
142
|
+
|
143
|
+
client = Instana::Backend::RequestClient.new('10.10.10.10', 9292)
|
144
|
+
discovery = Concurrent::Atom.new({'pid' => 0})
|
145
|
+
|
146
|
+
subject = Instana::Backend::HostAgentReportingObserver.new(client, discovery, timer_class: MockTimer)
|
147
|
+
|
148
|
+
subject.report_timer.block.call
|
149
|
+
ensure
|
150
|
+
::Instana.config[:metrics][:memory][:enabled] = true
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_disable_gc
|
154
|
+
::Instana.config[:metrics][:gc][:enabled] = false
|
155
|
+
|
156
|
+
stub_request(:post, "http://10.10.10.10:9292/tracermetrics")
|
157
|
+
.to_return(status: 200)
|
158
|
+
|
159
|
+
stub_request(:post, "http://10.10.10.10:9292/com.instana.plugin.ruby.0")
|
160
|
+
.with(body: ->(data) { (JSON.parse(data).keys & ['gc']).length.eql?(0) })
|
161
|
+
.to_return(status: 200)
|
162
|
+
|
163
|
+
stub_request(:post, "http://10.10.10.10:9292/com.instana.plugin.ruby/traces.0")
|
164
|
+
.to_return(status: 200)
|
165
|
+
|
166
|
+
client = Instana::Backend::RequestClient.new('10.10.10.10', 9292)
|
167
|
+
discovery = Concurrent::Atom.new({'pid' => 0})
|
168
|
+
|
169
|
+
subject = Instana::Backend::HostAgentReportingObserver.new(client, discovery, timer_class: MockTimer)
|
170
|
+
|
171
|
+
subject.report_timer.block.call
|
172
|
+
ensure
|
173
|
+
::Instana.config[:metrics][:gc][:enabled] = true
|
174
|
+
end
|
175
|
+
|
176
|
+
def test_disable_thread
|
177
|
+
::Instana.config[:metrics][:thread][:enabled] = false
|
178
|
+
|
179
|
+
stub_request(:post, "http://10.10.10.10:9292/tracermetrics")
|
180
|
+
.to_return(status: 200)
|
181
|
+
|
182
|
+
stub_request(:post, "http://10.10.10.10:9292/com.instana.plugin.ruby.0")
|
183
|
+
.with(body: ->(data) { (JSON.parse(data).keys & ['thread']).length.eql?(0) })
|
184
|
+
.to_return(status: 200)
|
185
|
+
|
186
|
+
stub_request(:post, "http://10.10.10.10:9292/com.instana.plugin.ruby/traces.0")
|
187
|
+
.to_return(status: 200)
|
188
|
+
|
189
|
+
client = Instana::Backend::RequestClient.new('10.10.10.10', 9292)
|
190
|
+
discovery = Concurrent::Atom.new({'pid' => 0})
|
191
|
+
|
192
|
+
subject = Instana::Backend::HostAgentReportingObserver.new(client, discovery, timer_class: MockTimer)
|
193
|
+
|
194
|
+
subject.report_timer.block.call
|
195
|
+
ensure
|
196
|
+
::Instana.config[:metrics][:thread][:enabled] = true
|
197
|
+
end
|
198
|
+
|
130
199
|
def test_disable_tracing
|
131
200
|
::Instana.config[:tracing][:enabled] = false
|
132
201
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.207.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Giacomo Lombardo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|