@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.
- package/data/builtin-theia-plugins.json +28 -18
- package/data/gitpod-schema.json +25 -24
- package/lib/accounting-protocol.d.ts +155 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +109 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +32 -5
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +16 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +14 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +94 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +2 -3
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +5 -5
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +6 -5
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.js +20 -21
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +1 -1
- package/lib/encryption/encryption-engine.spec.js +30 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.js +30 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.js +26 -31
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +2 -3
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +21 -22
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.js +26 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +117 -117
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +165 -21
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +171 -257
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +9 -12
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +5 -8
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +5 -1
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +105 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/{util/without.js → ide-protocol.js} +2 -2
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -2
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/license-protocol.d.ts +1 -1
- package/lib/license-protocol.js +1 -1
- package/lib/messaging/browser/connection.d.ts +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +1 -1
- package/lib/messaging/browser/window-connection.js +36 -56
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +7 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +14 -4
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +23 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +10 -5
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +38 -21
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +134 -59
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +129 -118
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +3 -4
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +73 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +63 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +113 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/theia-plugins.d.ts +1 -1
- package/lib/theia-plugins.js +1 -1
- package/lib/typings/globals.d.ts +1 -1
- package/lib/typings/globals.js +1 -1
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +79 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.d.ts +1 -1
- package/lib/util/async-iterator.js +56 -134
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +18 -60
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +9 -9
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deep-partial.d.ts +1 -1
- package/lib/util/deep-partial.js +1 -1
- package/lib/util/deferred.d.ts +1 -1
- package/lib/util/deferred.js +11 -13
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +2 -1
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +27 -47
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +4 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +487 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/generate-workspace-id.spec.d.ts +7 -0
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +87 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +5 -3
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +99 -92
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +16 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
- package/lib/util/gitpod-host-url.spec.js +124 -0
- package/lib/util/gitpod-host-url.spec.js.map +1 -0
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/jaeger-client-types.js +8 -0
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +57 -34
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +119 -111
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.d.ts +1 -1
- package/lib/util/make-link.js +3 -3
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +14 -4
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +39 -9
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +9 -1
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +128 -48
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +17 -56
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +145 -289
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.js +16 -47
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +7 -7
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +1 -1
- package/lib/util/timeutil.js +29 -17
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +1 -1
- package/lib/util/timeutil.spec.js +22 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +52 -6
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +198 -63
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.js +4 -3
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +76 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +33 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +27 -3
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +33 -17
- package/pkg-yarn.lock +18 -9
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +54 -6
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -0
- package/src/context-url.spec.ts +53 -0
- package/src/context-url.ts +107 -0
- package/src/email-protocol.ts +3 -4
- package/src/encryption/container-module.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +1 -1
- package/src/encryption/encryption-engine.ts +1 -1
- package/src/encryption/encryption-service.ts +1 -1
- package/src/encryption/key-provider.ts +1 -1
- package/src/env.ts +11 -11
- package/src/gitpod-file-parser.spec.ts +1 -1
- package/src/gitpod-file-parser.ts +1 -1
- package/src/gitpod-service.ts +241 -40
- package/src/headless-workspace-log.ts +8 -12
- package/src/ide-frontend-service.ts +6 -2
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +8 -2
- package/src/installation-admin-protocol.ts +42 -0
- package/src/license-protocol.ts +1 -1
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/browser/window-connection.ts +1 -1
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +19 -4
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +26 -11
- package/src/plans.ts +632 -0
- package/src/protocol.ts +223 -88
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +113 -0
- package/src/teams-projects-protocol.ts +147 -0
- package/src/theia-plugins.ts +1 -1
- package/src/typings/globals.ts +1 -1
- package/src/util/analytics.ts +87 -0
- package/src/util/async-iterator.ts +1 -1
- package/src/util/cancelable.ts +1 -1
- package/src/util/date-time.ts +1 -1
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +2 -2
- package/src/util/garbage-collected-cache.ts +10 -4
- package/src/util/generate-workspace-id.spec.ts +48 -0
- package/src/util/generate-workspace-id.ts +475 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +49 -0
- package/src/util/gitpod-host-url.ts +36 -14
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +111 -39
- package/src/util/make-link.ts +1 -1
- package/src/util/parse-workspace-id.spec.ts +46 -5
- package/src/util/parse-workspace-id.ts +39 -8
- package/src/util/queue.spec.ts +2 -2
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +3 -3
- package/src/util/skip-if.ts +2 -2
- package/src/util/timeutil.spec.ts +1 -1
- package/src/util/timeutil.ts +5 -5
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +184 -18
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/workspace-cluster.ts +104 -0
- package/src/workspace-instance.ts +52 -14
- package/src/wsready.ts +2 -2
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -46
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -118
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- 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"}
|
package/lib/util/grpc.js
ADDED
|
@@ -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,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B;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S,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"}
|
package/lib/util/logging.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
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:
|
|
16
|
-
function error(context: LogContext, message: string, error:
|
|
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:
|
|
20
|
-
function error(context: LogContext, error:
|
|
21
|
-
function error(message: string, error:
|
|
22
|
-
function error(message: string, error:
|
|
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:
|
|
26
|
-
function error(error:
|
|
27
|
-
function warn(context: LogContext, message: string, error:
|
|
28
|
-
function warn(context: LogContext, message: string, error:
|
|
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:
|
|
32
|
-
function warn(context: LogContext, error:
|
|
33
|
-
function warn(message: string, error:
|
|
34
|
-
function warn(message: string, error:
|
|
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:
|
|
38
|
-
function warn(error:
|
|
39
|
-
function info(context: LogContext, message: string, error:
|
|
40
|
-
function info(context: LogContext, message: string, error:
|
|
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:
|
|
44
|
-
function info(context: LogContext, error:
|
|
45
|
-
function info(message: string, error:
|
|
46
|
-
function info(message: string, error:
|
|
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:
|
|
50
|
-
function info(error:
|
|
51
|
-
function debug(context: LogContext, message: string, error:
|
|
52
|
-
function debug(context: LogContext, message: string, error:
|
|
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:
|
|
56
|
-
function debug(context: LogContext, error:
|
|
57
|
-
function debug(message: string, error:
|
|
58
|
-
function debug(message: string, error:
|
|
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:
|
|
62
|
-
function debug(error:
|
|
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,
|
|
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;AACD,yBAAiB,UAAU,CAAC;IACxB,SAAgB,IAAI,CAAC,MAAM,EAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,cAK3E;CACJ;AAED,MAAM,WAAW,UAAU;CAE1B;AAED,yBAAiB,GAAG,CAAC;IACjB,SAAgB,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,GAAG,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GAAG,OAAO,CAQ3G;IAKD,SAAgB,UAAU,IAAI,cAAc,GAAG,SAAS,CAWvD;CACJ"}
|
package/lib/util/logging.js
CHANGED
|
@@ -1,121 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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.
|
|
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
|
-
|
|
94
|
+
let errorLog = doErrorLog;
|
|
95
|
+
function doErrorLog(calledViaConsole, args) {
|
|
130
96
|
doLog(calledViaConsole, errorConsoleLog, 'ERROR', args);
|
|
131
97
|
}
|
|
132
|
-
|
|
98
|
+
let warnLog = doWarnLog;
|
|
99
|
+
function doWarnLog(calledViaConsole, args) {
|
|
133
100
|
doLog(calledViaConsole, warnConsoleLog, 'WARNING', args);
|
|
134
101
|
}
|
|
135
|
-
|
|
102
|
+
let infoLog = doInfoLog;
|
|
103
|
+
function doInfoLog(calledViaConsole, args) {
|
|
136
104
|
doLog(calledViaConsole, infoConsoleLog, 'INFO', args);
|
|
137
105
|
}
|
|
138
|
-
|
|
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 =
|
|
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
|
|
163
|
+
consoleLog(...args);
|
|
156
164
|
return;
|
|
157
165
|
}
|
|
158
166
|
if (args.length == 0) {
|
|
159
167
|
// console.xyz()
|
|
160
168
|
return;
|
|
161
169
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
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
|
-
|
|
230
|
+
let reportedErrorEvent = {};
|
|
223
231
|
if (GoogleLogSeverity.isGreaterOrEqualThanWarning(severity)) {
|
|
224
232
|
reportedErrorEvent = makeReportedErrorEvent(error);
|
|
225
233
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
severity
|
|
229
|
-
message
|
|
230
|
-
error
|
|
231
|
-
payload
|
|
232
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
319
|
+
return JSON.stringify(value, (key, value) => { return value instanceof Error ? value.stack : value; });
|
|
312
320
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
328
|
+
const maxAllowedLogItemLength = 32 * 1024;
|
|
329
|
+
const maxMessageStubLength = 1024;
|
|
330
|
+
const maxErrorStubLength = 4096;
|
|
323
331
|
//# sourceMappingURL=logging.js.map
|