instana 1.10.4 → 1.10.5

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: 66eea5baa9086f0be88ec5bb7f8502e3cdaafaf7b3b8648571584293fe9b674d
4
- data.tar.gz: 3302565c8feac78f09954dedc1df328c62baa0f5f3a0992a5e456124f96920bf
3
+ metadata.gz: 4751e62607f94443c70c105e839f572c987e66a77a8e9696e7f1c243636b76d9
4
+ data.tar.gz: fe25a35592728095b475bbe96713b7d560638764844e76b5aef2a58e4a7fbce2
5
5
  SHA512:
6
- metadata.gz: f89823c2bbf24e4d41ea2756b639910d58ee991ed7144b4c47263f563e2fbd00f08cf4660c629953b9615f2696fa52d74e0f6cf26d95fd63b3b4eed8d8ef1a38
7
- data.tar.gz: 8ff69135b822c9027819cbd8bcf3757aba741455587519afc7ecbca4a24a11d4549b103a542de153374ebfe35373cd4ae94b15c73e0bb29f22d8f3049e55caf7
6
+ metadata.gz: 7b31efdcaafa69880c9040b467ecab26ab2d6a58c04cdec9c9c562ccb69a64e8ccfe1faaf7a984847e080ba3482571f6ffedc4952e7e55e72bbd8bf63b3eb52f
7
+ data.tar.gz: 699309269433de93a99c24315d964a9c67083f3e029afbedf619579e8a0fc69e31e0f435e481e6f20a209bebd49d617705570e2de79a8602e9f6135d4133fd89
data/README.md CHANGED
@@ -59,32 +59,11 @@ This Ruby gem provides a simple API for tracing and also supports [OpenTracing](
59
59
 
60
60
  You can find more documentation covering supported components and minimum versions in the Instana [documentation portal](https://docs.instana.io/ecosystem/ruby/).
61
61
 
62
- ## Want End User Monitoring?
62
+ # Want End User Monitoring (EUM)?
63
63
 
64
- Instana provides deep end user monitoring that links server side traces with browser events.
64
+ Instana provides deep end user monitoring that links server side traces with browser events to give you a complete view from server to browser.
65
65
 
66
- 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
67
- a small javascript snippet of code to instrument browser events. It's based on [Weasel](https://github.com/instana/weasel). Check it out.
68
-
69
- As an example for Haml, you could do the following:
70
-
71
- ```ruby
72
- %html{ :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
73
- %head
74
- - if user_signed_in?
75
- = raw ::Instana::Helpers.eum_snippet('example_api_key_string', :username => current_user.username)
76
- - else
77
- = raw ::Instana::Helpers.eum_snippet('example_api_key_string')
78
- %body
79
- ```
80
- Make sure to use the `raw` helper so the javascript isn't interpolated with escape strings.
81
-
82
- The optional second argument to `::Instana::Helpers.eum_snippet` is a hash of metadata key/values that will be reported along
83
- with the browser instrumentation.
84
-
85
- ![Instana EUM example with metadata](https://s3.amazonaws.com/instana/Instana+Gameface+EUM+with+metadata+2016-12-22+at+15.32.01.png)
86
-
87
- See also the [End User Monitoring](https://docs.instana.io/products/website_monitoring/) in the Instana documentation portal.
66
+ See the [End User Monitoring](/products/website_monitoring/#configuration) page for more information.
88
67
 
89
68
  ## Development
90
69
 
data/Rakefile CHANGED
@@ -27,6 +27,7 @@ Rake::TestTask.new(:test) do |t|
27
27
  when /libraries/
28
28
  t.test_files = FileList['test/instrumentation/*_test.rb',
29
29
  'test/frameworks/cuba_test.rb',
30
+ 'test/frameworks/rack_test.rb',
30
31
  'test/frameworks/roda_test.rb',
31
32
  'test/frameworks/sinatra_test.rb']
32
33
  else
@@ -28,8 +28,12 @@ module Instana
28
28
  # Headers are available in this format: HTTP_X_CAPTURE_THIS
29
29
  rack_header = 'HTTP_' + custom_header.upcase
30
30
  rack_header.tr!('-', '_')
31
+
31
32
  if env.key?(rack_header)
32
- kvs["http.#{custom_header}"] = env[rack_header]
33
+ unless kvs[:http].key?(:header)
34
+ kvs[:http][:header] = {}
35
+ end
36
+ kvs[:http][:header][custom_header.to_sym] = env[rack_header]
33
37
  end
34
38
  }
35
39
  end
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.10.4"
2
+ VERSION = "1.10.5"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -46,6 +46,9 @@ class RackTest < Minitest::Test
46
46
  assert first_span.key?(:stack)
47
47
  assert_equal 2, first_span[:stack].count
48
48
  refute_nil first_span[:stack].first[:c].match(/instana\/instrumentation\/rack.rb/)
49
+
50
+ # Restore to default
51
+ ::Instana.config[:collect_backtraces] = false
49
52
  end
50
53
 
51
54
  def test_basic_get_with_custom_service_name
@@ -164,4 +167,34 @@ class RackTest < Minitest::Test
164
167
 
165
168
  assert last_response.ok?
166
169
  end
170
+
171
+ def test_custom_headers_capture
172
+ clear_all!
173
+ ::Instana.config[:collect_backtraces] = true
174
+ ::Instana.agent.extra_headers = %w(X-Capture-This X-Capture-That)
175
+
176
+ get '/mrlobster', {}, { "HTTP_X_CAPTURE_THIS" => "ThereYouGo" }
177
+ assert last_response.ok?
178
+ assert_equal "ThereYouGo", last_request.env["HTTP_X_CAPTURE_THIS"]
179
+
180
+ spans = ::Instana.processor.queued_spans
181
+
182
+ # Span validation
183
+ assert_equal 1, spans.count
184
+ first_span = spans.first
185
+
186
+ assert first_span[:data][:http].key?(:header)
187
+ assert first_span[:data][:http][:header].key?(:"X-Capture-This")
188
+ assert !first_span[:data][:http][:header].key?(:"X-Capture-That")
189
+ assert_equal "ThereYouGo", first_span[:data][:http][:header][:"X-Capture-This"]
190
+
191
+ # Backtrace fingerprint validation
192
+ assert first_span.key?(:stack)
193
+ assert_equal 2, first_span[:stack].count
194
+ refute_nil first_span[:stack].first[:c].match(/instana\/instrumentation\/rack.rb/)
195
+
196
+ # Restore to default
197
+ ::Instana.config[:collect_backtraces] = false
198
+ ::Instana.agent.extra_headers = nil
199
+ end
167
200
  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: 1.10.4
4
+ version: 1.10.5
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: 2019-09-17 00:00:00.000000000 Z
11
+ date: 2019-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler