site24x7_apminsight 1.9.1 → 1.9.2

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: 6adf1511641c4e23c0e5f0a0ac71336dd62c4fe0ee23b0df46b07e804c74841a
4
- data.tar.gz: 1d5dcaa91fd5e185f3592c86f686af35f33d20918297ef0f1d2deeaffa5a5c7b
3
+ metadata.gz: 61471f26922c97dccfc1294d9565f8be9009b4031c6b75a41f776628c3a6295e
4
+ data.tar.gz: 0d34c97c8a0501b9c655fddd09decaf45c26c5be5e08c82a4046ac229a144fd4
5
5
  SHA512:
6
- metadata.gz: 7a01e038e40a5656c0c62dd353dcb5c118bc071312612aef245fdf1d2edcf2ae4a6dded206406febda1f029b42a961b5b75758565758938dc5ee77a7e837b92c
7
- data.tar.gz: 80d84c7ba2f6095adb9050040283a788242d94f7ad9e00b9141b76addbb88123fa16027de9af33723bd3a60daa9e5a01c4a75b5ea0205a0d3c009aed7f23ca3c
6
+ metadata.gz: 99cf966c504848406f8d870eadaa1947eb91af4278b864073a4820a237038ba68606524188102110d2eaef7a395e2e0ebcaa1be97c746ceb23ad64037997a5b8
7
+ data.tar.gz: 3ac8d504af5ed03b369ca08ff48158d6407e80f07153476647a0698f32fa90c01e05736cbf7811c9b78f11d4109c8fb2f470c5d8f5ad9ec7232f2667c611c875
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- This License Agreement details the policy for license of ManageEngine APM Insight Ruby Agent ("Licensed Software")
1
+ This License Agreement details the policy for license of Site24x7 APM Insight Ruby Agent ("Licensed Software")
2
2
  Please read the following license carefully, before either (i) downloading the Licensed Software from an authorized website, or (ii) installing the Licensed Software. You acknowledge that you have read this License Agreement, have understood it, and agree to be bound by its terms. If you do not agree to the terms and conditions of this Agreement, do not download or install the Licensed Software.
3
3
 
4
4
  1. LICENSE GRANT
data/README.rdoc CHANGED
@@ -1,5 +1,5 @@
1
1
  APM Insight Ruby Agent
2
- Applications Manager's Ruby agent gives you end-to-end web-transaction awareness enabling you to isolate performance issues and resolve them quickly.Applications Manager requires a monitoring agent (ruby gem) to be deployed in your application server to monitor Ruby application performance. Download the latest Ruby Agent(apminsight.gem) and deploy it in your application server. The agent collects application performance metrics and sends it to the central Applications Manager server at fixed intervals i.e. every 60 seconds.
2
+ Site24x7 APM Insight Ruby agent gives you end-to-end web-transaction awareness enabling you to isolate performance issues and resolve them quickly. Site24x7 APM Insight requires a monitoring agent (ruby gem) to be deployed in your application server to monitor Ruby application performance. Download the latest Ruby Agent(site24x7_apminsight.gem) and deploy it in your application server. The agent collects application performance metrics and sends it to the central Site24x7 server at fixed intervals i.e. every 60 seconds. You can view them at https://site24x7.com in your accounts page.
3
3
 
4
4
  Installing APM Insight Agent
5
5
 
@@ -7,13 +7,13 @@ Installing APM Insight Agent
7
7
 
8
8
  * Install from RubyGems by using the following command in the system where Ruby is installed :
9
9
 
10
- gem install apminsight
10
+ gem install site24x7_apminsight
11
11
 
12
12
  OR
13
13
 
14
- * Download the apminsight.gem file directly from our website or the RubyGems website and run the command
14
+ * Download the site24x7_apminsight.gem file from your accounts page in https://site24x7.com (after sign in) or the RubyGems website and run the command
15
15
 
16
- gem install apminsight.gem
16
+ gem install site24x7_apminsight.gem
17
17
 
18
18
  Configuration
19
19
 
@@ -21,30 +21,28 @@ Configuration
21
21
 
22
22
  For each of your applications, add the following line to the application gemfile:
23
23
 
24
- gem 'apminsight'
24
+ gem 'site24x7_apminsight'
25
25
 
26
26
  OR
27
27
 
28
28
  For each of your applications, add the following line to the application initializer block:
29
29
 
30
- require 'apminsight'
30
+ require 'site24x7_apminsight'
31
31
 
32
- A copy of the configuration file apminsight.conf will be available in the <Gem Installed folder> /apminsight/conf/. Configure the class name in the configuration file(include.packages), so that all the methods in that class can be instrumented and details will be reported in tracedata.
32
+ A copy of the configuration file apminsight.conf will be available in the <Gem Installed folder> /site24x7_apminsight/conf/. Configure the class name in the configuration file(include.packages), so that all the methods in that class can be instrumented and details will be reported in tracedata.
33
33
 
34
34
 
35
35
  The following configuration options are mandatory and should be provided for the agent to be initialized:
36
36
 
37
- application.name - The application's name to be displayed in Applications Manager.
37
+ application.name - The application's name to be displayed in Site24x7 server.
38
38
 
39
- apm.host - The host where Applications Manager is running.
40
-
41
- apm.port - The HTTP port of Applications Manager.
39
+ license.key - The license api key from your account page after sign in (https://site24x7.com)
42
40
 
43
41
  behind.proxy - The proxy network under which the agent is installed
44
42
 
45
43
  agent.server.port - The HTTP listening port of the Application Server.
46
44
 
47
- More configuration options of APM Insight Ruby Agent can be found here.
45
+ More configuration options of APM Insight Ruby Agent can be found here. https://www.site24x7.com/help/apm/apm-insight-configuration.html
48
46
 
49
47
  Supported Environments :
50
48
 
@@ -54,16 +52,16 @@ Supported Environments :
54
52
 
55
53
  References
56
54
 
57
- * Download link for Applications Manager
58
-
59
- http://www.manageengine.com/products/applications_manager/
55
+ * Create an apminsight account in Site24x7 server (https://www.site24x7.com)
60
56
 
61
- * Download link for apminsight
57
+ * Download link for site24x7_apminsight gem
62
58
 
63
- http://www.manageengine.com/products/applications_manager/
64
- http://rubygems.org/gems/apminsight
59
+ From your account page after valid sign in
60
+ or
61
+ http://rubygems.org/gems/site24x7_apminsight
65
62
 
66
63
  * Help Documentation for apminsight
67
64
 
68
- http://www.manageengine.com/products/applications_manager/help/APMInsight/installing-transaction-agent.html
69
-
65
+ https://www.site24x7.com/help/apm/ruby-agent.html
66
+ https://support.site24x7.com/portal/helpcenter/site24x7/apm-insight/ruby-monitoring
67
+
data/Rakefile CHANGED
@@ -14,13 +14,13 @@ require 'rake'
14
14
  require 'jeweler'
15
15
  Jeweler::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "apminsight"
18
- gem.homepage = "http://www.manageengine.com/products/applications_manager/ruby-webtransaction-monitoring.html"
17
+ gem.name = "site24x7_apminsight"
18
+ gem.homepage = "https://www.site24x7.com/help/apm/ruby-agent.html"
19
19
  gem.license = "MIT"
20
20
  gem.summary = %Q{Application Performace Monitor}
21
21
  gem.description = %Q{Application Performace Monitor : Monitor the web tranasactions}
22
22
  gem.email = "apm-insight@zohocorp.com"
23
- gem.authors = ["Sabarinathan P"]
23
+ gem.authors = ["Rajalakshmi Ezhilan"]
24
24
  gem.files=Dir.glob('lib/**/*.*')
25
25
  # dependencies defined in Gemfile
26
26
  end
@@ -48,7 +48,7 @@ Rake::RDocTask.new do |rdoc|
48
48
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
49
 
50
50
  rdoc.rdoc_dir = 'rdoc'
51
- rdoc.title = "apminsight #{version}"
51
+ rdoc.title = "site24x7_apminsight #{version}"
52
52
  rdoc.rdoc_files.include('README*')
53
53
  rdoc.rdoc_files.include('lib/**/*.*')
54
54
  rdoc.rdoc_files.include('lib/agent/**/*.*')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.2
1
+ 1.8.2
@@ -267,6 +267,28 @@ module ManageEngine
267
267
  end
268
268
 
269
269
  def getHostType
270
+ begin
271
+ # Checking for OpenShift
272
+ if (ENV.has_key?('OPENSHIFT_BUILD_NAMESPACE'))
273
+ @obj.log.info "Agent is hosted in OpenShift"
274
+ @hostType = "DOCKER"
275
+ return @hostType
276
+ end
277
+ # Checking for k8s env
278
+ if (ENV.has_key?('KUBERNETES_SERVICE_HOST'))
279
+ @obj.log.info "Agent is hosted in Kubernetes"
280
+ @hostType = "DOCKER"
281
+ return @hostType
282
+ end
283
+ # Checking for Docker
284
+ if (File.exist?('/.dockerenv') || File.read('/proc/1/cgroup').include?('docker'))
285
+ @obj.log.info "Agent is hosted in DOCKER"
286
+ @hostType = "DOCKER"
287
+ return @hostType
288
+ end
289
+ rescue Exception => e
290
+ end
291
+
270
292
  begin
271
293
  # Check for AWS environment
272
294
  url = URI.parse('http://169.254.169.254/latest/meta-data/') # AWS metadata url
@@ -275,6 +297,20 @@ module ManageEngine
275
297
  if (response.kind_of? Net::HTTPOK)
276
298
  @hostType = "AWS"
277
299
  return @hostType
300
+ elsif (response.kind_of? Net::HTTPUnauthorized)
301
+ uri = URI('http://169.254.169.254/latest/api/token')
302
+ request = Net::HTTP::Put.new(uri)
303
+ request['X-aws-ec2-metadata-token-ttl-seconds'] = '30'
304
+ response = Net::HTTP.start(uri.hostname, uri.port) {|http| http.request(request)}
305
+ token = response.body
306
+ url = URI.parse('http://169.254.169.254/latest/meta-data/instance-id') # AWS metadata url
307
+ request = Net::HTTP::Get.new(url.path)
308
+ request['X-aws-ec2-metadata-token'] = token
309
+ response = Net::HTTP.start(url.host, url.port, :read_timeout => 2) {|http| http.request(request)}
310
+ if (response.kind_of? Net::HTTPOK)
311
+ @hostType = "AWS"
312
+ return @hostType
313
+ end
278
314
  end
279
315
  rescue Exception => e
280
316
  end
@@ -294,6 +330,7 @@ module ManageEngine
294
330
  begin
295
331
  # Check for Heroku env. In the backgroud it is using AWS EC2, hence sending as AWS
296
332
  if (ENV.has_key?('DYNO') || ENV.has_key?('STACK'))
333
+ @obj.log.info "Agent is hosted in Heroku"
297
334
  @hostType = "AWS"
298
335
  return @hostType
299
336
  end
@@ -107,8 +107,8 @@ module ManageEngine
107
107
 
108
108
 
109
109
  def logException(msg,e)
110
- @apmlog.warn( "#{msg} => #{e.message}")
111
- @apmlog.warn( "Message : #{msg}\nTrace :\n#{e.backtrace}")
110
+ @apmlog.warn( "#{msg} => #{e.message} => #{e.backtrace}")
111
+ #@apmlog.warn( "Message : #{msg}\nTrace :\n#{e.backtrace}")
112
112
  end
113
113
 
114
114
  def close
@@ -24,8 +24,6 @@ module ManageEngine
24
24
  'Rails'
25
25
  end
26
26
 
27
- # https://edgeguides.rubyonrails.org/active_support_instrumentation.html#rails-framework-hooks
28
-
29
27
  def instrument
30
28
  @obj = ManageEngine::APMObjectHolder.instance
31
29
  @obj.log.info "Instrumenting ActionController.. Rails Version: #{version}"
@@ -33,9 +31,6 @@ module ManageEngine
33
31
 
34
32
  ActiveSupport::Notifications.subscribe('start_processing.action_controller') do |name, start, finish, id, payload|
35
33
  path = payload[:path].partition("?")[0]
36
- # request = payload[:request]
37
- # request.original_url => returns http://www.example.com/articles?page=2
38
- # request.request_method
39
34
  @railsTracker = ManageEngine::Tracker::RootTracker.new("#{payload[:controller]}.#{payload[:action]}", start.to_f * 1000)
40
35
  @railsTracker.url=(path)
41
36
  @railsTracker = ManageEngine::Agent::TrackerHandler.invokeTracker(@railsTracker)
@@ -48,7 +43,6 @@ module ManageEngine
48
43
  exception = payload[:exception_object]
49
44
  if exception != nil
50
45
  @railsTracker.setError(exception)
51
- # TODO: payload[:status]
52
46
  @railsTracker.setStatus(500) # By default, set 500 as status for error txns
53
47
  end
54
48
  ManageEngine::Agent::TrackerHandler.exitTracker(@railsTracker)
@@ -265,7 +265,18 @@ class APMWorker
265
265
  rtData[7] = rtData[7]+dat[0][7]
266
266
  rtData[4] = rtData[3] != 0 ? (rtData[5].to_f + (rtData[6].to_f/2).to_f).to_f/rtData[3].to_f : 0
267
267
  res[0] = rtData
268
- res[1][@obj.constants.error_rt] += dat[1][@obj.constants.error_rt]
268
+
269
+ # error_rt merge
270
+ res_error_rt = res[1][@obj.constants.error_rt];
271
+ dat_error_rt = dat[1][@obj.constants.error_rt];
272
+ if (res_error_rt != nil)
273
+ if (dat_error_rt != nil)
274
+ res[1][@obj.constants.error_rt] = res_error_rt + dat_error_rt;
275
+ end
276
+ elsif (dat_error_rt != nil)
277
+ res[1][@obj.constants.error_rt] = dat_errror_rt;
278
+ end
279
+
269
280
  resExcepData = res[1][@obj.constants.mf_logmetric]
270
281
  excepData = dat[1][@obj.constants.mf_logmetric]
271
282
  if (resExcepData == nil)
@@ -296,7 +307,18 @@ class APMWorker
296
307
  rtData[3] = rtData[3]+dat[0][3]
297
308
  rtData[4] = rtData[4]+dat[0][4]
298
309
  res[0] = rtData
299
- res[1][@obj.constants.error_rt] += dat[1][@obj.constants.error_rt]
310
+
311
+ # error_rt merge
312
+ res_error_rt = res[1][@obj.constants.error_rt];
313
+ dat_error_rt = dat[1][@obj.constants.error_rt];
314
+ if (res_error_rt != nil)
315
+ if (dat_error_rt != nil)
316
+ res[1][@obj.constants.error_rt] = res_error_rt + dat_errror_rt;
317
+ end
318
+ elsif (dat_error_rt != nil)
319
+ res[1][@obj.constants.error_rt] = dat_errror_rt;
320
+ end
321
+
300
322
  resExcepData = res[1][@obj.constants.mf_logmetric]
301
323
  excepData = dat[1][@obj.constants.mf_logmetric]
302
324
  if (resExcepData == nil)
@@ -48,10 +48,28 @@ module ManageEngine
48
48
 
49
49
  begin
50
50
  tableName = case sqlArr[0]
51
- when "select" then sqlArr[sqlArr.index("from")+1]
52
- when "insert" then sqlArr[sqlArr.index("into")+1]
51
+ when "select" then
52
+ fromIndex = sqlArr.index("from");
53
+ if(fromIndex != nil)
54
+ sqlArr[fromIndex+1]
55
+ else
56
+ "-"
57
+ end
58
+ when "insert" then
59
+ intoIndex = sqlArr.index("into");
60
+ if(intoIndex != nil)
61
+ sqlArr[intoIndex+1]
62
+ else
63
+ "-"
64
+ end
53
65
  when "update" then sqlArr[1]
54
- when "delete" then sqlArr[sqlArr.index("from")+1]
66
+ when "delete" then
67
+ fromIndex = sqlArr.index("from");
68
+ if(fromIndex != nil)
69
+ sqlArr[fromIndex+1]
70
+ else
71
+ "-"
72
+ end
55
73
  when "create" then sqlArr[1] + sqlArr[2]
56
74
  when "alter" then sqlArr[1] + sqlArr[2]
57
75
  when "drop" then sqlArr[1] + sqlArr[2]
data/lib/agent/version.rb CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  module ManageEngine
8
8
  class APMInsight
9
- VERSION = '1.9.1'
9
+ VERSION = '1.9.2'
10
10
  MAJOR_VERSION = '1.9'
11
- MINOR_VERSION = '1'
11
+ MINOR_VERSION = '2'
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site24x7_apminsight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adithyan P
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-26 00:00:00.000000000 Z
11
+ date: 2024-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda
@@ -97,7 +97,6 @@ files:
97
97
  - README.rdoc
98
98
  - Rakefile
99
99
  - VERSION
100
- - conf/apminsight.conf
101
100
  - lib/agent/am_objectholder.rb
102
101
  - lib/agent/api/custom_tracker.rb
103
102
  - lib/agent/configuration/am_configuration.rb
@@ -135,7 +134,7 @@ files:
135
134
  homepage: https://www.site24x7.com/help/apm/ruby-agent.html
136
135
  licenses: []
137
136
  metadata: {}
138
- post_install_message:
137
+ post_install_message:
139
138
  rdoc_options: []
140
139
  require_paths:
141
140
  - lib
@@ -150,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
149
  - !ruby/object:Gem::Version
151
150
  version: '0'
152
151
  requirements: []
153
- rubygems_version: 3.0.0
154
- signing_key:
152
+ rubygems_version: 3.3.7
153
+ signing_key:
155
154
  specification_version: 3
156
155
  summary: Site24x7 APMInsight gives you end-to-end web-transaction awareness of Rails
157
156
  applications enabling you to isolate performance issues and resolve them quickly.
data/conf/apminsight.conf DELETED
@@ -1,86 +0,0 @@
1
- # $Id$
2
- #
3
- ################### APM Insight Agent Configuration File ###################
4
- #
5
- #This file contains configuration options for APM Insight agent installation in your Application Server.
6
- #
7
- #NOTE: Though the properties can be defined in any different order, it is advisable to maintain
8
- #the below order for related properties and ease of reference.
9
- #
10
- #All the configuration options defaults to factory configuration if commented or not supported values
11
-
12
- #License key of your Site24x7 APM Insight account.
13
- license.key=
14
-
15
- #Logical name of your application. Say for example you have "Order Processing" applications running in
16
- #10 instances of Tomcat server. Specify the name as "Order Processing" for the name in all the 10
17
- #instances while deploying the agent. Site24x7 will group the data from 10 instances of
18
- #Tomcat and provide response time, throughput etc.
19
- application.name=My Application
20
-
21
- #APM Insight agent communicates to the Site24x7 through the HTTP/HTTPS protocol.
22
- #Specify Proxy server configuration when there is a proxy server between APM Insight agent and
23
- #Site24x7 server.
24
- #
25
- behind.proxy=false
26
- #proxy.server.host=proxyserver
27
- #proxy.server.port=proxyport
28
- #proxy.auth.username=proxyuser
29
- #proxy.auth.password=proxypassword
30
-
31
- #Application Server HTTP/HTTPS listening port.Say for example when you are deploying the agent in Tomcat
32
- #Server running in 8080 port, specify the value as 8080.
33
- #[Mandatory]
34
- agent.server.port=8080
35
-
36
- #The Apdex (Application Performance Index) threshold is used to calculate application performance score.
37
- #More at http://www.apdex.org.
38
- #A Transaction is said to be satisfied, if the response time is equal to or below the apdex.threshold.
39
- #A Transaction is said to be tolerating, if the response time is greater than apdex.threshold and less
40
- #than 4 times of apdex.threshold. A Transaction is said to be frustrated, if the response time is greater
41
- #than 4 times of apdex.threshold. Say for example when you specify the value as 2, transactions with response
42
- #time less than 2 seconds is considered as satisfied, transactions with response time greater than 2 and
43
- #less than 8 is considered as tolerating and transactions with response time greater than 8 seconds is
44
- #considered as frustrating.
45
- #default value: 0.5 (second)
46
- apdex.threshold=0.5
47
-
48
- #Whether SQL queries getting executed in your application need to be tracked or not.
49
- #default value: true
50
- sql.capture.enabled=true
51
-
52
- #Whether the transaction trace is enabled or not. Setting this value to true will send the trace of the
53
- #slow transaction.
54
- #default value: true
55
- transaction.trace.enabled=true
56
-
57
- #Threshold to construct the trace for slow transactions. Transaction Traces violating this threshold will be
58
- #collected and sent to the server. Used to analyze and troubleshoot the Transaction by the user.
59
- #default value: 2 (second)
60
- transaction.trace.threshold=2
61
-
62
- #Enabling this option will parametrize all SQL Queries in Slow Transaction Traces (if sql.capture.enabled
63
- #set to true & transaction.trace.enabled set to true). Disabling this option will give you the real query
64
- #with actual parameters. It is recommended to enable this option if there are queries getting executed
65
- #using confidential parameters like credit card number, passwords, etc.
66
- #default value: true
67
- transaction.trace.sql.parametrize=true
68
-
69
- #Threshold value to generate a stack trace to identify the caller who executed a slow query. This stack
70
- #trace is sent to the server for the user to analyze and troubleshoot
71
- #default value: 3 (second)
72
- transaction.trace.sql.stacktrace.threshold=3
73
-
74
- #Stop listening transactions with specified URL pattern.
75
- transaction.skip.listening=*.css, *.js, *.gif, *.jpg, *.jpeg, *.bmp, *.png, *.ico
76
-
77
- #Directory where agent logs information separately.
78
- #Defaults to the directory where apminsight-javaagent.jar is installed.
79
- #Use forward slash(/) as path separator.
80
- #apminsight.log.dir=./apminsight/logs
81
-
82
- #The log level at which the APM Insight agent should record logging
83
- #information. The levels are SEVERE, WARNING, INFO, FINE in the order
84
- #respectively. Defaults to the level INFO if commented or mentioned
85
- #incorrectly.
86
- apminsight.log.level=INFO