instana 0.14.2 → 0.15.0

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
  SHA1:
3
- metadata.gz: ce0309a7d8eace834f73f721b1e3b008562f9a32
4
- data.tar.gz: 1ff1ad55ad736c0ef64f1dca370100143f390cbd
3
+ metadata.gz: b08a1d3bea72c56da148e02e24c9095a49d4c0f6
4
+ data.tar.gz: efcbc529c115a5dba077b4e590528b32c98698ba
5
5
  SHA512:
6
- metadata.gz: a65f865e28aea63228d6c4bfce3c7b5eb4ba1bb6dd1370ce6b3e674083c69905879658e23ecb5329afbab03723ee1aca4c7643db7ea3ba71460d6e59fd5059ed
7
- data.tar.gz: 5a7b593a95f1f9857f7d6944f0bac2716767b4ec4c720aabd6852e21e20a15d17c841fe862bb715fc47a642062d4053567efa4cfe967ec69b5888c8c183c150c
6
+ metadata.gz: 72c20b92c83aa59a7e0b21c5eb9127e696f782ddd7b077294adf9185469629e0f7922027e881dd52c717f1ac3c64929ffc04e1bcef2eb2893e59f94ddd2e0e67
7
+ data.tar.gz: 9d9cd6654f148a0142faeeab2ef9875bdfa2f9d31db700859a1c44e3d3f195c364c99fbc9a0f33342ce8ea4f07c9caf71cb1a63c7100e90f924f471d345cf154
@@ -19,3 +19,7 @@ before_install:
19
19
 
20
20
  script: "bundle exec rake test"
21
21
 
22
+ notifications:
23
+ slack:
24
+ rooms:
25
+ secure: Ae9tJmBO9/sgYWthHRS5uufAf8s6uIMdtmQn+gBkcAXaMWJgt1IAzpIj98Qsg15/lhHS8ezwCe7WIAWC4mM1cnwl/hP195dbgLzF4D2uOjaIXj55ckIIE06jBX1yHapu0vMFSaKwgL4auEEVg4xkehBb9TzLNG/LbExadZQOIkeLdtgU04VrPfDC9pZWPplXT4kzjMZkMESzBYaCfNl6eenu0sHdoxSvngv52MImog6aZQKT+k3ccAa1yzZNhUdy4gSZi1HafXdSCn4UTPDtkNIlsWBW8yprICLxZV/NvgUTEEJYSHO6Ucx9Er22LzKtNbEYlAs1GErGWjDzpqvvXt/5UwNx0rLDrVKI/xMIELEbT047mSgJ8tpVd0ErGA/bnDfbF2oDFTAEXq4jaeAMaVR9Q1CW0ZZF2Jh5jOKc41U+AVGgaMDaBA0ukDSeXvJcnteZ9EllOO8ZAtC2FKtBNnj36W13KTR0TkjMCl+KOiVJXnOyRJIR+CUL9BdDuODBVPZHqZaZ48N+MOG9dRb+fvkdTnwh7hU+UmR08kOsd4x+dDlm4dBrFrB8v8udQ7XuBN9AOZty2CPWFUSJM1BxtetyS3We0L6lQ8o/B9STFNK4KTa/M8wNq1Fm85h3ZKHHIHDpQnXM6vD8SV1p9u91C5UI8rEyxzW5IaT2oqXsCzU=
data/README.md CHANGED
@@ -58,7 +58,30 @@ You can find more documentation covering supported components and minimum versio
58
58
 
59
59
  ## Want End User Monitoring?
60
60
 
61
- Instana provides deep end user monitoring that links server side traces with browser events. See [End User Monitoring](https://instana.atlassian.net/wiki/display/DOCS/Web+End-User+Monitoring) in the Instana documentation portal.
61
+ Instana provides deep end user monitoring that links server side traces with browser events.
62
+
63
+ For Ruby templates and views, get your EUM API key from your Instana dashboard and you can call `::Instana::Helpers.eum_snippet('example_api_key_string')` from within your layout file. This will output
64
+ a small javascript snippet of code to instrument browser events. It's based on [Weasel](https://github.com/instana/weasel). Check it out.
65
+
66
+ As an example for Haml, you could do the following:
67
+
68
+ ```ruby
69
+ %html{ :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
70
+ %head
71
+ - if user_signed_in?
72
+ = raw ::Instana::Helpers.eum_snippet('example_api_key_string', :username => current_user.username)
73
+ - else
74
+ = raw ::Instana::Helpers.eum_snippet('example_api_key_string')
75
+ %body
76
+ ```
77
+ Make sure to use the `raw` helper so the javascript isn't interpolated with escape strings.
78
+
79
+ The optional second argument to `::Instana::Helpers.eum_snippet` is a hash of metadata key/values that will be reported along
80
+ with the browser instrumentation.
81
+
82
+ ![Instana EUM example with metadata](https://s3.amazonaws.com/instana/Instana+Gameface+EUM+with+metadata+2016-12-22+at+15.32.01.png)
83
+
84
+ See also the [End User Monitoring](https://instana.atlassian.net/wiki/display/DOCS/Web+End-User+Monitoring) in the Instana documentation portal.
62
85
 
63
86
  ## Development
64
87
 
@@ -63,6 +63,10 @@ module Instana
63
63
  def after_fork
64
64
  ::Instana.logger.agent "after_fork hook called. Falling back to unannounced state and spawning a new background agent thread."
65
65
 
66
+ # Reseed the random number generator for this
67
+ # new thread.
68
+ srand
69
+
66
70
  # Re-collect process information post fork
67
71
  @process = ::Instana::Util.collect_process_info
68
72
 
@@ -1,6 +1,7 @@
1
1
  require "instana/version"
2
2
  require 'instana/logger'
3
3
  require "instana/util"
4
+ require "instana/helpers"
4
5
 
5
6
  module Instana
6
7
  class << self
@@ -10,6 +10,10 @@ module Instana
10
10
  @config[:metrics][:memory] = { :enabled => true }
11
11
  @config[:metrics][:thread] = { :enabled => true }
12
12
 
13
+ # EUM Related
14
+ @config[:eum_api_key] = nil
15
+ @config[:eum_baggage] = {}
16
+
13
17
  # HTTP Clients
14
18
  @config[:excon] = { :enabled => true }
15
19
  end
@@ -0,0 +1,16 @@
1
+ <script nonce="68afd870-ae85-48c6-9689-9a5c359d5a1f">
2
+ (function(i,s,o,g,r,a,m){i['InstanaEumObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','//internal-eum.instana.io/eum.min.js','ineum');
6
+
7
+ ineum('reportingUrl', '//internal-eum.instana.io');
8
+ ineum('apiKey', '<%=::Instana.config[:eum_api_key]%>');
9
+ ineum('traceId', '<%=::Instana.tracer.trace_id_header%>');
10
+
11
+ <% if !::Instana.config[:eum_baggage].empty? %>
12
+ <% ::Instana.config[:eum_baggage].each do |k, v| %>
13
+ ineum('meta', '<%=k%>', '<%=v%>');
14
+ <% end %>
15
+ <% end %>
16
+ </script>
@@ -0,0 +1,14 @@
1
+ <script>
2
+ (function(i,s,o,g,r,a,m){i['InstanaEumObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','//eum.instana.io/eum.min.js','ineum');
6
+ ineum('apiKey', '<%=::Instana.config[:eum_api_key]%>');
7
+ ineum('traceId', '<%=::Instana.tracer.trace_id_header%>');
8
+
9
+ <% if !::Instana.config[:eum_baggage].empty? %>
10
+ <% ::Instana.config[:eum_baggage].each do |k, v| %>
11
+ ineum('meta', '<%=k%>', '<%=v%>');
12
+ <% end %>
13
+ <% end %>
14
+ </script>
@@ -0,0 +1,40 @@
1
+ module Instana
2
+ module Helpers
3
+ EUM_SNIPPET= (File.read(File.dirname(__FILE__) + '/eum/eum.js.erb')).freeze
4
+ EUM_TEST_SNIPPET= (File.read(File.dirname(__FILE__) + '/eum/eum-test.js.erb')).freeze
5
+
6
+ class << self
7
+
8
+ # Returns a processed javascript snippet to be placed within the HEAD tag of an HTML page.
9
+ #
10
+ def eum_snippet(api_key, kvs = {})
11
+ return nil if !::Instana.tracer.tracing?
12
+
13
+ ::Instana.config[:eum_api_key] = api_key
14
+ ::Instana.config[:eum_baggage] = kvs
15
+
16
+ ERB.new(EUM_SNIPPET).result
17
+ rescue => e
18
+ Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
19
+ Instana.logger.debug e.backtrace.join("\r\n")
20
+ return nil
21
+ end
22
+
23
+ # Returns a processed javascript snippet to be placed within the HEAD tag of an HTML page.
24
+ # This one is used for testing only
25
+ #
26
+ def eum_test_snippet(api_key, kvs = {})
27
+ return nil if !::Instana.tracer.tracing?
28
+
29
+ ::Instana.config[:eum_api_key] = api_key
30
+ ::Instana.config[:eum_baggage] = kvs
31
+
32
+ ERB.new(EUM_TEST_SNIPPET).result
33
+ rescue => e
34
+ Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
35
+ Instana.logger.debug e.backtrace.join("\r\n")
36
+ return nil
37
+ end
38
+ end
39
+ end
40
+ end
@@ -90,10 +90,6 @@ module Instana
90
90
  data[:sensorVersion] = ::Instana::VERSION
91
91
  data[:ruby_version] = RUBY_VERSION
92
92
 
93
- # Since a snapshot is only taken on process boot,
94
- # this is ok here.
95
- data[:start_time] = Time.now.to_s
96
-
97
93
  # Framework Detection
98
94
  if defined?(::RailsLts::VERSION)
99
95
  data[:framework] = "Rails on Rails LTS-#{::RailsLts::VERSION}"
@@ -111,6 +107,15 @@ module Instana
111
107
  data[:framework] = "Sinatra #{::Sinatra::VERSION}"
112
108
  end
113
109
 
110
+ # Report Bundle
111
+ if defined?(::Gem) && Gem.respond_to?(:loaded_specs)
112
+ data[:versions] = {}
113
+
114
+ Gem.loaded_specs.each do |k, v|
115
+ data[:versions][k] = v.version.to_s
116
+ end
117
+ end
118
+
114
119
  data
115
120
  rescue => e
116
121
  ::Instana.logger.error "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "0.14.2"
2
+ VERSION = "0.15.0"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
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: 0.14.2
4
+ version: 0.15.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: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2016-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,10 +136,13 @@ files:
136
136
  - lib/instana/collectors/memory.rb
137
137
  - lib/instana/collectors/thread.rb
138
138
  - lib/instana/config.rb
139
+ - lib/instana/eum/eum-test.js.erb
140
+ - lib/instana/eum/eum.js.erb
139
141
  - lib/instana/frameworks/cuba.rb
140
142
  - lib/instana/frameworks/rails.rb
141
143
  - lib/instana/frameworks/roda.rb
142
144
  - lib/instana/frameworks/sinatra.rb
145
+ - lib/instana/helpers.rb
143
146
  - lib/instana/instrumentation.rb
144
147
  - lib/instana/instrumentation/excon.rb
145
148
  - lib/instana/instrumentation/net-http.rb