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 +4 -4
- data/README.md +3 -24
- data/Rakefile +1 -0
- data/lib/instana/instrumentation/rack.rb +5 -1
- data/lib/instana/version.rb +1 -1
- data/test/frameworks/rack_test.rb +33 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4751e62607f94443c70c105e839f572c987e66a77a8e9696e7f1c243636b76d9
|
4
|
+
data.tar.gz: fe25a35592728095b475bbe96713b7d560638764844e76b5aef2a58e4a7fbce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-

|
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[
|
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
|
data/lib/instana/version.rb
CHANGED
@@ -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
|
+
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-
|
11
|
+
date: 2019-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|