@gitpod/gitpod-protocol 0.1.5-svenefftinge-dashboard-invalid-2274.5 → 0.1.5-tar-telemetry-settings-data.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.
Files changed (349) hide show
  1. package/data/builtin-theia-plugins.json +28 -18
  2. package/data/gitpod-schema.json +25 -24
  3. package/lib/accounting-protocol.d.ts +155 -0
  4. package/lib/accounting-protocol.d.ts.map +1 -0
  5. package/lib/accounting-protocol.js +109 -0
  6. package/lib/accounting-protocol.js.map +1 -0
  7. package/lib/admin-protocol.d.ts +32 -5
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +16 -1
  10. package/lib/admin-protocol.js.map +1 -1
  11. package/lib/analytics.d.ts +45 -0
  12. package/lib/analytics.d.ts.map +1 -0
  13. package/lib/analytics.js +10 -0
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/auth.d.ts +25 -0
  16. package/lib/auth.d.ts.map +1 -0
  17. package/lib/auth.js +16 -0
  18. package/lib/auth.js.map +1 -0
  19. package/lib/context-url.d.ts +31 -0
  20. package/lib/context-url.d.ts.map +1 -0
  21. package/lib/context-url.js +102 -0
  22. package/lib/context-url.js.map +1 -0
  23. package/lib/context-url.spec.d.ts +14 -0
  24. package/lib/context-url.spec.d.ts.map +1 -0
  25. package/lib/context-url.spec.js +94 -0
  26. package/lib/context-url.spec.js.map +1 -0
  27. package/lib/email-protocol.d.ts +2 -3
  28. package/lib/email-protocol.d.ts.map +1 -1
  29. package/lib/email-protocol.js +5 -5
  30. package/lib/email-protocol.js.map +1 -1
  31. package/lib/encryption/container-module.d.ts +1 -1
  32. package/lib/encryption/container-module.js +6 -5
  33. package/lib/encryption/container-module.js.map +1 -1
  34. package/lib/encryption/encryption-engine.d.ts +1 -1
  35. package/lib/encryption/encryption-engine.js +20 -21
  36. package/lib/encryption/encryption-engine.js.map +1 -1
  37. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  38. package/lib/encryption/encryption-engine.spec.js +30 -37
  39. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  40. package/lib/encryption/encryption-service.d.ts +1 -1
  41. package/lib/encryption/encryption-service.js +30 -44
  42. package/lib/encryption/encryption-service.js.map +1 -1
  43. package/lib/encryption/key-provider.d.ts +1 -1
  44. package/lib/encryption/key-provider.js +26 -31
  45. package/lib/encryption/key-provider.js.map +1 -1
  46. package/lib/env.d.ts +2 -3
  47. package/lib/env.d.ts.map +1 -1
  48. package/lib/env.js +21 -22
  49. package/lib/env.js.map +1 -1
  50. package/lib/gitpod-file-parser.d.ts +1 -1
  51. package/lib/gitpod-file-parser.js +26 -42
  52. package/lib/gitpod-file-parser.js.map +1 -1
  53. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  54. package/lib/gitpod-file-parser.spec.js +117 -117
  55. package/lib/gitpod-file-parser.spec.js.map +1 -1
  56. package/lib/gitpod-service.d.ts +165 -21
  57. package/lib/gitpod-service.d.ts.map +1 -1
  58. package/lib/gitpod-service.js +171 -257
  59. package/lib/gitpod-service.js.map +1 -1
  60. package/lib/headless-workspace-log.d.ts +9 -12
  61. package/lib/headless-workspace-log.d.ts.map +1 -1
  62. package/lib/headless-workspace-log.js +5 -8
  63. package/lib/headless-workspace-log.js.map +1 -1
  64. package/lib/ide-frontend-service.d.ts +5 -1
  65. package/lib/ide-frontend-service.d.ts.map +1 -1
  66. package/lib/ide-frontend-service.js +1 -1
  67. package/lib/ide-protocol.d.ts +105 -0
  68. package/lib/ide-protocol.d.ts.map +1 -0
  69. package/lib/{util/without.js → ide-protocol.js} +2 -2
  70. package/lib/ide-protocol.js.map +1 -0
  71. package/lib/index.d.ts +7 -1
  72. package/lib/index.d.ts.map +1 -1
  73. package/lib/index.js +8 -2
  74. package/lib/index.js.map +1 -1
  75. package/lib/installation-admin-protocol.d.ts +27 -0
  76. package/lib/installation-admin-protocol.d.ts.map +1 -0
  77. package/lib/installation-admin-protocol.js +30 -0
  78. package/lib/installation-admin-protocol.js.map +1 -0
  79. package/lib/license-protocol.d.ts +1 -1
  80. package/lib/license-protocol.js +1 -1
  81. package/lib/messaging/browser/connection.d.ts +5 -3
  82. package/lib/messaging/browser/connection.d.ts.map +1 -1
  83. package/lib/messaging/browser/connection.js +183 -33
  84. package/lib/messaging/browser/connection.js.map +1 -1
  85. package/lib/messaging/browser/window-connection.d.ts +1 -1
  86. package/lib/messaging/browser/window-connection.js +36 -56
  87. package/lib/messaging/browser/window-connection.js.map +1 -1
  88. package/lib/messaging/client-call-metrics.d.ts +35 -0
  89. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  90. package/lib/messaging/client-call-metrics.js +83 -0
  91. package/lib/messaging/client-call-metrics.js.map +1 -0
  92. package/lib/messaging/error.d.ts +7 -2
  93. package/lib/messaging/error.d.ts.map +1 -1
  94. package/lib/messaging/error.js +14 -4
  95. package/lib/messaging/error.js.map +1 -1
  96. package/lib/messaging/handler.d.ts +10 -0
  97. package/lib/messaging/handler.d.ts.map +1 -1
  98. package/lib/messaging/node/connection.d.ts +1 -17
  99. package/lib/messaging/node/connection.d.ts.map +1 -1
  100. package/lib/messaging/node/connection.js +23 -59
  101. package/lib/messaging/node/connection.js.map +1 -1
  102. package/lib/messaging/proxy-factory.d.ts +2 -0
  103. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  104. package/lib/messaging/proxy-factory.js +74 -159
  105. package/lib/messaging/proxy-factory.js.map +1 -1
  106. package/lib/oss-allowlist.d.ts +14 -0
  107. package/lib/oss-allowlist.d.ts.map +1 -0
  108. package/lib/oss-allowlist.js +8 -0
  109. package/lib/oss-allowlist.js.map +1 -0
  110. package/lib/payment-protocol.d.ts +18 -0
  111. package/lib/payment-protocol.d.ts.map +1 -0
  112. package/lib/payment-protocol.js +13 -0
  113. package/lib/payment-protocol.js.map +1 -0
  114. package/lib/permission.d.ts +10 -5
  115. package/lib/permission.d.ts.map +1 -1
  116. package/lib/permission.js +38 -21
  117. package/lib/permission.js.map +1 -1
  118. package/lib/plans.d.ts +210 -0
  119. package/lib/plans.d.ts.map +1 -0
  120. package/lib/plans.js +570 -0
  121. package/lib/plans.js.map +1 -0
  122. package/lib/protocol.d.ts +134 -59
  123. package/lib/protocol.d.ts.map +1 -1
  124. package/lib/protocol.js +129 -118
  125. package/lib/protocol.js.map +1 -1
  126. package/lib/snapshot-url.d.ts +14 -0
  127. package/lib/snapshot-url.d.ts.map +1 -0
  128. package/lib/snapshot-url.js +26 -0
  129. package/lib/snapshot-url.js.map +1 -0
  130. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +3 -4
  131. package/lib/snapshot-url.spec.d.ts.map +1 -0
  132. package/lib/snapshot-url.spec.js +41 -0
  133. package/lib/snapshot-url.spec.js.map +1 -0
  134. package/lib/team-subscription-protocol.d.ts +73 -0
  135. package/lib/team-subscription-protocol.d.ts.map +1 -0
  136. package/lib/team-subscription-protocol.js +63 -0
  137. package/lib/team-subscription-protocol.js.map +1 -0
  138. package/lib/teams-projects-protocol.d.ts +113 -0
  139. package/lib/teams-projects-protocol.d.ts.map +1 -0
  140. package/lib/teams-projects-protocol.js +30 -0
  141. package/lib/teams-projects-protocol.js.map +1 -0
  142. package/lib/theia-plugins.d.ts +1 -1
  143. package/lib/theia-plugins.js +1 -1
  144. package/lib/typings/globals.d.ts +1 -1
  145. package/lib/typings/globals.js +1 -1
  146. package/lib/util/analytics.d.ts +8 -0
  147. package/lib/util/analytics.d.ts.map +1 -0
  148. package/lib/util/analytics.js +79 -0
  149. package/lib/util/analytics.js.map +1 -0
  150. package/lib/util/async-iterator.d.ts +1 -1
  151. package/lib/util/async-iterator.js +56 -134
  152. package/lib/util/async-iterator.js.map +1 -1
  153. package/lib/util/cancelable.d.ts +1 -1
  154. package/lib/util/cancelable.js +18 -60
  155. package/lib/util/cancelable.js.map +1 -1
  156. package/lib/util/date-time.d.ts +1 -1
  157. package/lib/util/date-time.js +9 -9
  158. package/lib/util/date-time.js.map +1 -1
  159. package/lib/util/deep-partial.d.ts +1 -1
  160. package/lib/util/deep-partial.js +1 -1
  161. package/lib/util/deferred.d.ts +1 -1
  162. package/lib/util/deferred.js +11 -13
  163. package/lib/util/deferred.js.map +1 -1
  164. package/lib/util/disposable.js +26 -39
  165. package/lib/util/disposable.js.map +1 -1
  166. package/lib/util/event.js +58 -74
  167. package/lib/util/event.js.map +1 -1
  168. package/lib/util/garbage-collected-cache.d.ts +2 -1
  169. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  170. package/lib/util/garbage-collected-cache.js +27 -47
  171. package/lib/util/garbage-collected-cache.js.map +1 -1
  172. package/lib/util/generate-workspace-id.d.ts +4 -0
  173. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  174. package/lib/util/generate-workspace-id.js +487 -0
  175. package/lib/util/generate-workspace-id.js.map +1 -0
  176. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  177. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  178. package/lib/util/generate-workspace-id.spec.js +87 -0
  179. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  180. package/lib/util/gitpod-cookie.d.ts +20 -0
  181. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  182. package/lib/util/gitpod-cookie.js +44 -0
  183. package/lib/util/gitpod-cookie.js.map +1 -0
  184. package/lib/util/gitpod-host-url.d.ts +5 -3
  185. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  186. package/lib/util/gitpod-host-url.js +99 -92
  187. package/lib/util/gitpod-host-url.js.map +1 -1
  188. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  189. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  190. package/lib/util/gitpod-host-url.spec.js +124 -0
  191. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  192. package/lib/util/grpc.d.ts +15 -0
  193. package/lib/util/grpc.d.ts.map +1 -0
  194. package/lib/util/grpc.js +18 -0
  195. package/lib/util/grpc.js.map +1 -0
  196. package/lib/util/jaeger-client-types.d.ts +68 -0
  197. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  198. package/lib/util/jaeger-client-types.js +8 -0
  199. package/lib/util/jaeger-client-types.js.map +1 -0
  200. package/lib/util/logging.d.ts +57 -34
  201. package/lib/util/logging.d.ts.map +1 -1
  202. package/lib/util/logging.js +119 -111
  203. package/lib/util/logging.js.map +1 -1
  204. package/lib/util/make-link.d.ts +1 -1
  205. package/lib/util/make-link.js +3 -3
  206. package/lib/util/make-link.js.map +1 -1
  207. package/lib/util/parse-workspace-id.d.ts +14 -4
  208. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  209. package/lib/util/parse-workspace-id.js +39 -9
  210. package/lib/util/parse-workspace-id.js.map +1 -1
  211. package/lib/util/parse-workspace-id.spec.d.ts +9 -1
  212. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  213. package/lib/util/parse-workspace-id.spec.js +128 -48
  214. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  215. package/lib/util/queue.d.ts +1 -1
  216. package/lib/util/queue.js +17 -56
  217. package/lib/util/queue.js.map +1 -1
  218. package/lib/util/queue.spec.d.ts +1 -1
  219. package/lib/util/queue.spec.js +145 -289
  220. package/lib/util/queue.spec.js.map +1 -1
  221. package/lib/util/repeat.d.ts +15 -0
  222. package/lib/util/repeat.d.ts.map +1 -0
  223. package/lib/util/repeat.js +55 -0
  224. package/lib/util/repeat.js.map +1 -0
  225. package/lib/util/semaphore.d.ts +1 -1
  226. package/lib/util/semaphore.js +16 -47
  227. package/lib/util/semaphore.js.map +1 -1
  228. package/lib/util/skip-if.d.ts +1 -1
  229. package/lib/util/skip-if.js +7 -7
  230. package/lib/util/skip-if.js.map +1 -1
  231. package/lib/util/timeutil.d.ts +1 -1
  232. package/lib/util/timeutil.js +29 -17
  233. package/lib/util/timeutil.js.map +1 -1
  234. package/lib/util/timeutil.spec.d.ts +1 -1
  235. package/lib/util/timeutil.spec.js +22 -25
  236. package/lib/util/timeutil.spec.js.map +1 -1
  237. package/lib/util/tracing.d.ts +52 -6
  238. package/lib/util/tracing.d.ts.map +1 -1
  239. package/lib/util/tracing.js +198 -63
  240. package/lib/util/tracing.js.map +1 -1
  241. package/lib/util/tracing.spec.d.ts +7 -0
  242. package/lib/util/tracing.spec.d.ts.map +1 -0
  243. package/lib/util/tracing.spec.js +121 -0
  244. package/lib/util/tracing.spec.js.map +1 -0
  245. package/lib/util/workspace-port-authentication.d.ts +1 -1
  246. package/lib/util/workspace-port-authentication.js +4 -3
  247. package/lib/util/workspace-port-authentication.js.map +1 -1
  248. package/lib/workspace-cluster.d.ts +76 -0
  249. package/lib/workspace-cluster.d.ts.map +1 -0
  250. package/lib/workspace-cluster.js +33 -0
  251. package/lib/workspace-cluster.js.map +1 -0
  252. package/lib/workspace-instance.d.ts +27 -3
  253. package/lib/workspace-instance.d.ts.map +1 -1
  254. package/lib/workspace-instance.js +1 -1
  255. package/lib/wsready.d.ts +1 -1
  256. package/lib/wsready.js +2 -2
  257. package/package.json +33 -17
  258. package/pkg-yarn.lock +18 -9
  259. package/provenance-bundle.jsonl +2 -0
  260. package/src/accounting-protocol.ts +229 -0
  261. package/src/admin-protocol.ts +54 -6
  262. package/src/analytics.ts +54 -0
  263. package/src/auth.ts +27 -0
  264. package/src/context-url.spec.ts +53 -0
  265. package/src/context-url.ts +107 -0
  266. package/src/email-protocol.ts +3 -4
  267. package/src/encryption/container-module.ts +1 -1
  268. package/src/encryption/encryption-engine.spec.ts +1 -1
  269. package/src/encryption/encryption-engine.ts +1 -1
  270. package/src/encryption/encryption-service.ts +1 -1
  271. package/src/encryption/key-provider.ts +1 -1
  272. package/src/env.ts +11 -11
  273. package/src/gitpod-file-parser.spec.ts +1 -1
  274. package/src/gitpod-file-parser.ts +1 -1
  275. package/src/gitpod-service.ts +241 -40
  276. package/src/headless-workspace-log.ts +8 -12
  277. package/src/ide-frontend-service.ts +6 -2
  278. package/src/ide-protocol.ts +119 -0
  279. package/src/index.ts +8 -2
  280. package/src/installation-admin-protocol.ts +42 -0
  281. package/src/license-protocol.ts +1 -1
  282. package/src/messaging/browser/connection.ts +195 -14
  283. package/src/messaging/browser/window-connection.ts +1 -1
  284. package/src/messaging/client-call-metrics.ts +97 -0
  285. package/src/messaging/error.ts +19 -4
  286. package/src/messaging/handler.ts +12 -0
  287. package/src/messaging/node/connection.ts +21 -68
  288. package/src/messaging/proxy-factory.ts +14 -6
  289. package/src/oss-allowlist.ts +15 -0
  290. package/src/payment-protocol.ts +20 -0
  291. package/src/permission.ts +26 -11
  292. package/src/plans.ts +632 -0
  293. package/src/protocol.ts +223 -88
  294. package/src/snapshot-url.spec.ts +25 -0
  295. package/src/snapshot-url.ts +27 -0
  296. package/src/team-subscription-protocol.ts +113 -0
  297. package/src/teams-projects-protocol.ts +147 -0
  298. package/src/theia-plugins.ts +1 -1
  299. package/src/typings/globals.ts +1 -1
  300. package/src/util/analytics.ts +87 -0
  301. package/src/util/async-iterator.ts +1 -1
  302. package/src/util/cancelable.ts +1 -1
  303. package/src/util/date-time.ts +1 -1
  304. package/src/util/deep-partial.ts +1 -1
  305. package/src/util/deferred.ts +2 -2
  306. package/src/util/garbage-collected-cache.ts +10 -4
  307. package/src/util/generate-workspace-id.spec.ts +48 -0
  308. package/src/util/generate-workspace-id.ts +475 -0
  309. package/src/util/gitpod-cookie.ts +39 -0
  310. package/src/util/gitpod-host-url.spec.ts +49 -0
  311. package/src/util/gitpod-host-url.ts +36 -14
  312. package/src/util/grpc.ts +15 -0
  313. package/src/util/jaeger-client-types.ts +102 -0
  314. package/src/util/logging.ts +111 -39
  315. package/src/util/make-link.ts +1 -1
  316. package/src/util/parse-workspace-id.spec.ts +46 -5
  317. package/src/util/parse-workspace-id.ts +39 -8
  318. package/src/util/queue.spec.ts +2 -2
  319. package/src/util/queue.ts +1 -1
  320. package/src/util/repeat.ts +45 -0
  321. package/src/util/semaphore.ts +3 -3
  322. package/src/util/skip-if.ts +2 -2
  323. package/src/util/timeutil.spec.ts +1 -1
  324. package/src/util/timeutil.ts +5 -5
  325. package/src/util/tracing.spec.ts +83 -0
  326. package/src/util/tracing.ts +184 -18
  327. package/src/util/workspace-port-authentication.ts +1 -1
  328. package/src/workspace-cluster.ts +104 -0
  329. package/src/workspace-instance.ts +52 -14
  330. package/src/wsready.ts +2 -2
  331. package/lib/messaging/connection-error-handler.d.ts +0 -27
  332. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  333. package/lib/messaging/connection-error-handler.js +0 -46
  334. package/lib/messaging/connection-error-handler.js.map +0 -1
  335. package/lib/util/repeater.d.ts +0 -22
  336. package/lib/util/repeater.d.ts.map +0 -1
  337. package/lib/util/repeater.js +0 -118
  338. package/lib/util/repeater.js.map +0 -1
  339. package/lib/util/safe-promise.d.ts +0 -11
  340. package/lib/util/safe-promise.d.ts.map +0 -1
  341. package/lib/util/safe-promise.js +0 -34
  342. package/lib/util/safe-promise.js.map +0 -1
  343. package/lib/util/without.d.ts +0 -7
  344. package/lib/util/without.d.ts.map +0 -1
  345. package/lib/util/without.js.map +0 -1
  346. package/src/messaging/connection-error-handler.ts +0 -62
  347. package/src/util/jaeger-client.d.ts +0 -105
  348. package/src/util/repeater.ts +0 -49
  349. package/src/util/safe-promise.ts +0 -26
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ export declare const defaultGRPCOptions: {
7
+ "grpc.keepalive_timeout_ms": number;
8
+ "grpc.keepalive_time_ms": number;
9
+ "grpc.http2.min_time_between_pings_ms": number;
10
+ "grpc.keepalive_permit_without_calls": number;
11
+ "grpc-node.max_session_memory": number;
12
+ "grpc.max_reconnect_backoff_ms": number;
13
+ "grpc.max_receive_message_length": number;
14
+ };
15
+ //# sourceMappingURL=grpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grpc.d.ts","sourceRoot":"","sources":["../../src/util/grpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;CAQ/B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.defaultGRPCOptions = void 0;
9
+ exports.defaultGRPCOptions = {
10
+ "grpc.keepalive_timeout_ms": 10000,
11
+ "grpc.keepalive_time_ms": 60000,
12
+ "grpc.http2.min_time_between_pings_ms": 10000,
13
+ "grpc.keepalive_permit_without_calls": 1,
14
+ "grpc-node.max_session_memory": 50,
15
+ "grpc.max_reconnect_backoff_ms": 5000,
16
+ "grpc.max_receive_message_length": 1024 * 1024 * 16,
17
+ };
18
+ //# sourceMappingURL=grpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grpc.js","sourceRoot":"","sources":["../../src/util/grpc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEW,QAAA,kBAAkB,GAAG;IAC/B,2BAA2B,EAAE,KAAK;IAClC,wBAAwB,EAAE,KAAK;IAC/B,sCAAsC,EAAE,KAAK;IAC7C,qCAAqC,EAAE,CAAC;IACxC,8BAA8B,EAAE,EAAE;IAClC,+BAA+B,EAAE,IAAI;IACrC,iCAAiC,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;CACtD,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ import { opentracing } from "jaeger-client";
7
+ export interface TracingConfig {
8
+ serviceName?: string;
9
+ disable?: boolean;
10
+ sampler?: SamplerConfig;
11
+ reporter?: ReporterConfig;
12
+ }
13
+ export interface TracingOptions {
14
+ reporter?: Reporter;
15
+ metrics?: MetricsFactory;
16
+ logger?: Logger;
17
+ tags?: any;
18
+ }
19
+ export interface ReporterConfig {
20
+ logSpans?: boolean;
21
+ agentHost?: string;
22
+ agentPort?: number;
23
+ flushIntervalMs?: number;
24
+ }
25
+ export interface SamplerConfig {
26
+ type: string;
27
+ param: number;
28
+ host?: string;
29
+ port?: number;
30
+ refreshIntervalMs?: number;
31
+ }
32
+ export interface Logger {
33
+ info(msg: string): void;
34
+ error(msg: string): void;
35
+ }
36
+ export interface Reporter {
37
+ report(span: opentracing.Span): void;
38
+ close(callback?: () => void): void;
39
+ setProcess(serviceName: string, tags: any): void;
40
+ }
41
+ export interface MetricsFactory {
42
+ createCounter(name: string, tags: any): Counter;
43
+ createTimer(name: string, tags: any): Timer;
44
+ createGauge(name: string, tags: any): Gauge;
45
+ }
46
+ export interface Counter {
47
+ increment(delta: number): void;
48
+ }
49
+ export interface Timer {
50
+ record(value: number): void;
51
+ }
52
+ export interface Gauge {
53
+ update(value: number): void;
54
+ }
55
+ export interface SamplingDecision {
56
+ sample: boolean;
57
+ retryable: boolean;
58
+ tags: any;
59
+ }
60
+ export interface Sampler {
61
+ name(): string;
62
+ isSampled(operation: string, tags: any): boolean;
63
+ onCreateSpan(span: opentracing.Span): SamplingDecision;
64
+ onSetOperationName(span: opentracing.Span, operationName: string): SamplingDecision;
65
+ onSetTag(span: opentracing.Span, key: string, value: any): SamplingDecision;
66
+ close(callback: () => void): void;
67
+ }
68
+ //# sourceMappingURL=jaeger-client-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jaeger-client-types.d.ts","sourceRoot":"","sources":["../../src/util/jaeger-client-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QA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;AAGD,MAAM,WAAW,OAAO;IAEpB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAGD,MAAM,WAAW,KAAK;IAElB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAGD,MAAM,WAAW,KAAK;IAElB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAYD,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,MAAM,WAAW,OAAO;IACpB,IAAI,IAAI,MAAM,CAAA;IACd,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IACjD,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,gBAAgB,CAAC;IACvD,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACpF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,gBAAgB,CAAC;IAC5E,KAAK,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;CACpC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=jaeger-client-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jaeger-client-types.js","sourceRoot":"","sources":["../../src/util/jaeger-client-types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
@@ -9,61 +9,84 @@ export interface LogContext {
9
9
  userId?: string;
10
10
  workspaceId?: string;
11
11
  }
12
+ export declare namespace LogContext {
13
+ function from(params: {
14
+ userId?: string;
15
+ user?: any;
16
+ request?: any;
17
+ }): LogContext;
18
+ }
12
19
  export interface LogPayload {
13
20
  }
14
21
  export declare namespace log {
15
- function error(context: LogContext, message: string, error: Error, payload: LogPayload): void;
16
- function error(context: LogContext, message: string, error: Error): void;
22
+ function error(context: LogContext, message: string, error: any, payload: LogPayload): void;
23
+ function error(context: LogContext, message: string, error: any): void;
17
24
  function error(context: LogContext, message: string, payload: LogPayload): void;
18
25
  function error(context: LogContext, message: string): void;
19
- function error(context: LogContext, error: Error, payload: LogPayload): void;
20
- function error(context: LogContext, error: Error): void;
21
- function error(message: string, error: Error, payload: LogPayload): void;
22
- function error(message: string, error: Error): void;
26
+ function error(context: LogContext, error: any, payload: LogPayload): void;
27
+ function error(context: LogContext, error: any): void;
28
+ function error(message: string, error: any, payload: LogPayload): void;
29
+ function error(message: string, error: any): void;
23
30
  function error(message: string, payload: LogPayload): void;
24
31
  function error(message: string): void;
25
- function error(error: Error, payload: LogPayload): void;
26
- function error(error: Error): void;
27
- function warn(context: LogContext, message: string, error: Error, payload: LogPayload): void;
28
- function warn(context: LogContext, message: string, error: Error): void;
32
+ function error(error: any, payload: LogPayload): void;
33
+ function error(error: any): void;
34
+ function warn(context: LogContext, message: string, error: any, payload: LogPayload): void;
35
+ function warn(context: LogContext, message: string, error: any): void;
29
36
  function warn(context: LogContext, message: string, payload: LogPayload): void;
30
37
  function warn(context: LogContext, message: string): void;
31
- function warn(context: LogContext, error: Error, payload: LogPayload): void;
32
- function warn(context: LogContext, error: Error): void;
33
- function warn(message: string, error: Error, payload: LogPayload): void;
34
- function warn(message: string, error: Error): void;
38
+ function warn(context: LogContext, error: any, payload: LogPayload): void;
39
+ function warn(context: LogContext, error: any): void;
40
+ function warn(message: string, error: any, payload: LogPayload): void;
41
+ function warn(message: string, error: any): void;
35
42
  function warn(message: string, payload: LogPayload): void;
36
43
  function warn(message: string): void;
37
- function warn(error: Error, payload: LogPayload): void;
38
- function warn(error: Error): void;
39
- function info(context: LogContext, message: string, error: Error, payload: LogPayload): void;
40
- function info(context: LogContext, message: string, error: Error): void;
44
+ function warn(error: any, payload: LogPayload): void;
45
+ function warn(error: any): void;
46
+ function info(context: LogContext, message: string, error: any, payload: LogPayload): void;
47
+ function info(context: LogContext, message: string, error: any): void;
41
48
  function info(context: LogContext, message: string, payload: LogPayload): void;
42
49
  function info(context: LogContext, message: string): void;
43
- function info(context: LogContext, error: Error, payload: LogPayload): void;
44
- function info(context: LogContext, error: Error): void;
45
- function info(message: string, error: Error, payload: LogPayload): void;
46
- function info(message: string, error: Error): void;
50
+ function info(context: LogContext, error: any, payload: LogPayload): void;
51
+ function info(context: LogContext, error: any): void;
52
+ function info(message: string, error: any, payload: LogPayload): void;
53
+ function info(message: string, error: any): void;
47
54
  function info(message: string, payload: LogPayload): void;
48
55
  function info(message: string): void;
49
- function info(error: Error, payload: LogPayload): void;
50
- function info(error: Error): void;
51
- function debug(context: LogContext, message: string, error: Error, payload: LogPayload): void;
52
- function debug(context: LogContext, message: string, error: Error): void;
56
+ function info(error: any, payload: LogPayload): void;
57
+ function info(error: any): void;
58
+ function debug(context: LogContext, message: string, error: any, payload: LogPayload): void;
59
+ function debug(context: LogContext, message: string, error: any): void;
53
60
  function debug(context: LogContext, message: string, payload: LogPayload): void;
54
61
  function debug(context: LogContext, message: string): void;
55
- function debug(context: LogContext, error: Error, payload: LogPayload): void;
56
- function debug(context: LogContext, error: Error): void;
57
- function debug(message: string, error: Error, payload: LogPayload): void;
58
- function debug(message: string, error: Error): void;
62
+ function debug(context: LogContext, error: any, payload: LogPayload): void;
63
+ function debug(context: LogContext, error: any): void;
64
+ function debug(message: string, error: any, payload: LogPayload): void;
65
+ function debug(message: string, error: any): void;
59
66
  function debug(message: string, payload: LogPayload): void;
60
67
  function debug(message: string): void;
61
- function debug(error: Error, payload: LogPayload): void;
62
- function debug(error: Error): void;
68
+ function debug(error: any, payload: LogPayload): void;
69
+ function debug(error: any): void;
63
70
  /**
64
71
  * Do not use in frontend.
65
72
  */
66
- function enableJSONLogging(componentArg: string, versionArg: string | undefined): void;
73
+ function enableJSONLogging(componentArg: string, versionArg: string | undefined, logLevel?: LogrusLogLevel): void;
74
+ function setLogLevel(logLevel: LogrusLogLevel | undefined): void;
67
75
  function resetToDefaultLogging(): void;
76
+ function setVersion(versionArg: string): void;
77
+ }
78
+ export declare type LogrusLogLevel = keyof (typeof LogrusLogLevels);
79
+ export declare const LogrusLogLevels: {
80
+ trace: boolean;
81
+ debug: boolean;
82
+ info: boolean;
83
+ warning: boolean;
84
+ error: boolean;
85
+ fatal: boolean;
86
+ panic: boolean;
87
+ };
88
+ export declare namespace LogrusLogLevel {
89
+ function isGreatherOrEqual(lvl: LogrusLogLevel | undefined, ref: LogrusLogLevel | undefined): boolean;
90
+ function getFromEnv(): LogrusLogLevel | undefined;
68
91
  }
69
92
  //# sourceMappingURL=logging.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/util/logging.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,WAAW,UAAU;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;CAE1B;AAED,yBAAiB,GAAG,CAAC;IACjB,SAAgB,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAA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,SAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,QAE5C;CACJ;AAyBD,oBAAY,cAAc,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;CAQ3B,CAAA;AACD,yBAAiB,cAAc,CAAC;IAC5B,SAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,EAAE,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAQ3G;IAKD,SAAgB,UAAU,IAAI,cAAc,GAAG,SAAS,CAWvD;CACJ"}
@@ -1,121 +1,82 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
- var __assign = (this && this.__assign) || function () {
8
- __assign = Object.assign || function(t) {
9
- for (var s, i = 1, n = arguments.length; i < n; i++) {
10
- s = arguments[i];
11
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12
- t[p] = s[p];
13
- }
14
- return t;
15
- };
16
- return __assign.apply(this, arguments);
17
- };
18
- var __read = (this && this.__read) || function (o, n) {
19
- var m = typeof Symbol === "function" && o[Symbol.iterator];
20
- if (!m) return o;
21
- var i = m.call(o), r, ar = [], e;
22
- try {
23
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
24
- }
25
- catch (error) { e = { error: error }; }
26
- finally {
27
- try {
28
- if (r && !r.done && (m = i["return"])) m.call(i);
29
- }
30
- finally { if (e) throw e.error; }
31
- }
32
- return ar;
33
- };
34
- var __spread = (this && this.__spread) || function () {
35
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
36
- return ar;
37
- };
38
7
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.log = void 0;
40
- var inspect = require('util').inspect; // undefined in frontend
41
- var jsonLogging = false;
42
- var component;
43
- var version;
8
+ exports.LogrusLogLevel = exports.LogrusLogLevels = exports.log = exports.LogContext = void 0;
9
+ const inspect = require('util').inspect; // undefined in frontend
10
+ let jsonLogging = false;
11
+ let component;
12
+ let version;
44
13
  ;
14
+ var LogContext;
15
+ (function (LogContext) {
16
+ function from(params) {
17
+ var _a, _b;
18
+ return {
19
+ sessionId: (_a = params.request) === null || _a === void 0 ? void 0 : _a.requestID,
20
+ userId: params.userId || ((_b = params.user) === null || _b === void 0 ? void 0 : _b.id)
21
+ };
22
+ }
23
+ LogContext.from = from;
24
+ })(LogContext = exports.LogContext || (exports.LogContext = {}));
45
25
  ;
46
26
  var log;
47
27
  (function (log) {
48
- function error() {
49
- var args = [];
50
- for (var _i = 0; _i < arguments.length; _i++) {
51
- args[_i] = arguments[_i];
52
- }
28
+ function error(...args) {
53
29
  errorLog(false, args);
54
30
  }
55
31
  log.error = error;
56
- function warn() {
57
- var args = [];
58
- for (var _i = 0; _i < arguments.length; _i++) {
59
- args[_i] = arguments[_i];
60
- }
32
+ function warn(...args) {
61
33
  warnLog(false, args);
62
34
  }
63
35
  log.warn = warn;
64
- function info() {
65
- var args = [];
66
- for (var _i = 0; _i < arguments.length; _i++) {
67
- args[_i] = arguments[_i];
68
- }
36
+ function info(...args) {
69
37
  infoLog(false, args);
70
38
  }
71
39
  log.info = info;
72
- function debug() {
73
- var args = [];
74
- for (var _i = 0; _i < arguments.length; _i++) {
75
- args[_i] = arguments[_i];
76
- }
40
+ function debug(...args) {
77
41
  debugLog(false, args);
78
42
  }
79
43
  log.debug = debug;
80
44
  /**
81
45
  * Do not use in frontend.
82
46
  */
83
- function enableJSONLogging(componentArg, versionArg) {
47
+ function enableJSONLogging(componentArg, versionArg, logLevel) {
84
48
  component = componentArg;
85
49
  version = versionArg;
50
+ setLogLevel(logLevel);
51
+ }
52
+ log.enableJSONLogging = enableJSONLogging;
53
+ function setLogLevel(logLevel) {
86
54
  jsonLogging = true;
87
- console.error = function () {
88
- var args = [];
89
- for (var _i = 0; _i < arguments.length; _i++) {
90
- args[_i] = arguments[_i];
91
- }
55
+ console.error = function (...args) {
92
56
  errorLog(true, args);
93
57
  };
94
- console.warn = function () {
95
- var args = [];
96
- for (var _i = 0; _i < arguments.length; _i++) {
97
- args[_i] = arguments[_i];
98
- }
58
+ console.warn = function (...args) {
99
59
  warnLog(true, args);
100
60
  };
101
- console.info = function () {
102
- var args = [];
103
- for (var _i = 0; _i < arguments.length; _i++) {
104
- args[_i] = arguments[_i];
105
- }
61
+ console.info = function (...args) {
106
62
  infoLog(true, args);
107
63
  };
108
- console.debug = function () {
109
- var args = [];
110
- for (var _i = 0; _i < arguments.length; _i++) {
111
- args[_i] = arguments[_i];
112
- }
64
+ console.debug = function (...args) {
113
65
  debugLog(true, args);
114
66
  };
115
67
  console.log = console.info;
116
68
  // FIXME wrap also other console methods (e.g. trace())
69
+ // set/unset log functions based on loglevel so we only have to evaluate once, not every call
70
+ const noop = () => { };
71
+ const setLog = (logFunc, funcLevel) => {
72
+ return LogrusLogLevel.isGreatherOrEqual(funcLevel, logLevel) ? logFunc : noop;
73
+ };
74
+ errorLog = setLog(doErrorLog, "error");
75
+ warnLog = setLog(doWarnLog, "warning");
76
+ infoLog = setLog(doInfoLog, "info");
77
+ debugLog = setLog(doDebugLog, "debug");
117
78
  }
118
- log.enableJSONLogging = enableJSONLogging;
79
+ log.setLogLevel = setLogLevel;
119
80
  function resetToDefaultLogging() {
120
81
  jsonLogging = false;
121
82
  console.log = logConsoleLog;
@@ -125,22 +86,69 @@ var log;
125
86
  console.debug = debugConsoleLog;
126
87
  }
127
88
  log.resetToDefaultLogging = resetToDefaultLogging;
89
+ function setVersion(versionArg) {
90
+ version = versionArg;
91
+ }
92
+ log.setVersion = setVersion;
128
93
  })(log = exports.log || (exports.log = {}));
129
- function errorLog(calledViaConsole, args) {
94
+ let errorLog = doErrorLog;
95
+ function doErrorLog(calledViaConsole, args) {
130
96
  doLog(calledViaConsole, errorConsoleLog, 'ERROR', args);
131
97
  }
132
- function warnLog(calledViaConsole, args) {
98
+ let warnLog = doWarnLog;
99
+ function doWarnLog(calledViaConsole, args) {
133
100
  doLog(calledViaConsole, warnConsoleLog, 'WARNING', args);
134
101
  }
135
- function infoLog(calledViaConsole, args) {
102
+ let infoLog = doInfoLog;
103
+ function doInfoLog(calledViaConsole, args) {
136
104
  doLog(calledViaConsole, infoConsoleLog, 'INFO', args);
137
105
  }
138
- function debugLog(calledViaConsole, args) {
106
+ let debugLog = doDebugLog;
107
+ function doDebugLog(calledViaConsole, args) {
139
108
  doLog(calledViaConsole, debugConsoleLog, 'DEBUG', args);
140
109
  }
110
+ exports.LogrusLogLevels = {
111
+ trace: true,
112
+ debug: true,
113
+ info: true,
114
+ warning: true,
115
+ error: true,
116
+ fatal: true,
117
+ panic: true,
118
+ };
119
+ var LogrusLogLevel;
120
+ (function (LogrusLogLevel) {
121
+ function isGreatherOrEqual(lvl, ref) {
122
+ if (lvl === undefined) {
123
+ return false;
124
+ }
125
+ if (ref === undefined) {
126
+ return true;
127
+ }
128
+ return getLevelArity(lvl) >= getLevelArity(ref);
129
+ }
130
+ LogrusLogLevel.isGreatherOrEqual = isGreatherOrEqual;
131
+ function getLevelArity(lvl) {
132
+ return Object.keys(exports.LogrusLogLevels)
133
+ .findIndex((l) => l === lvl);
134
+ }
135
+ function getFromEnv() {
136
+ const lvlStr = process.env.LOG_LEVEL;
137
+ if (!lvlStr) {
138
+ return undefined;
139
+ }
140
+ const lvl = lvlStr;
141
+ const exists = exports.LogrusLogLevels[lvl];
142
+ if (!exists) {
143
+ return undefined;
144
+ }
145
+ return lvl;
146
+ }
147
+ LogrusLogLevel.getFromEnv = getFromEnv;
148
+ })(LogrusLogLevel = exports.LogrusLogLevel || (exports.LogrusLogLevel = {}));
141
149
  var GoogleLogSeverity;
142
150
  (function (GoogleLogSeverity) {
143
- GoogleLogSeverity.isGreaterOrEqualThanWarning = function (severity) {
151
+ GoogleLogSeverity.isGreaterOrEqualThanWarning = (severity) => {
144
152
  switch (severity) {
145
153
  case 'INFO':
146
154
  case 'DEBUG':
@@ -152,17 +160,17 @@ var GoogleLogSeverity;
152
160
  })(GoogleLogSeverity || (GoogleLogSeverity = {}));
153
161
  function doLog(calledViaConsole, consoleLog, severity, args) {
154
162
  if (!jsonLogging) {
155
- consoleLog.apply(void 0, __spread(args));
163
+ consoleLog(...args);
156
164
  return;
157
165
  }
158
166
  if (args.length == 0) {
159
167
  // console.xyz()
160
168
  return;
161
169
  }
162
- var context;
163
- var message;
164
- var error;
165
- var payloadArgs;
170
+ let context;
171
+ let message;
172
+ let error;
173
+ let payloadArgs;
166
174
  if (args[0] instanceof Error) {
167
175
  // console.xyz(Error, ...any) / log.xyz(Error) / log.xyz(Error, LogPayload)
168
176
  error = args[0];
@@ -210,7 +218,7 @@ function doLog(calledViaConsole, consoleLog, severity, args) {
210
218
  payloadArgs = args;
211
219
  }
212
220
  }
213
- var logItem = makeLogItem(severity, context, message, error, payloadArgs, calledViaConsole);
221
+ const logItem = makeLogItem(severity, context, message, error, payloadArgs, calledViaConsole);
214
222
  if (logItem !== undefined) {
215
223
  consoleLog(logItem);
216
224
  }
@@ -219,20 +227,20 @@ function makeLogItem(severity, context, message, error, payloadArgs, calledViaCo
219
227
  if (context !== undefined && Object.keys(context).length == 0) {
220
228
  context = undefined;
221
229
  }
222
- var reportedErrorEvent = {};
230
+ let reportedErrorEvent = {};
223
231
  if (GoogleLogSeverity.isGreaterOrEqualThanWarning(severity)) {
224
232
  reportedErrorEvent = makeReportedErrorEvent(error);
225
233
  }
226
- var payload = payloadArgs.length == 0 ? undefined : payloadArgs.length == 1 ? payloadArgs[0] : payloadArgs;
227
- var logItem = __assign(__assign({}, reportedErrorEvent), { component: component,
228
- severity: severity, time: new Date().toISOString(), environment: process.env.KUBE_STAGE, region: process.env.GITPOD_REGION, context: context,
229
- message: message,
230
- error: error,
231
- payload: payload, loggedViaConsole: calledViaConsole ? true : undefined });
232
- var result = stringifyLogItem(logItem);
234
+ const payload = payloadArgs.length == 0 ? undefined : payloadArgs.length == 1 ? payloadArgs[0] : payloadArgs;
235
+ const logItem = Object.assign(Object.assign({}, reportedErrorEvent), { component,
236
+ severity, time: new Date().toISOString(), environment: process.env.KUBE_STAGE, context,
237
+ message,
238
+ error,
239
+ payload, loggedViaConsole: calledViaConsole ? true : undefined });
240
+ let result = stringifyLogItem(logItem);
233
241
  if (result.length > maxAllowedLogItemLength && payload !== undefined) {
234
242
  delete logItem.payload;
235
- logItem.payloadStub = "Payload stripped as log item was longer than " + maxAllowedLogItemLength + " characters";
243
+ logItem.payloadStub = `Payload stripped as log item was longer than ${maxAllowedLogItemLength} characters`;
236
244
  result = stringifyLogItem(logItem);
237
245
  if (result.length <= maxAllowedLogItemLength) {
238
246
  log.warn('Log item too large, stripping payload', { logItemStub: makeLogItemStub(logItem) });
@@ -247,7 +255,7 @@ function makeLogItem(severity, context, message, error, payloadArgs, calledViaCo
247
255
  // See https://cloud.google.com/error-reporting/docs/formatting-error-messages
248
256
  // and https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.events/report#ReportedErrorEvent
249
257
  function makeReportedErrorEvent(error) {
250
- var result = {
258
+ const result = {
251
259
  // Serves as marker only
252
260
  "@type": "type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent",
253
261
  // This is useful for filtering in the UI
@@ -258,7 +266,7 @@ function makeReportedErrorEvent(error) {
258
266
  };
259
267
  if (error) {
260
268
  // According to: https://cloud.google.com/error-reporting/docs/formatting-error-messages#json_representation
261
- var stackTrace = error.stack;
269
+ const stackTrace = error.stack;
262
270
  if (stackTrace) {
263
271
  result.stack_trace = stackTrace;
264
272
  }
@@ -266,7 +274,7 @@ function makeReportedErrorEvent(error) {
266
274
  return result;
267
275
  }
268
276
  function makeLogItemStub(logItem) {
269
- var result = {
277
+ const result = {
270
278
  component: logItem.component,
271
279
  severity: logItem.severity,
272
280
  time: logItem.time,
@@ -308,16 +316,16 @@ function stringifyLogItem(logItem) {
308
316
  * Jsonifies Errors properly, not as {} only.
309
317
  */
310
318
  function jsonStringifyWithErrors(value) {
311
- return JSON.stringify(value, function (key, value) { return value instanceof Error ? value.stack : value; });
319
+ return JSON.stringify(value, (key, value) => { return value instanceof Error ? value.stack : value; });
312
320
  }
313
- var logConsoleLog = console.log;
314
- var errorConsoleLog = console.error;
315
- var warnConsoleLog = console.warn;
316
- var infoConsoleLog = console.info;
317
- var debugConsoleLog = console.debug;
321
+ const logConsoleLog = console.log;
322
+ const errorConsoleLog = console.error;
323
+ const warnConsoleLog = console.warn;
324
+ const infoConsoleLog = console.info;
325
+ const debugConsoleLog = console.debug;
318
326
  // according to https://cloud.google.com/logging/quotas#logging_usage_limits, the log item must fit in 100 KB (internal data
319
327
  // size; its relation to the stringified JSON's size is unknown), so let's have a sufficient safe margin
320
- var maxAllowedLogItemLength = 32 * 1024;
321
- var maxMessageStubLength = 1024;
322
- var maxErrorStubLength = 4096;
328
+ const maxAllowedLogItemLength = 32 * 1024;
329
+ const maxMessageStubLength = 1024;
330
+ const maxErrorStubLength = 4096;
323
331
  //# sourceMappingURL=logging.js.map