application_insights 0.2.0 → 0.3.0
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 +9 -9
- data/LICENSE.txt +7 -18
- data/README.md +42 -7
- data/Rakefile +6 -1
- data/application_insights.gemspec +2 -0
- data/lib/application_insights.rb +1 -0
- data/lib/application_insights/channel/asynchronous_queue.rb +51 -0
- data/lib/application_insights/channel/asynchronous_sender.rb +121 -0
- data/lib/application_insights/channel/contracts/application.rb +3 -2
- data/lib/application_insights/channel/contracts/data.rb +3 -2
- data/lib/application_insights/channel/contracts/data_point.rb +15 -10
- data/lib/application_insights/channel/contracts/device.rb +42 -28
- data/lib/application_insights/channel/contracts/envelope.rb +39 -27
- data/lib/application_insights/channel/contracts/event_data.rb +6 -6
- data/lib/application_insights/channel/contracts/exception_data.rb +9 -8
- data/lib/application_insights/channel/contracts/exception_details.rb +15 -11
- data/lib/application_insights/channel/contracts/internal.rb +6 -4
- data/lib/application_insights/channel/contracts/location.rb +3 -2
- data/lib/application_insights/channel/contracts/message_data.rb +6 -5
- data/lib/application_insights/channel/contracts/metric_data.rb +3 -3
- data/lib/application_insights/channel/contracts/operation.rb +12 -8
- data/lib/application_insights/channel/contracts/page_view_data.rb +12 -10
- data/lib/application_insights/channel/contracts/remote_dependency_data.rb +27 -19
- data/lib/application_insights/channel/contracts/request_data.rb +15 -12
- data/lib/application_insights/channel/contracts/session.rb +9 -6
- data/lib/application_insights/channel/contracts/stack_frame.rb +9 -6
- data/lib/application_insights/channel/contracts/user.rb +12 -8
- data/lib/application_insights/channel/event.rb +64 -0
- data/lib/application_insights/channel/queue_base.rb +24 -10
- data/lib/application_insights/channel/sender_base.rb +38 -9
- data/lib/application_insights/channel/synchronous_queue.rb +16 -5
- data/lib/application_insights/channel/synchronous_sender.rb +4 -2
- data/lib/application_insights/channel/telemetry_channel.rb +26 -7
- data/lib/application_insights/channel/telemetry_context.rb +29 -10
- data/lib/application_insights/telemetry_client.rb +84 -15
- data/lib/application_insights/unhandled_exception.rb +48 -0
- data/lib/application_insights/version.rb +1 -1
- data/test/application_insights/channel/test_asynchronous_queue.rb +68 -0
- data/test/application_insights/channel/test_asynchronous_sender.rb +81 -0
- data/test/application_insights/channel/test_event.rb +53 -0
- data/test/application_insights/channel/test_queue_base.rb +10 -9
- data/test/application_insights/channel/test_sender_base.rb +0 -9
- data/test/application_insights/test_telemetry_client.rb +5 -0
- data/test/application_insights/test_unhandled_exception.rb +42 -0
- metadata +44 -3
@@ -30,8 +30,9 @@ module ApplicationInsights
|
|
30
30
|
|
31
31
|
# Gets the id property.
|
32
32
|
def id
|
33
|
-
|
34
|
-
|
33
|
+
@values.fetch('ai.device.id') {
|
34
|
+
@values['ai.device.id'] = nil
|
35
|
+
}
|
35
36
|
end
|
36
37
|
|
37
38
|
# Sets the id property.
|
@@ -45,8 +46,9 @@ module ApplicationInsights
|
|
45
46
|
|
46
47
|
# Gets the ip property.
|
47
48
|
def ip
|
48
|
-
|
49
|
-
|
49
|
+
@values.fetch('ai.device.ip') {
|
50
|
+
@values['ai.device.ip'] = nil
|
51
|
+
}
|
50
52
|
end
|
51
53
|
|
52
54
|
# Sets the ip property.
|
@@ -60,8 +62,9 @@ module ApplicationInsights
|
|
60
62
|
|
61
63
|
# Gets the language property.
|
62
64
|
def language
|
63
|
-
|
64
|
-
|
65
|
+
@values.fetch('ai.device.language') {
|
66
|
+
@values['ai.device.language'] = nil
|
67
|
+
}
|
65
68
|
end
|
66
69
|
|
67
70
|
# Sets the language property.
|
@@ -75,8 +78,9 @@ module ApplicationInsights
|
|
75
78
|
|
76
79
|
# Gets the locale property.
|
77
80
|
def locale
|
78
|
-
|
79
|
-
|
81
|
+
@values.fetch('ai.device.locale') {
|
82
|
+
@values['ai.device.locale'] = nil
|
83
|
+
}
|
80
84
|
end
|
81
85
|
|
82
86
|
# Sets the locale property.
|
@@ -90,8 +94,9 @@ module ApplicationInsights
|
|
90
94
|
|
91
95
|
# Gets the model property.
|
92
96
|
def model
|
93
|
-
|
94
|
-
|
97
|
+
@values.fetch('ai.device.model') {
|
98
|
+
@values['ai.device.model'] = nil
|
99
|
+
}
|
95
100
|
end
|
96
101
|
|
97
102
|
# Sets the model property.
|
@@ -105,8 +110,9 @@ module ApplicationInsights
|
|
105
110
|
|
106
111
|
# Gets the network property.
|
107
112
|
def network
|
108
|
-
|
109
|
-
|
113
|
+
@values.fetch('ai.device.network') {
|
114
|
+
@values['ai.device.network'] = nil
|
115
|
+
}
|
110
116
|
end
|
111
117
|
|
112
118
|
# Sets the network property.
|
@@ -120,8 +126,9 @@ module ApplicationInsights
|
|
120
126
|
|
121
127
|
# Gets the oem_name property.
|
122
128
|
def oem_name
|
123
|
-
|
124
|
-
|
129
|
+
@values.fetch('ai.device.oemName') {
|
130
|
+
@values['ai.device.oemName'] = nil
|
131
|
+
}
|
125
132
|
end
|
126
133
|
|
127
134
|
# Sets the oem_name property.
|
@@ -135,8 +142,9 @@ module ApplicationInsights
|
|
135
142
|
|
136
143
|
# Gets the os property.
|
137
144
|
def os
|
138
|
-
|
139
|
-
|
145
|
+
@values.fetch('ai.device.os') {
|
146
|
+
@values['ai.device.os'] = nil
|
147
|
+
}
|
140
148
|
end
|
141
149
|
|
142
150
|
# Sets the os property.
|
@@ -150,8 +158,9 @@ module ApplicationInsights
|
|
150
158
|
|
151
159
|
# Gets the os_version property.
|
152
160
|
def os_version
|
153
|
-
|
154
|
-
|
161
|
+
@values.fetch('ai.device.osVersion') {
|
162
|
+
@values['ai.device.osVersion'] = nil
|
163
|
+
}
|
155
164
|
end
|
156
165
|
|
157
166
|
# Sets the os_version property.
|
@@ -165,8 +174,9 @@ module ApplicationInsights
|
|
165
174
|
|
166
175
|
# Gets the role_instance property.
|
167
176
|
def role_instance
|
168
|
-
|
169
|
-
|
177
|
+
@values.fetch('ai.device.roleInstance') {
|
178
|
+
@values['ai.device.roleInstance'] = nil
|
179
|
+
}
|
170
180
|
end
|
171
181
|
|
172
182
|
# Sets the role_instance property.
|
@@ -180,8 +190,9 @@ module ApplicationInsights
|
|
180
190
|
|
181
191
|
# Gets the role_name property.
|
182
192
|
def role_name
|
183
|
-
|
184
|
-
|
193
|
+
@values.fetch('ai.device.roleName') {
|
194
|
+
@values['ai.device.roleName'] = nil
|
195
|
+
}
|
185
196
|
end
|
186
197
|
|
187
198
|
# Sets the role_name property.
|
@@ -195,8 +206,9 @@ module ApplicationInsights
|
|
195
206
|
|
196
207
|
# Gets the screen_resolution property.
|
197
208
|
def screen_resolution
|
198
|
-
|
199
|
-
|
209
|
+
@values.fetch('ai.device.screenResolution') {
|
210
|
+
@values['ai.device.screenResolution'] = nil
|
211
|
+
}
|
200
212
|
end
|
201
213
|
|
202
214
|
# Sets the screen_resolution property.
|
@@ -210,8 +222,9 @@ module ApplicationInsights
|
|
210
222
|
|
211
223
|
# Gets the type property.
|
212
224
|
def type
|
213
|
-
|
214
|
-
|
225
|
+
@values.fetch('ai.device.type') {
|
226
|
+
@values['ai.device.type'] = nil
|
227
|
+
}
|
215
228
|
end
|
216
229
|
|
217
230
|
# Sets the type property.
|
@@ -225,8 +238,9 @@ module ApplicationInsights
|
|
225
238
|
|
226
239
|
# Gets the vm_name property.
|
227
240
|
def vm_name
|
228
|
-
|
229
|
-
|
241
|
+
@values.fetch('ai.device.vmName') {
|
242
|
+
@values['ai.device.vmName'] = nil
|
243
|
+
}
|
230
244
|
end
|
231
245
|
|
232
246
|
# Sets the vm_name property.
|
@@ -35,8 +35,9 @@ module ApplicationInsights
|
|
35
35
|
|
36
36
|
# Gets the ver property.
|
37
37
|
def ver
|
38
|
-
|
39
|
-
|
38
|
+
@values.fetch('ver') {
|
39
|
+
@values['ver'] = 1
|
40
|
+
}
|
40
41
|
end
|
41
42
|
|
42
43
|
# Sets the ver property.
|
@@ -70,8 +71,9 @@ module ApplicationInsights
|
|
70
71
|
|
71
72
|
# Gets the sample_rate property.
|
72
73
|
def sample_rate
|
73
|
-
|
74
|
-
|
74
|
+
@values.fetch('sampleRate') {
|
75
|
+
@values['sampleRate'] = 100.0
|
76
|
+
}
|
75
77
|
end
|
76
78
|
|
77
79
|
# Sets the sample_rate property.
|
@@ -85,8 +87,9 @@ module ApplicationInsights
|
|
85
87
|
|
86
88
|
# Gets the seq property.
|
87
89
|
def seq
|
88
|
-
|
89
|
-
|
90
|
+
@values.fetch('seq') {
|
91
|
+
@values['seq'] = nil
|
92
|
+
}
|
90
93
|
end
|
91
94
|
|
92
95
|
# Sets the seq property.
|
@@ -100,8 +103,9 @@ module ApplicationInsights
|
|
100
103
|
|
101
104
|
# Gets the i_key property.
|
102
105
|
def i_key
|
103
|
-
|
104
|
-
|
106
|
+
@values.fetch('iKey') {
|
107
|
+
@values['iKey'] = nil
|
108
|
+
}
|
105
109
|
end
|
106
110
|
|
107
111
|
# Sets the i_key property.
|
@@ -115,8 +119,9 @@ module ApplicationInsights
|
|
115
119
|
|
116
120
|
# Gets the flags property.
|
117
121
|
def flags
|
118
|
-
|
119
|
-
|
122
|
+
@values.fetch('flags') {
|
123
|
+
@values['flags'] = nil
|
124
|
+
}
|
120
125
|
end
|
121
126
|
|
122
127
|
# Sets the flags property.
|
@@ -130,8 +135,9 @@ module ApplicationInsights
|
|
130
135
|
|
131
136
|
# Gets the device_id property.
|
132
137
|
def device_id
|
133
|
-
|
134
|
-
|
138
|
+
@values.fetch('deviceId') {
|
139
|
+
@values['deviceId'] = nil
|
140
|
+
}
|
135
141
|
end
|
136
142
|
|
137
143
|
# Sets the device_id property.
|
@@ -145,8 +151,9 @@ module ApplicationInsights
|
|
145
151
|
|
146
152
|
# Gets the os property.
|
147
153
|
def os
|
148
|
-
|
149
|
-
|
154
|
+
@values.fetch('os') {
|
155
|
+
@values['os'] = nil
|
156
|
+
}
|
150
157
|
end
|
151
158
|
|
152
159
|
# Sets the os property.
|
@@ -160,8 +167,9 @@ module ApplicationInsights
|
|
160
167
|
|
161
168
|
# Gets the os_ver property.
|
162
169
|
def os_ver
|
163
|
-
|
164
|
-
|
170
|
+
@values.fetch('osVer') {
|
171
|
+
@values['osVer'] = nil
|
172
|
+
}
|
165
173
|
end
|
166
174
|
|
167
175
|
# Sets the os_ver property.
|
@@ -175,8 +183,9 @@ module ApplicationInsights
|
|
175
183
|
|
176
184
|
# Gets the app_id property.
|
177
185
|
def app_id
|
178
|
-
|
179
|
-
|
186
|
+
@values.fetch('appId') {
|
187
|
+
@values['appId'] = nil
|
188
|
+
}
|
180
189
|
end
|
181
190
|
|
182
191
|
# Sets the app_id property.
|
@@ -190,8 +199,9 @@ module ApplicationInsights
|
|
190
199
|
|
191
200
|
# Gets the app_ver property.
|
192
201
|
def app_ver
|
193
|
-
|
194
|
-
|
202
|
+
@values.fetch('appVer') {
|
203
|
+
@values['appVer'] = nil
|
204
|
+
}
|
195
205
|
end
|
196
206
|
|
197
207
|
# Sets the app_ver property.
|
@@ -205,8 +215,9 @@ module ApplicationInsights
|
|
205
215
|
|
206
216
|
# Gets the user_id property.
|
207
217
|
def user_id
|
208
|
-
|
209
|
-
|
218
|
+
@values.fetch('userId') {
|
219
|
+
@values['userId'] = nil
|
220
|
+
}
|
210
221
|
end
|
211
222
|
|
212
223
|
# Sets the user_id property.
|
@@ -220,9 +231,9 @@ module ApplicationInsights
|
|
220
231
|
|
221
232
|
# Gets the tags property.
|
222
233
|
def tags
|
223
|
-
|
224
|
-
|
225
|
-
|
234
|
+
@values.fetch('tags') {
|
235
|
+
@values['tags'] = {}
|
236
|
+
}
|
226
237
|
end
|
227
238
|
|
228
239
|
# Sets the tags property.
|
@@ -236,8 +247,9 @@ module ApplicationInsights
|
|
236
247
|
|
237
248
|
# Gets the data property.
|
238
249
|
def data
|
239
|
-
|
240
|
-
|
250
|
+
@values.fetch('data') {
|
251
|
+
@values['data'] = nil
|
252
|
+
}
|
241
253
|
end
|
242
254
|
|
243
255
|
# Sets the data property.
|
@@ -42,9 +42,9 @@ module ApplicationInsights
|
|
42
42
|
|
43
43
|
# Gets the properties property.
|
44
44
|
def properties
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
@values.fetch('properties') {
|
46
|
+
@values['properties'] = {}
|
47
|
+
}
|
48
48
|
end
|
49
49
|
|
50
50
|
# Sets the properties property.
|
@@ -58,9 +58,9 @@ module ApplicationInsights
|
|
58
58
|
|
59
59
|
# Gets the measurements property.
|
60
60
|
def measurements
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
@values.fetch('measurements') {
|
62
|
+
@values['measurements'] = {}
|
63
|
+
}
|
64
64
|
end
|
65
65
|
|
66
66
|
# Sets the measurements property.
|
@@ -55,8 +55,9 @@ module ApplicationInsights
|
|
55
55
|
|
56
56
|
# Gets the severity_level property.
|
57
57
|
def severity_level
|
58
|
-
|
59
|
-
|
58
|
+
@values.fetch('severityLevel') {
|
59
|
+
@values['severityLevel'] = nil
|
60
|
+
}
|
60
61
|
end
|
61
62
|
|
62
63
|
# Sets the severity_level property.
|
@@ -70,9 +71,9 @@ module ApplicationInsights
|
|
70
71
|
|
71
72
|
# Gets the properties property.
|
72
73
|
def properties
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
@values.fetch('properties') {
|
75
|
+
@values['properties'] = {}
|
76
|
+
}
|
76
77
|
end
|
77
78
|
|
78
79
|
# Sets the properties property.
|
@@ -86,9 +87,9 @@ module ApplicationInsights
|
|
86
87
|
|
87
88
|
# Gets the measurements property.
|
88
89
|
def measurements
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
@values.fetch('measurements') {
|
91
|
+
@values['measurements'] = {}
|
92
|
+
}
|
92
93
|
end
|
93
94
|
|
94
95
|
# Sets the measurements property.
|
@@ -26,8 +26,9 @@ module ApplicationInsights
|
|
26
26
|
|
27
27
|
# Gets the id property.
|
28
28
|
def id
|
29
|
-
|
30
|
-
|
29
|
+
@values.fetch('id') {
|
30
|
+
@values['id'] = nil
|
31
|
+
}
|
31
32
|
end
|
32
33
|
|
33
34
|
# Sets the id property.
|
@@ -41,8 +42,9 @@ module ApplicationInsights
|
|
41
42
|
|
42
43
|
# Gets the outer_id property.
|
43
44
|
def outer_id
|
44
|
-
|
45
|
-
|
45
|
+
@values.fetch('outerId') {
|
46
|
+
@values['outerId'] = nil
|
47
|
+
}
|
46
48
|
end
|
47
49
|
|
48
50
|
# Sets the outer_id property.
|
@@ -76,8 +78,9 @@ module ApplicationInsights
|
|
76
78
|
|
77
79
|
# Gets the has_full_stack property.
|
78
80
|
def has_full_stack
|
79
|
-
|
80
|
-
|
81
|
+
@values.fetch('hasFullStack') {
|
82
|
+
@values['hasFullStack'] = true
|
83
|
+
}
|
81
84
|
end
|
82
85
|
|
83
86
|
# Sets the has_full_stack property.
|
@@ -91,8 +94,9 @@ module ApplicationInsights
|
|
91
94
|
|
92
95
|
# Gets the stack property.
|
93
96
|
def stack
|
94
|
-
|
95
|
-
|
97
|
+
@values.fetch('stack') {
|
98
|
+
@values['stack'] = nil
|
99
|
+
}
|
96
100
|
end
|
97
101
|
|
98
102
|
# Sets the stack property.
|
@@ -106,9 +110,9 @@ module ApplicationInsights
|
|
106
110
|
|
107
111
|
# Gets the parsed_stack property.
|
108
112
|
def parsed_stack
|
109
|
-
|
110
|
-
|
111
|
-
|
113
|
+
@values.fetch('parsedStack') {
|
114
|
+
@values['parsedStack'] = []
|
115
|
+
}
|
112
116
|
end
|
113
117
|
|
114
118
|
# Sets the parsed_stack property.
|
@@ -18,8 +18,9 @@ module ApplicationInsights
|
|
18
18
|
|
19
19
|
# Gets the sdk_version property.
|
20
20
|
def sdk_version
|
21
|
-
|
22
|
-
|
21
|
+
@values.fetch('ai.internal.sdkVersion') {
|
22
|
+
@values['ai.internal.sdkVersion'] = nil
|
23
|
+
}
|
23
24
|
end
|
24
25
|
|
25
26
|
# Sets the sdk_version property.
|
@@ -33,8 +34,9 @@ module ApplicationInsights
|
|
33
34
|
|
34
35
|
# Gets the agent_version property.
|
35
36
|
def agent_version
|
36
|
-
|
37
|
-
|
37
|
+
@values.fetch('ai.internal.agentVersion') {
|
38
|
+
@values['ai.internal.agentVersion'] = nil
|
39
|
+
}
|
38
40
|
end
|
39
41
|
|
40
42
|
# Sets the agent_version property.
|