application_insights 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/application_insights/channel/sender_base.rb +0 -9
- data/lib/application_insights/channel/telemetry_channel.rb +2 -1
- data/lib/application_insights/version.rb +1 -1
- data/test/application_insights/channel/test_sender_base.rb +1 -1
- data/test/application_insights/channel/test_telemetry_channel.rb +1 -1
- data/test/application_insights/test_telemetry_client.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTRkZjYzYTNhMmU2NTc1ZTJiNGY5Zjc1YjIwZGVhMTFhZWYyNGMwZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzM5ODdlMTYxNmM4OTNlODM0MWE2MzY1OTc2Y2Q0YzZiYmE3YTJjNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODNmYWQ0M2NmMzQxMGMyZDM2Y2RmYzg5YWM0M2U1MjgyYTJiZjM0OWUxMjVj
|
10
|
+
ZjE0M2Q5NzhlMjBhM2MxOWI0ODg1MTRiMWNhNDZhYWEwN2Y5N2FjYWQxNzQ2
|
11
|
+
N2VjMWE0OTY2NWI4ZGJjODE0YTIxYWE0OTFjZTRlZGZmMDkzODM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDZjZmU3NTRhMzY2MmI2MzlkMDcyNGM4ZWRiOWY3NGJlZTI4NTIzZjVhNzEy
|
14
|
+
OTVkZGJjNTcwOTEyY2YwNzc4ZjRkNWNhNjk4YmQxNDgyODQ2NjY2MWVjYTQz
|
15
|
+
MzJlMjhiMTc4MTEzNjYxNmIwMGUzYjc0NjY5MWY0MmEwNzM1Zjg=
|
@@ -55,15 +55,6 @@ module ApplicationInsights
|
|
55
55
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
56
56
|
end
|
57
57
|
response = http.request(request)
|
58
|
-
|
59
|
-
case response
|
60
|
-
when Net::HTTPSuccess, Net::HTTPRedirection, Net::HTTPBadRequest
|
61
|
-
return
|
62
|
-
else
|
63
|
-
data_to_send.each do |item|
|
64
|
-
@queue.push item
|
65
|
-
end
|
66
|
-
end
|
67
58
|
end
|
68
59
|
|
69
60
|
private
|
@@ -7,6 +7,7 @@ require_relative 'synchronous_sender'
|
|
7
7
|
require_relative 'contracts/envelope'
|
8
8
|
require_relative 'contracts/data'
|
9
9
|
require_relative 'contracts/internal'
|
10
|
+
require_relative '../../application_insights/version'
|
10
11
|
|
11
12
|
module ApplicationInsights
|
12
13
|
module Channel
|
@@ -77,7 +78,7 @@ module ApplicationInsights
|
|
77
78
|
def get_tags(context)
|
78
79
|
hash = {}
|
79
80
|
internal_context_attributes = {
|
80
|
-
:sdk_version => 'rb:
|
81
|
+
:sdk_version => 'rb:' + ApplicationInsights::VERSION
|
81
82
|
}
|
82
83
|
internal_context = Contracts::Internal.new internal_context_attributes
|
83
84
|
contexts = [ internal_context, context.application, context.device, context.user, context.session, context.location, context.operation ]
|
@@ -66,7 +66,7 @@ class TestTelemetryChannel < Test::Unit::TestCase
|
|
66
66
|
assert_equal 'instrumentation key', actual.i_key
|
67
67
|
assert_not_nil actual.tags
|
68
68
|
assert_equal 1, actual.tags.count
|
69
|
-
assert_equal 'rb:
|
69
|
+
assert_equal 'rb:'+ ApplicationInsights::VERSION, actual.tags['ai.internal.sdkVersion']
|
70
70
|
assert_not_nil actual.data
|
71
71
|
assert_equal 'MockTelemetryItemData', actual.data.base_type
|
72
72
|
assert_same expected, actual.data.base_data
|
@@ -34,7 +34,7 @@ class TestTelemetryClient < Test::Unit::TestCase
|
|
34
34
|
client, sender = self.create_client
|
35
35
|
client.track_page_view 'test', 'http://tempuri.org'
|
36
36
|
client.flush
|
37
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.PageView","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:
|
37
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.PageView","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"PageViewData","baseData":{"ver":2,"url":"http://tempuri.org","name":"test"}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
38
38
|
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
39
39
|
actual = sender.data_to_send.to_json
|
40
40
|
assert_equal expected, actual
|
@@ -48,7 +48,7 @@ class TestTelemetryClient < Test::Unit::TestCase
|
|
48
48
|
client.track_exception e
|
49
49
|
end
|
50
50
|
client.flush
|
51
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Exception","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:
|
51
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Exception","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"handledAt":"UserCode","exceptions":[{"id":1,"outerId":0,"typeName":"ArgumentError","message":"Some error","hasFullStack":true,"stack":"STACK_PLACEHOLDER"}]}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
52
52
|
assert_equal 'UserCode', sender.data_to_send[0].data.base_data.handled_at
|
53
53
|
assert_operator sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack.count, :>, 0
|
54
54
|
assert_equal 'test_track_exception_works_as_expected', sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack[0].method
|
@@ -64,7 +64,7 @@ class TestTelemetryClient < Test::Unit::TestCase
|
|
64
64
|
client, sender = self.create_client
|
65
65
|
client.track_event 'test'
|
66
66
|
client.flush
|
67
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Event","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:
|
67
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Event","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"EventData","baseData":{"ver":2,"name":"test"}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
68
68
|
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
69
69
|
actual = sender.data_to_send.to_json
|
70
70
|
assert_equal expected, actual
|
@@ -74,7 +74,7 @@ class TestTelemetryClient < Test::Unit::TestCase
|
|
74
74
|
client, sender = self.create_client
|
75
75
|
client.track_metric 'test', 42
|
76
76
|
client.flush
|
77
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Metric","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:
|
77
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Metric","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"test","kind":1,"value":42}]}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
78
78
|
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
79
79
|
actual = sender.data_to_send.to_json
|
80
80
|
assert_equal expected, actual
|
@@ -84,7 +84,7 @@ class TestTelemetryClient < Test::Unit::TestCase
|
|
84
84
|
client, sender = self.create_client
|
85
85
|
client.track_trace 'test', Channel::Contracts::SeverityLevel::WARNING
|
86
86
|
client.flush
|
87
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Message","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:
|
87
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Message","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"test","severityLevel":2}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
88
88
|
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
89
89
|
actual = sender.data_to_send.to_json
|
90
90
|
assert_equal expected, actual
|
@@ -94,7 +94,7 @@ class TestTelemetryClient < Test::Unit::TestCase
|
|
94
94
|
client, sender = self.create_client
|
95
95
|
client.track_request 'test', '2015-01-24T23:10:22.7411910-08:00', '0:00:00:02.0000000','200', true
|
96
96
|
client.flush
|
97
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Request","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:
|
97
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Request","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"test","startTime":"2015-01-24T23:10:22.7411910-08:00","duration":"0:00:00:02.0000000","responseCode":"200","success":true}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
98
98
|
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
99
99
|
actual = sender.data_to_send.to_json
|
100
100
|
assert_equal expected, actual
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: application_insights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|