site24x7_apminsight 1.1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.2
@@ -52,18 +52,22 @@ module ManageEngine
52
52
  @obj.log.debug "Config File Exists. It is read from #{@obj.constants.apm_conf}"
53
53
  @config = @obj.util.readProperties(@obj.constants.apm_conf)
54
54
  else
55
- gem_conf = Gem.loaded_specs[@obj.constants.apm_gem].full_gem_path
55
+ gemSpecs = Gem.loaded_specs[@obj.constants.s247_apm_gem]
56
+ if (gemSpecs == nil)
57
+ gemSpecs = Gem.loaded_specs[@obj.constants.apm_gem]
58
+ end
59
+ gem_conf = gemSpecs.full_gem_path
56
60
  #gem_conf = File.join(gem_conf, 'lib')
57
61
  gem_conf = File.join(gem_conf, 'conf')
58
62
  gem_conf = File.join(gem_conf, 'apminsight.conf')
59
63
  #conf file not exists in APPlications Home. So 1. copy it for gem locations
60
64
  if @obj.util.copyFiles gem_conf,@obj.constants.apm_conf
61
65
  #copied sucessfully
62
- @obj.log.debug "Config File copied. It is read from #{@obj.constants.apm_conf}"
66
+ @obj.log.info "Config File copied to application home directory. It is read from #{@obj.constants.apm_conf}"
63
67
  @config = @obj.util.readProperties(@obj.constants.apm_conf)
64
68
  else
65
69
  #Problem in copying, so reading props from Conf file in Gem Location
66
- @obj.log.debug "Config File not copied. It is read from #{gem_conf}"
70
+ @obj.log.warn "Config File not copied. It is read from #{gem_conf}"
67
71
  @config = @obj.util.readProperties(gem_conf)
68
72
  end
69
73
  end
@@ -80,7 +84,17 @@ module ManageEngine
80
84
  if FileTest.exists?(@obj.constants.agent_conf)
81
85
  @obj.log.debug "Status : Agent Already Connected"
82
86
  props = @obj.util.readProperties(@obj.constants.agent_conf)
83
- @instance_id = props["agent.id"]
87
+ instance_id = props["agent.id"]
88
+
89
+ if (instance_id == nil || instance_id == "")
90
+ # If instance id is not found or empty, it means the apminsight.info is being modified by user
91
+ # Ignore all its entry
92
+ @obj.log.warn "File: #{@obj.constants.agent_conf} is corrupted. Agent will continue ignoring these values."
93
+ return false
94
+ else
95
+ @instance_id = instance_id
96
+ end
97
+
84
98
  @agent_enabled= @obj.util.getBooleanValue props["agent.enabled"]
85
99
  true
86
100
  else
@@ -145,9 +159,15 @@ module ManageEngine
145
159
  value = checkAndGetEnvValue(value)
146
160
  case key
147
161
  when "application.name" then @appname=value
162
+ if (ENV.has_key?('APM_APPLICATION_NAME'))
163
+ @appname = ENV['APM_APPLICATION_NAME']
164
+ end
148
165
  when "apm.host" then @apmhost=value
149
166
  when "apm.port" then @apmport=isInteger(@apmport,value)
150
167
  when "license.key" then @license_key=value
168
+ if (@license_key.empty? && ENV.has_key?('S247_LICENSE_KEY'))
169
+ @license_key = ENV['S247_LICENSE_KEY']
170
+ end
151
171
  when "behind.proxy" then @proxyneeded=@obj.util.getBooleanValue value
152
172
  when "agent.server.port" then @agentport=isInteger(@agentport,value)
153
173
  when "apdex.threshold" then @apdex_t=isFloat(@apdex_t,value)
@@ -501,14 +501,20 @@ module ManageEngine
501
501
  if(arr["name"]=="start_processing.action_controller")
502
502
  traceArr = updateStartTrace arr
503
503
  traceArr[6] = Array.new #childs
504
- if stack.size()>0
505
- cur = stack[stack.size()-1]
506
- c = cur[6]
507
- c.push(traceArr)
508
- cur[6] = c
504
+ # if stack.size()>0
505
+ # cur = stack[stack.size()-1]
506
+ # c = cur[6]
507
+ # c.push(traceArr)
508
+ # cur[6] = c
509
+ # end
510
+ # stack.push(traceArr)
511
+
512
+ # Incase there are multiple "start_processing" event consider only the last notification
513
+ if stack.size == 0
514
+ stack.push(traceArr)
515
+ else
516
+ stack[stack.size()-1] = traceArr
509
517
  end
510
- stack.push(traceArr)
511
-
512
518
 
513
519
  traceDetails valo,stack,indx
514
520
 
@@ -537,6 +543,7 @@ module ManageEngine
537
543
  updateTransTrace(arr,stack[stack.size()-1])
538
544
  if(valo.size()>(indx+1))
539
545
  #Redirection Data
546
+ #Skipping all the "start_processing" event after "process_action" event
540
547
  arr = valo[indx]
541
548
  while (arr["name"]!="start_processing.action_controller") do
542
549
  indx = indx + 1
@@ -48,21 +48,17 @@ module ManageEngine
48
48
  else
49
49
  resp = startConnect "",agentInfo
50
50
  end
51
- if resp.has_key?("instance-info")
52
- aData = resp["instance-info"]
53
- aData["agent.id"]=aData.delete("instanceid")
54
- aData["agent.enabled"]=true
55
- @obj.config.updateAgentInfoFile(aData)
56
- @obj.log.debug "[doConnect] Connected - InstanceID : #{@obj.config.instance_id}"
57
- else
58
- @obj.log.info "[doConnect] [ Problem in connecting server] [ Going to shutdown ]"
59
- @obj.shutdown=true
60
- end
61
51
  end
62
-
63
- if resp==nil
64
- @obj.log.info "[doConnect] [ Error in Response while connecting Server . [ Going to shutdown ]"
65
- @obj.shutdown= true
52
+
53
+ if (resp == nil || !resp.has_key?("instance-info"))
54
+ @obj.log.info "[doConnect] [ Problem in connecting server] [ Going to shutdown ]"
55
+ @obj.shutdown=true
56
+ else
57
+ aData = resp["instance-info"]
58
+ aData["agent.id"]=aData.delete("instanceid")
59
+ aData["agent.enabled"]=true
60
+ @obj.config.updateAgentInfoFile(aData)
61
+ @obj.log.debug "[doConnect] Connected - InstanceID : #{@obj.config.instance_id}"
66
62
  end
67
63
 
68
64
  if(!@obj.shutdown)
@@ -14,8 +14,8 @@ module ManageEngine
14
14
  if(ManageEngine::APMObjectHolder.instance.config.agent_enabled)
15
15
  rt = (finish-start).to_i
16
16
  ManageEngine::APMWorker.getInstance.start
17
- ManageEngine::APMObjectHolder.instance.log.debug "[ Notifications for Agent ] #{Thread.current} #{id} #{name} - #{rt} - #{payload}"
18
- trace= caller;
17
+ ManageEngine::APMObjectHolder.instance.log.debug "[ Notifications for Agent ] #{Thread.current} #{id} #{name} - #{rt} - #{payload[:path]}"
18
+ #trace= caller;
19
19
  id = "#{Thread.current}"
20
20
  stats = Hash.new
21
21
  stats["name"] = name;
@@ -24,7 +24,7 @@ module ManageEngine
24
24
  stats["id"] = id;
25
25
  stats["payload"] = payload;
26
26
  if (name=="sql.active_record" && (finish-start)>=(ManageEngine::APMObjectHolder.instance.config.sql_trace_t * 1000 ).to_i)
27
- stats["trace"] = trace;
27
+ stats["trace"] = caller(20); # Taking stacktrace of depth 20
28
28
  end
29
29
  stats["ctime"] =ManageEngine::APMObjectHolder.instance.util.currenttimemillis;
30
30
  ManageEngine::APMObjectHolder.instance.collector.updateTransaction(id,stats);
@@ -2,7 +2,7 @@
2
2
  module ManageEngine
3
3
  class APMConstants
4
4
 
5
- attr_reader :apm_gem,:apm_conf,:agent_conf,:connection_open_timeout,:connection_read_timeout,:connect_uri,:connect_data_uri,:connect_trace_uri,:connect_config_update_uri,:site24x7url, :mergepattern_conf
5
+ attr_reader :apm_gem,:s247_apm_gem,:apm_conf,:agent_conf,:connection_open_timeout,:connection_read_timeout,:connect_uri,:connect_data_uri,:connect_trace_uri,:connect_config_update_uri,:site24x7url, :mergepattern_conf
6
6
  attr_reader :licence_exceeds,:licence_expired,:unmanage_agent,:manage_agent,:agent_config_updated,:error_notfound,:error_server,:delete_agent,:response_code,:custom_config_info
7
7
  attr_reader :mf_transaction,:mf_separator,:mf_db,:mf_apdex,:mf_namespace,:mf_name,:mf_all,:agent_store,:agent_lock,:mf_overflow
8
8
 
@@ -10,6 +10,8 @@ module ManageEngine
10
10
 
11
11
  #File path for APM Conf file
12
12
  @apm_gem="apminsight"
13
+ @s247_apm_gem="site24x7_apminsight"
14
+
13
15
  #File path for APM Conf file
14
16
  @apm_conf="apminsight.conf"
15
17
 
@@ -0,0 +1,72 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "site24x7_apminsight"
8
+ s.version = "1.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Adithyan P"]
12
+ s.date = "2016-11-21"
13
+ s.description = "Site24x7 APMInsight gives you end-to-end web-transaction awareness of Rails applications enabling you to isolate performance issues and resolve them quickly. To monitor Rails application performance, download and deploy Ruby agent(site24x7_apminsight) in your Application Server. This agent allows you to send information about Ruby applications. You can install APM Insight Agent via Rubygems or download it from your user account in Site24x7"
14
+
15
+ s.email = "apm-insight@zohocorp.com"
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ "LICENSE.txt",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "site24x7-agent.gemspec",
26
+ "conf/apminsight.conf",
27
+ "lib/site24x7_apminsight.rb",
28
+ "lib/agent/am_objectholder.rb",
29
+ "lib/agent/logging/am_logger.rb",
30
+ "lib/agent/configuration/am_configuration.rb",
31
+ "lib/agent/util/am_constants.rb",
32
+ "lib/agent/util/am_util.rb",
33
+ "lib/agent/metrics/am_metricsformatter.rb",
34
+ "lib/agent/metrics/am_metricstore.rb",
35
+ "lib/agent/metrics/am_metricscollector.rb",
36
+ "lib/agent/metrics/am_metricsparser.rb",
37
+ "lib/agent/server/am_agent.rb",
38
+ "lib/agent/server/am_connector.rb",
39
+ "lib/agent/server/worker/am_worker.rb",
40
+ "lib/agent/server/instrument/am_apm.rb",
41
+ "lib/agent/server/instrument/am_instrumenter.rb",
42
+ ]
43
+ s.homepage = "https://www.site24x7.com/help/apm/ruby-agent.html"
44
+ s.require_paths = ["lib"]
45
+ s.rubygems_version = "1.8.15"
46
+ s.summary = "Site24x7 APMInsight gives you end-to-end web-transaction awareness of Rails applications enabling you to isolate performance issues and resolve them quickly. To monitor Rails application performance, download and deploy Ruby agent(site24x7_apminsight.gem) in your Application Server. This agent allows you to send information about Ruby applications. You can install APM Insight Agent via Rubygems or download it from your user account in Site24x7"
47
+
48
+ if s.respond_to? :specification_version then
49
+ s.specification_version = 3
50
+
51
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
53
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
54
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
55
+ s.add_development_dependency(%q<rcov>, [">= 0"])
56
+ s.add_development_dependency(%q<rails>, [">= 3.0.0"])
57
+ else
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
61
+ s.add_dependency(%q<rcov>, [">= 0"])
62
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
63
+ end
64
+ else
65
+ s.add_dependency(%q<shoulda>, [">= 0"])
66
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
67
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
68
+ s.add_dependency(%q<rcov>, [">= 0"])
69
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
70
+ end
71
+ end
72
+
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site24x7_apminsight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: '1.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Rajalakshmi Ezhilan
8
+ - Adithyan P
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-30 00:00:00.000000000Z
12
+ date: 2016-11-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: &24015144 !ruby/object:Gem::Requirement
16
+ requirement: &22656348 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *24015144
24
+ version_requirements: *22656348
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &24014856 !ruby/object:Gem::Requirement
27
+ requirement: &22656060 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *24014856
35
+ version_requirements: *22656060
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &24014568 !ruby/object:Gem::Requirement
38
+ requirement: &22655772 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.4
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *24014568
46
+ version_requirements: *22655772
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &24014280 !ruby/object:Gem::Requirement
49
+ requirement: &22655484 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *24014280
57
+ version_requirements: *22655484
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rails
60
- requirement: &24013992 !ruby/object:Gem::Requirement
60
+ requirement: &22655196 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 3.0.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *24013992
68
+ version_requirements: *22655196
69
69
  description: Site24x7 APMInsight gives you end-to-end web-transaction awareness of
70
70
  Rails applications enabling you to isolate performance issues and resolve them quickly.
71
71
  To monitor Rails application performance, download and deploy Ruby agent(site24x7_apminsight)
@@ -83,6 +83,7 @@ files:
83
83
  - README.rdoc
84
84
  - Rakefile
85
85
  - VERSION
86
+ - site24x7-agent.gemspec
86
87
  - conf/apminsight.conf
87
88
  - lib/site24x7_apminsight.rb
88
89
  - lib/agent/am_objectholder.rb