@multiplayer-app/session-recorder-common 0.0.1
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/LICENSE +22 -0
- package/README.md +230 -0
- package/dist/esm/SessionRecorderHttpInstrumentationHooksNode.d.ts +35 -0
- package/dist/esm/SessionRecorderHttpInstrumentationHooksNode.d.ts.map +1 -0
- package/dist/esm/SessionRecorderHttpInstrumentationHooksNode.js +355 -0
- package/dist/esm/SessionRecorderHttpInstrumentationHooksNode.js.map +1 -0
- package/dist/esm/SessionRecorderHttpTraceExporterBrowser.d.ts +26 -0
- package/dist/esm/SessionRecorderHttpTraceExporterBrowser.d.ts.map +1 -0
- package/dist/esm/SessionRecorderHttpTraceExporterBrowser.js +116 -0
- package/dist/esm/SessionRecorderHttpTraceExporterBrowser.js.map +1 -0
- package/dist/esm/SessionRecorderIdGenerator.d.ts +15 -0
- package/dist/esm/SessionRecorderIdGenerator.d.ts.map +1 -0
- package/dist/esm/SessionRecorderIdGenerator.js +63 -0
- package/dist/esm/SessionRecorderIdGenerator.js.map +1 -0
- package/dist/esm/SessionRecorderJsonTraceSerializer.d.ts +4 -0
- package/dist/esm/SessionRecorderJsonTraceSerializer.d.ts.map +1 -0
- package/dist/esm/SessionRecorderJsonTraceSerializer.js +26 -0
- package/dist/esm/SessionRecorderJsonTraceSerializer.js.map +1 -0
- package/dist/esm/SessionRecorderTraceIdRatioBasedSampler.d.ts +11 -0
- package/dist/esm/SessionRecorderTraceIdRatioBasedSampler.d.ts.map +1 -0
- package/dist/esm/SessionRecorderTraceIdRatioBasedSampler.js +45 -0
- package/dist/esm/SessionRecorderTraceIdRatioBasedSampler.js.map +1 -0
- package/dist/esm/constants.base.d.ts +32 -0
- package/dist/esm/constants.base.d.ts.map +1 -0
- package/dist/esm/constants.base.js +32 -0
- package/dist/esm/constants.base.js.map +1 -0
- package/dist/esm/constants.browser.d.ts +2 -0
- package/dist/esm/constants.browser.d.ts.map +1 -0
- package/dist/esm/constants.browser.js +2 -0
- package/dist/esm/constants.browser.js.map +1 -0
- package/dist/esm/constants.node.d.ts +3 -0
- package/dist/esm/constants.node.d.ts.map +1 -0
- package/dist/esm/constants.node.js +5 -0
- package/dist/esm/constants.node.js.map +1 -0
- package/dist/esm/index-browser.d.ts +8 -0
- package/dist/esm/index-browser.d.ts.map +1 -0
- package/dist/esm/index-browser.js +9 -0
- package/dist/esm/index-browser.js.map +1 -0
- package/dist/esm/index-node.d.ts +8 -0
- package/dist/esm/index-node.d.ts.map +1 -0
- package/dist/esm/index-node.js +9 -0
- package/dist/esm/index-node.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/sdk/capture-exception.d.ts +7 -0
- package/dist/esm/sdk/capture-exception.d.ts.map +1 -0
- package/dist/esm/sdk/capture-exception.js +19 -0
- package/dist/esm/sdk/capture-exception.js.map +1 -0
- package/dist/esm/sdk/id-generator.d.ts +2 -0
- package/dist/esm/sdk/id-generator.d.ts.map +1 -0
- package/dist/esm/sdk/id-generator.js +14 -0
- package/dist/esm/sdk/id-generator.js.map +1 -0
- package/dist/esm/sdk/index.d.ts +8 -0
- package/dist/esm/sdk/index.d.ts.map +1 -0
- package/dist/esm/sdk/index.js +8 -0
- package/dist/esm/sdk/index.js.map +1 -0
- package/dist/esm/sdk/is-gzip.d.ts +2 -0
- package/dist/esm/sdk/is-gzip.d.ts.map +1 -0
- package/dist/esm/sdk/is-gzip.js +7 -0
- package/dist/esm/sdk/is-gzip.js.map +1 -0
- package/dist/esm/sdk/mask.d.ts +6 -0
- package/dist/esm/sdk/mask.d.ts.map +1 -0
- package/dist/esm/sdk/mask.js +148 -0
- package/dist/esm/sdk/mask.js.map +1 -0
- package/dist/esm/sdk/save-continuous-deb-session.d.ts +7 -0
- package/dist/esm/sdk/save-continuous-deb-session.d.ts.map +1 -0
- package/dist/esm/sdk/save-continuous-deb-session.js +21 -0
- package/dist/esm/sdk/save-continuous-deb-session.js.map +1 -0
- package/dist/esm/sdk/schemify.d.ts +4 -0
- package/dist/esm/sdk/schemify.d.ts.map +1 -0
- package/dist/esm/sdk/schemify.js +51 -0
- package/dist/esm/sdk/schemify.js.map +1 -0
- package/dist/esm/sdk/set-attribute.d.ts +90 -0
- package/dist/esm/sdk/set-attribute.d.ts.map +1 -0
- package/dist/esm/sdk/set-attribute.js +160 -0
- package/dist/esm/sdk/set-attribute.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/esm/type/index.d.ts +2 -0
- package/dist/esm/type/index.d.ts.map +1 -0
- package/dist/esm/type/index.js +2 -0
- package/dist/esm/type/index.js.map +1 -0
- package/dist/esm/type/session-type.enum.d.ts +5 -0
- package/dist/esm/type/session-type.enum.d.ts.map +1 -0
- package/dist/esm/type/session-type.enum.js +6 -0
- package/dist/esm/type/session-type.enum.js.map +1 -0
- package/dist/esnext/SessionRecorderHttpInstrumentationHooksNode.d.ts +35 -0
- package/dist/esnext/SessionRecorderHttpInstrumentationHooksNode.d.ts.map +1 -0
- package/dist/esnext/SessionRecorderHttpInstrumentationHooksNode.js +221 -0
- package/dist/esnext/SessionRecorderHttpInstrumentationHooksNode.js.map +1 -0
- package/dist/esnext/SessionRecorderHttpTraceExporterBrowser.d.ts +26 -0
- package/dist/esnext/SessionRecorderHttpTraceExporterBrowser.d.ts.map +1 -0
- package/dist/esnext/SessionRecorderHttpTraceExporterBrowser.js +82 -0
- package/dist/esnext/SessionRecorderHttpTraceExporterBrowser.js.map +1 -0
- package/dist/esnext/SessionRecorderIdGenerator.d.ts +15 -0
- package/dist/esnext/SessionRecorderIdGenerator.d.ts.map +1 -0
- package/dist/esnext/SessionRecorderIdGenerator.js +42 -0
- package/dist/esnext/SessionRecorderIdGenerator.js.map +1 -0
- package/dist/esnext/SessionRecorderJsonTraceSerializer.d.ts +4 -0
- package/dist/esnext/SessionRecorderJsonTraceSerializer.d.ts.map +1 -0
- package/dist/esnext/SessionRecorderJsonTraceSerializer.js +26 -0
- package/dist/esnext/SessionRecorderJsonTraceSerializer.js.map +1 -0
- package/dist/esnext/SessionRecorderTraceIdRatioBasedSampler.d.ts +11 -0
- package/dist/esnext/SessionRecorderTraceIdRatioBasedSampler.d.ts.map +1 -0
- package/dist/esnext/SessionRecorderTraceIdRatioBasedSampler.js +42 -0
- package/dist/esnext/SessionRecorderTraceIdRatioBasedSampler.js.map +1 -0
- package/dist/esnext/constants.base.d.ts +32 -0
- package/dist/esnext/constants.base.d.ts.map +1 -0
- package/dist/esnext/constants.base.js +32 -0
- package/dist/esnext/constants.base.js.map +1 -0
- package/dist/esnext/constants.browser.d.ts +2 -0
- package/dist/esnext/constants.browser.d.ts.map +1 -0
- package/dist/esnext/constants.browser.js +2 -0
- package/dist/esnext/constants.browser.js.map +1 -0
- package/dist/esnext/constants.node.d.ts +3 -0
- package/dist/esnext/constants.node.d.ts.map +1 -0
- package/dist/esnext/constants.node.js +5 -0
- package/dist/esnext/constants.node.js.map +1 -0
- package/dist/esnext/index-browser.d.ts +8 -0
- package/dist/esnext/index-browser.d.ts.map +1 -0
- package/dist/esnext/index-browser.js +8 -0
- package/dist/esnext/index-browser.js.map +1 -0
- package/dist/esnext/index-node.d.ts +8 -0
- package/dist/esnext/index-node.d.ts.map +1 -0
- package/dist/esnext/index-node.js +8 -0
- package/dist/esnext/index-node.js.map +1 -0
- package/dist/esnext/index.d.ts +9 -0
- package/dist/esnext/index.d.ts.map +1 -0
- package/dist/esnext/index.js +9 -0
- package/dist/esnext/index.js.map +1 -0
- package/dist/esnext/sdk/capture-exception.d.ts +7 -0
- package/dist/esnext/sdk/capture-exception.d.ts.map +1 -0
- package/dist/esnext/sdk/capture-exception.js +19 -0
- package/dist/esnext/sdk/capture-exception.js.map +1 -0
- package/dist/esnext/sdk/id-generator.d.ts +2 -0
- package/dist/esnext/sdk/id-generator.d.ts.map +1 -0
- package/dist/esnext/sdk/id-generator.js +14 -0
- package/dist/esnext/sdk/id-generator.js.map +1 -0
- package/dist/esnext/sdk/index.d.ts +8 -0
- package/dist/esnext/sdk/index.d.ts.map +1 -0
- package/dist/esnext/sdk/index.js +8 -0
- package/dist/esnext/sdk/index.js.map +1 -0
- package/dist/esnext/sdk/is-gzip.d.ts +2 -0
- package/dist/esnext/sdk/is-gzip.d.ts.map +1 -0
- package/dist/esnext/sdk/is-gzip.js +7 -0
- package/dist/esnext/sdk/is-gzip.js.map +1 -0
- package/dist/esnext/sdk/mask.d.ts +6 -0
- package/dist/esnext/sdk/mask.d.ts.map +1 -0
- package/dist/esnext/sdk/mask.js +144 -0
- package/dist/esnext/sdk/mask.js.map +1 -0
- package/dist/esnext/sdk/save-continuous-deb-session.d.ts +7 -0
- package/dist/esnext/sdk/save-continuous-deb-session.d.ts.map +1 -0
- package/dist/esnext/sdk/save-continuous-deb-session.js +21 -0
- package/dist/esnext/sdk/save-continuous-deb-session.js.map +1 -0
- package/dist/esnext/sdk/schemify.d.ts +4 -0
- package/dist/esnext/sdk/schemify.d.ts.map +1 -0
- package/dist/esnext/sdk/schemify.js +49 -0
- package/dist/esnext/sdk/schemify.js.map +1 -0
- package/dist/esnext/sdk/set-attribute.d.ts +90 -0
- package/dist/esnext/sdk/set-attribute.d.ts.map +1 -0
- package/dist/esnext/sdk/set-attribute.js +151 -0
- package/dist/esnext/sdk/set-attribute.js.map +1 -0
- package/dist/esnext/tsconfig.esnext.tsbuildinfo +1 -0
- package/dist/esnext/type/index.d.ts +2 -0
- package/dist/esnext/type/index.d.ts.map +1 -0
- package/dist/esnext/type/index.js +2 -0
- package/dist/esnext/type/index.js.map +1 -0
- package/dist/esnext/type/session-type.enum.d.ts +5 -0
- package/dist/esnext/type/session-type.enum.d.ts.map +1 -0
- package/dist/esnext/type/session-type.enum.js +6 -0
- package/dist/esnext/type/session-type.enum.js.map +1 -0
- package/dist/src/SessionRecorderHttpInstrumentationHooksNode.d.ts +35 -0
- package/dist/src/SessionRecorderHttpInstrumentationHooksNode.d.ts.map +1 -0
- package/dist/src/SessionRecorderHttpInstrumentationHooksNode.js +224 -0
- package/dist/src/SessionRecorderHttpInstrumentationHooksNode.js.map +1 -0
- package/dist/src/SessionRecorderHttpTraceExporterBrowser.d.ts +26 -0
- package/dist/src/SessionRecorderHttpTraceExporterBrowser.d.ts.map +1 -0
- package/dist/src/SessionRecorderHttpTraceExporterBrowser.js +86 -0
- package/dist/src/SessionRecorderHttpTraceExporterBrowser.js.map +1 -0
- package/dist/src/SessionRecorderIdGenerator.d.ts +15 -0
- package/dist/src/SessionRecorderIdGenerator.d.ts.map +1 -0
- package/dist/src/SessionRecorderIdGenerator.js +46 -0
- package/dist/src/SessionRecorderIdGenerator.js.map +1 -0
- package/dist/src/SessionRecorderJsonTraceSerializer.d.ts +4 -0
- package/dist/src/SessionRecorderJsonTraceSerializer.d.ts.map +1 -0
- package/dist/src/SessionRecorderJsonTraceSerializer.js +29 -0
- package/dist/src/SessionRecorderJsonTraceSerializer.js.map +1 -0
- package/dist/src/SessionRecorderTraceIdRatioBasedSampler.d.ts +11 -0
- package/dist/src/SessionRecorderTraceIdRatioBasedSampler.d.ts.map +1 -0
- package/dist/src/SessionRecorderTraceIdRatioBasedSampler.js +46 -0
- package/dist/src/SessionRecorderTraceIdRatioBasedSampler.js.map +1 -0
- package/dist/src/constants.base.d.ts +32 -0
- package/dist/src/constants.base.d.ts.map +1 -0
- package/dist/src/constants.base.js +35 -0
- package/dist/src/constants.base.js.map +1 -0
- package/dist/src/constants.browser.d.ts +2 -0
- package/dist/src/constants.browser.d.ts.map +1 -0
- package/dist/src/constants.browser.js +18 -0
- package/dist/src/constants.browser.js.map +1 -0
- package/dist/src/constants.node.d.ts +3 -0
- package/dist/src/constants.node.d.ts.map +1 -0
- package/dist/src/constants.node.js +22 -0
- package/dist/src/constants.node.js.map +1 -0
- package/dist/src/index-browser.d.ts +8 -0
- package/dist/src/index-browser.d.ts.map +1 -0
- package/dist/src/index-browser.js +29 -0
- package/dist/src/index-browser.js.map +1 -0
- package/dist/src/index-node.d.ts +8 -0
- package/dist/src/index-node.d.ts.map +1 -0
- package/dist/src/index-node.js +29 -0
- package/dist/src/index-node.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +31 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/sdk/capture-exception.d.ts +7 -0
- package/dist/src/sdk/capture-exception.d.ts.map +1 -0
- package/dist/src/sdk/capture-exception.js +23 -0
- package/dist/src/sdk/capture-exception.js.map +1 -0
- package/dist/src/sdk/id-generator.d.ts +2 -0
- package/dist/src/sdk/id-generator.d.ts.map +1 -0
- package/dist/src/sdk/id-generator.js +18 -0
- package/dist/src/sdk/id-generator.js.map +1 -0
- package/dist/src/sdk/index.d.ts +8 -0
- package/dist/src/sdk/index.d.ts.map +1 -0
- package/dist/src/sdk/index.js +29 -0
- package/dist/src/sdk/index.js.map +1 -0
- package/dist/src/sdk/is-gzip.d.ts +2 -0
- package/dist/src/sdk/is-gzip.d.ts.map +1 -0
- package/dist/src/sdk/is-gzip.js +11 -0
- package/dist/src/sdk/is-gzip.js.map +1 -0
- package/dist/src/sdk/mask.d.ts +6 -0
- package/dist/src/sdk/mask.d.ts.map +1 -0
- package/dist/src/sdk/mask.js +147 -0
- package/dist/src/sdk/mask.js.map +1 -0
- package/dist/src/sdk/save-continuous-deb-session.d.ts +7 -0
- package/dist/src/sdk/save-continuous-deb-session.d.ts.map +1 -0
- package/dist/src/sdk/save-continuous-deb-session.js +25 -0
- package/dist/src/sdk/save-continuous-deb-session.js.map +1 -0
- package/dist/src/sdk/schemify.d.ts +4 -0
- package/dist/src/sdk/schemify.d.ts.map +1 -0
- package/dist/src/sdk/schemify.js +51 -0
- package/dist/src/sdk/schemify.js.map +1 -0
- package/dist/src/sdk/set-attribute.d.ts +90 -0
- package/dist/src/sdk/set-attribute.d.ts.map +1 -0
- package/dist/src/sdk/set-attribute.js +164 -0
- package/dist/src/sdk/set-attribute.js.map +1 -0
- package/dist/src/type/index.d.ts +2 -0
- package/dist/src/type/index.d.ts.map +1 -0
- package/dist/src/type/index.js +18 -0
- package/dist/src/type/index.js.map +1 -0
- package/dist/src/type/session-type.enum.d.ts +5 -0
- package/dist/src/type/session-type.enum.d.ts.map +1 -0
- package/dist/src/type/session-type.enum.js +9 -0
- package/dist/src/type/session-type.enum.js.map +1 -0
- package/package.json +50 -0
- package/src/SessionRecorderHttpInstrumentationHooksNode.ts +362 -0
- package/src/SessionRecorderHttpTraceExporterBrowser.ts +123 -0
- package/src/SessionRecorderIdGenerator.ts +72 -0
- package/src/SessionRecorderJsonTraceSerializer.ts +43 -0
- package/src/SessionRecorderTraceIdRatioBasedSampler.ts +57 -0
- package/src/constants.base.ts +61 -0
- package/src/constants.browser.ts +1 -0
- package/src/constants.node.ts +5 -0
- package/src/index-browser.ts +7 -0
- package/src/index-node.ts +7 -0
- package/src/index.ts +8 -0
- package/src/sdk/capture-exception.ts +19 -0
- package/src/sdk/id-generator.ts +17 -0
- package/src/sdk/index.ts +7 -0
- package/src/sdk/is-gzip.ts +7 -0
- package/src/sdk/mask.ts +161 -0
- package/src/sdk/save-continuous-deb-session.ts +28 -0
- package/src/sdk/schemify.ts +58 -0
- package/src/sdk/set-attribute.ts +210 -0
- package/src/type/index.ts +1 -0
- package/src/type/session-type.enum.ts +4 -0
- package/tsconfig.base.es5.json +8 -0
- package/tsconfig.base.esm.json +7 -0
- package/tsconfig.base.esnext.json +10 -0
- package/tsconfig.base.json +35 -0
- package/tsconfig.esm.json +12 -0
- package/tsconfig.esnext.json +12 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const MULTIPLAYER_TRACE_DOC_PREFIX = 'd0cd0c'
|
|
2
|
+
|
|
3
|
+
export const MULTIPLAYER_TRACE_DEBUG_PREFIX = 'debdeb'
|
|
4
|
+
|
|
5
|
+
export const MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX = 'cdbcdb'
|
|
6
|
+
|
|
7
|
+
export const MULTIPLAYER_TRACE_DEBUG_SESSION_SHORT_ID_LENGTH = 16
|
|
8
|
+
|
|
9
|
+
export const MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_URL = 'https://api.multiplayer.app/v1/traces'
|
|
10
|
+
|
|
11
|
+
export const MULTIPLAYER_OTEL_DEFAULT_LOGS_EXPORTER_URL = 'https://api.multiplayer.app/v1/logs'
|
|
12
|
+
|
|
13
|
+
export const MULTIPLAYER_ATTRIBUTE_PREFIX = 'multiplayer.'
|
|
14
|
+
|
|
15
|
+
export const ATTR_MULTIPLAYER_WORKSPACE_ID = 'multiplayer.workspace.id'
|
|
16
|
+
|
|
17
|
+
export const ATTR_MULTIPLAYER_PROJECT_ID = 'multiplayer.project.id'
|
|
18
|
+
|
|
19
|
+
export const ATTR_MULTIPLAYER_PLATFORM_ID = 'multiplayer.platform.id'
|
|
20
|
+
|
|
21
|
+
export const ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE = 'multiplayer.session.auto-save'
|
|
22
|
+
|
|
23
|
+
export const ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE_REASON = 'multiplayer.session.auto-save.reason'
|
|
24
|
+
|
|
25
|
+
export const ATTR_MULTIPLAYER_PLATFORM_NAME = 'multiplayer.platform.name'
|
|
26
|
+
|
|
27
|
+
export const ATTR_MULTIPLAYER_CLIENT_ID = 'multiplayer.client.id'
|
|
28
|
+
|
|
29
|
+
export const ATTR_MULTIPLAYER_INTEGRATION_ID = 'multiplayer.integration.id'
|
|
30
|
+
|
|
31
|
+
export const ATTR_MULTIPLAYER_SESSION_ID = 'multiplayer.session.id'
|
|
32
|
+
|
|
33
|
+
export const ATTR_MULTIPLAYER_HTTP_REQUEST_BODY = 'multiplayer.http.request.body'
|
|
34
|
+
|
|
35
|
+
export const ATTR_MULTIPLAYER_HTTP_RESPONSE_BODY = 'multiplayer.http.response.body'
|
|
36
|
+
|
|
37
|
+
export const ATTR_MULTIPLAYER_HTTP_REQUEST_HEADERS = 'multiplayer.http.request.headers'
|
|
38
|
+
|
|
39
|
+
export const ATTR_MULTIPLAYER_HTTP_RESPONSE_HEADERS = 'multiplayer.http.response.headers'
|
|
40
|
+
|
|
41
|
+
export const ATTR_MULTIPLAYER_HTTP_RESPONSE_BODY_ENCODING = 'multiplayer.http.response.body.encoding'
|
|
42
|
+
|
|
43
|
+
export const ATTR_MULTIPLAYER_RPC_REQUEST_MESSAGE = 'multiplayer.rpc.request.message'
|
|
44
|
+
|
|
45
|
+
export const ATTR_MULTIPLAYER_RPC_REQUEST_MESSAGE_ENCODING = 'multiplayer.rpc.request.message.encoding'
|
|
46
|
+
|
|
47
|
+
export const ATTR_MULTIPLAYER_RPC_RESPONSE_MESSAGE = 'multiplayer.rpc.response.message'
|
|
48
|
+
|
|
49
|
+
export const ATTR_MULTIPLAYER_GRPC_REQUEST_MESSAGE = 'multiplayer.rpc.grpc.request.message'
|
|
50
|
+
|
|
51
|
+
export const ATTR_MULTIPLAYER_GRPC_REQUEST_MESSAGE_ENCODING = 'multiplayer.rpc.request.message.encoding'
|
|
52
|
+
|
|
53
|
+
export const ATTR_MULTIPLAYER_GRPC_RESPONSE_MESSAGE = 'multiplayer.rpc.grpc.response.message'
|
|
54
|
+
|
|
55
|
+
export const ATTR_MULTIPLAYER_MESSAGING_MESSAGE_BODY = 'multiplayer.messaging.message.body'
|
|
56
|
+
|
|
57
|
+
export const ATTR_MULTIPLAYER_MESSAGING_MESSAGE_BODY_ENCODING = 'multiplayer.messaging.message.body.encoding'
|
|
58
|
+
|
|
59
|
+
export const ATTR_MULTIPLAYER_SESSION_RECORDER_VERSION = 'multiplayer.session-recorder.version'
|
|
60
|
+
|
|
61
|
+
export const MASK_PLACEHOLDER = '***MASKED***'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './constants.base'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './constants.browser'
|
|
2
|
+
export { SessionRecorderHttpTraceExporterBrowser } from './SessionRecorderHttpTraceExporterBrowser'
|
|
3
|
+
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator'
|
|
4
|
+
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer'
|
|
5
|
+
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler'
|
|
6
|
+
export * as SessionRecorderSdk from './sdk'
|
|
7
|
+
export * from './type'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './constants.node'
|
|
2
|
+
export { SessionRecorderHttpInstrumentationHooksNode } from './SessionRecorderHttpInstrumentationHooksNode'
|
|
3
|
+
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator'
|
|
4
|
+
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer'
|
|
5
|
+
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler'
|
|
6
|
+
export * as SessionRecorderSdk from './sdk'
|
|
7
|
+
export * from './type'
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './constants.node'
|
|
2
|
+
export { SessionRecorderHttpTraceExporterBrowser } from './SessionRecorderHttpTraceExporterBrowser'
|
|
3
|
+
export { SessionRecorderHttpInstrumentationHooksNode } from './SessionRecorderHttpInstrumentationHooksNode'
|
|
4
|
+
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator'
|
|
5
|
+
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer'
|
|
6
|
+
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler'
|
|
7
|
+
export * as SessionRecorderSdk from './sdk'
|
|
8
|
+
export * from './type'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { context, trace, SpanStatusCode } from '@opentelemetry/api'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description Add error to current span
|
|
5
|
+
* @param {Error} error
|
|
6
|
+
* @returns {void}
|
|
7
|
+
*/
|
|
8
|
+
export const captureException = (error: Error) => {
|
|
9
|
+
if (!error) return;
|
|
10
|
+
|
|
11
|
+
const span = trace.getSpan(context.active())
|
|
12
|
+
if (!span) return;
|
|
13
|
+
|
|
14
|
+
span.recordException(error)
|
|
15
|
+
span.setStatus({
|
|
16
|
+
code: SpanStatusCode.ERROR,
|
|
17
|
+
message: error.message,
|
|
18
|
+
})
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const SHARED_CHAR_CODES_ARRAY = Array(32)
|
|
2
|
+
|
|
3
|
+
export const getIdGenerator = (bytes: number) => {
|
|
4
|
+
return function generateId() {
|
|
5
|
+
for (let i = 0; i < bytes * 2; i++) {
|
|
6
|
+
SHARED_CHAR_CODES_ARRAY[i] = Math.floor(Math.random() * 16) + 48
|
|
7
|
+
// valid hex characters in the range 48-57 and 97-102
|
|
8
|
+
if (SHARED_CHAR_CODES_ARRAY[i] >= 58) {
|
|
9
|
+
SHARED_CHAR_CODES_ARRAY[i] += 39
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return String.fromCharCode.apply(
|
|
13
|
+
null,
|
|
14
|
+
SHARED_CHAR_CODES_ARRAY.slice(0, bytes * 2),
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/sdk/index.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'
|
|
2
|
+
export { default as schemify } from './schemify'
|
|
3
|
+
export * from './is-gzip'
|
|
4
|
+
export * from './id-generator'
|
|
5
|
+
export * from './capture-exception'
|
|
6
|
+
export * from './set-attribute'
|
|
7
|
+
export * from './save-continuous-deb-session'
|
package/src/sdk/mask.ts
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { Span } from '@opentelemetry/api'
|
|
2
|
+
import { MASK_PLACEHOLDER } from '../constants.base'
|
|
3
|
+
|
|
4
|
+
const MAX_DEPTH = 8
|
|
5
|
+
export const sensitiveFields: string[] = [
|
|
6
|
+
'password',
|
|
7
|
+
'pass',
|
|
8
|
+
'passwd',
|
|
9
|
+
'pwd',
|
|
10
|
+
'token',
|
|
11
|
+
'access_token',
|
|
12
|
+
'accessToken',
|
|
13
|
+
'refresh_token',
|
|
14
|
+
'refreshToken',
|
|
15
|
+
'secret',
|
|
16
|
+
'api_key',
|
|
17
|
+
'apiKey',
|
|
18
|
+
'authorization',
|
|
19
|
+
'auth_token',
|
|
20
|
+
'authToken',
|
|
21
|
+
'jwt',
|
|
22
|
+
'session_id',
|
|
23
|
+
'sessionId',
|
|
24
|
+
'sessionToken',
|
|
25
|
+
'client_secret',
|
|
26
|
+
'clientSecret',
|
|
27
|
+
'private_key',
|
|
28
|
+
'privateKey',
|
|
29
|
+
'public_key',
|
|
30
|
+
'publicKey',
|
|
31
|
+
'key',
|
|
32
|
+
'encryption_key',
|
|
33
|
+
'encryptionKey',
|
|
34
|
+
'credit_card',
|
|
35
|
+
'creditCard',
|
|
36
|
+
'card_number',
|
|
37
|
+
'cardNumber',
|
|
38
|
+
'cvv',
|
|
39
|
+
'cvc',
|
|
40
|
+
'ssn',
|
|
41
|
+
'sin',
|
|
42
|
+
'pin',
|
|
43
|
+
'security_code',
|
|
44
|
+
'securityCode',
|
|
45
|
+
'bank_account',
|
|
46
|
+
'bankAccount',
|
|
47
|
+
'iban',
|
|
48
|
+
'swift',
|
|
49
|
+
'bic',
|
|
50
|
+
'routing_number',
|
|
51
|
+
'routingNumber',
|
|
52
|
+
'license_key',
|
|
53
|
+
'licenseKey',
|
|
54
|
+
'otp',
|
|
55
|
+
'mfa_code',
|
|
56
|
+
'mfaCode',
|
|
57
|
+
'phone_number',
|
|
58
|
+
'phoneNumber',
|
|
59
|
+
'email',
|
|
60
|
+
'address',
|
|
61
|
+
'dob',
|
|
62
|
+
'tax_id',
|
|
63
|
+
'taxId',
|
|
64
|
+
'passport_number',
|
|
65
|
+
'passportNumber',
|
|
66
|
+
'driver_license',
|
|
67
|
+
'driverLicense',
|
|
68
|
+
|
|
69
|
+
'set-cookie',
|
|
70
|
+
'cookie',
|
|
71
|
+
'authorization',
|
|
72
|
+
'proxyAuthorization',
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
export const sensitiveHeaders: string[] = [
|
|
76
|
+
'set-cookie',
|
|
77
|
+
'cookie',
|
|
78
|
+
'authorization',
|
|
79
|
+
'proxyAuthorization',
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
const maskAll = (value: any, depth = 0) => {
|
|
83
|
+
const type = typeof value
|
|
84
|
+
const isObject = type === 'object'
|
|
85
|
+
let isArray = false
|
|
86
|
+
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
isArray = true
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (depth > MAX_DEPTH && (isObject || isArray)) {
|
|
92
|
+
return undefined
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (isArray) {
|
|
96
|
+
return value.map((val: any) => maskAll(val, depth + 1), value)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (isObject) {
|
|
100
|
+
for (const key in value) {
|
|
101
|
+
value[key] = maskAll(value[key], depth + 1)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return value
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (type === 'string') {
|
|
108
|
+
return MASK_PLACEHOLDER
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return value
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const maskSelected = (value: any, keysToMask: string[]): any => {
|
|
115
|
+
const type = typeof value
|
|
116
|
+
const isObject = type === 'object'
|
|
117
|
+
|
|
118
|
+
const _keysToMask = new Set(keysToMask)
|
|
119
|
+
|
|
120
|
+
if (Array.isArray(value)) {
|
|
121
|
+
return value.map((val: any) => maskSelected(val, keysToMask), value)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (isObject) {
|
|
125
|
+
for (const key in value) {
|
|
126
|
+
if (_keysToMask.has(key)) {
|
|
127
|
+
value[key] = MASK_PLACEHOLDER
|
|
128
|
+
} else {
|
|
129
|
+
value[key] = maskSelected(value[key],keysToMask)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return value
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (type === 'string') {
|
|
137
|
+
return value
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return value
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export default (keysToMask: string[] = []) => (value: any, span: Span): any => {
|
|
144
|
+
let payloadJson
|
|
145
|
+
try {
|
|
146
|
+
payloadJson = JSON.parse(value)
|
|
147
|
+
} catch {
|
|
148
|
+
payloadJson = value
|
|
149
|
+
}
|
|
150
|
+
let maskedData
|
|
151
|
+
if (keysToMask.length) {
|
|
152
|
+
maskedData = maskSelected(payloadJson, keysToMask)
|
|
153
|
+
} else {
|
|
154
|
+
maskedData = maskAll(payloadJson)
|
|
155
|
+
}
|
|
156
|
+
if (typeof maskedData !== 'string') {
|
|
157
|
+
maskedData = JSON.stringify(maskedData)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return maskedData
|
|
161
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { context, trace } from '@opentelemetry/api'
|
|
2
|
+
import {
|
|
3
|
+
ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE,
|
|
4
|
+
ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE_REASON
|
|
5
|
+
} from '../constants.base'
|
|
6
|
+
/**
|
|
7
|
+
* @description Set auto save attribute to span
|
|
8
|
+
* @param {String} reason
|
|
9
|
+
* @returns {void}
|
|
10
|
+
*/
|
|
11
|
+
export const saveContinuousSession = (
|
|
12
|
+
reason?: string
|
|
13
|
+
) => {
|
|
14
|
+
const span = trace.getSpan(context.active())
|
|
15
|
+
|
|
16
|
+
if (!span) {
|
|
17
|
+
return
|
|
18
|
+
// create span
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
span?.setAttribute(ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE, true)
|
|
22
|
+
|
|
23
|
+
if (reason?.length) {
|
|
24
|
+
span?.addEvent(ATTR_MULTIPLAYER_CONTINUOUS_SESSION_AUTO_SAVE_REASON, {
|
|
25
|
+
reason
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as _toJsonSchema from 'to-json-schema'
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
const toJsonSchema = _toJsonSchema?.default || _toJsonSchema
|
|
6
|
+
|
|
7
|
+
const defaultSchemifyOptions: _toJsonSchema.Options = {
|
|
8
|
+
strings: {
|
|
9
|
+
preProcessFnc: (value: string, defaultFnc: any) => {
|
|
10
|
+
if (value?.length >= 30) {
|
|
11
|
+
return defaultFnc('some_string')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
return defaultFnc(value)
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
arrays: {
|
|
19
|
+
mode: 'first',
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default (
|
|
24
|
+
payload: string | object | undefined,
|
|
25
|
+
stringify = true,
|
|
26
|
+
options: _toJsonSchema.Options = defaultSchemifyOptions,
|
|
27
|
+
): any => {
|
|
28
|
+
if (!payload) {
|
|
29
|
+
return ''
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let payloadJson: any
|
|
33
|
+
|
|
34
|
+
if (typeof payload === 'string') {
|
|
35
|
+
try {
|
|
36
|
+
payloadJson = JSON.parse(payload)
|
|
37
|
+
} catch {
|
|
38
|
+
return payload
|
|
39
|
+
}
|
|
40
|
+
} else if (typeof payload === 'object') {
|
|
41
|
+
payloadJson = payload
|
|
42
|
+
} else {
|
|
43
|
+
return payload
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const schema = toJsonSchema(payloadJson, options)
|
|
48
|
+
|
|
49
|
+
if (stringify) {
|
|
50
|
+
return JSON.stringify(schema)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return schema
|
|
54
|
+
} catch (err) {
|
|
55
|
+
// error can happen when array has items like ['test', 'asd', '1'], type for '1' is null
|
|
56
|
+
return ''
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import {
|
|
2
|
+
trace,
|
|
3
|
+
AttributeValue,
|
|
4
|
+
context
|
|
5
|
+
} from '@opentelemetry/api'
|
|
6
|
+
import {
|
|
7
|
+
ATTR_MULTIPLAYER_HTTP_RESPONSE_BODY,
|
|
8
|
+
ATTR_MULTIPLAYER_HTTP_RESPONSE_HEADERS,
|
|
9
|
+
ATTR_MULTIPLAYER_HTTP_REQUEST_BODY,
|
|
10
|
+
ATTR_MULTIPLAYER_HTTP_REQUEST_HEADERS,
|
|
11
|
+
ATTR_MULTIPLAYER_RPC_REQUEST_MESSAGE,
|
|
12
|
+
ATTR_MULTIPLAYER_RPC_RESPONSE_MESSAGE,
|
|
13
|
+
ATTR_MULTIPLAYER_GRPC_REQUEST_MESSAGE,
|
|
14
|
+
ATTR_MULTIPLAYER_GRPC_RESPONSE_MESSAGE,
|
|
15
|
+
ATTR_MULTIPLAYER_MESSAGING_MESSAGE_BODY
|
|
16
|
+
} from '../constants.base'
|
|
17
|
+
import mask, { sensitiveFields, sensitiveHeaders } from './mask'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description Set attribute to current span
|
|
21
|
+
* @param {string} key
|
|
22
|
+
* @param {AttributeValue} value
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
export const setAttribute = (key: string, value: AttributeValue) => {
|
|
26
|
+
const span = trace.getSpan(context.active())
|
|
27
|
+
if (!span) return
|
|
28
|
+
|
|
29
|
+
span.setAttribute(key, value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @description Set request body to current span attributes
|
|
34
|
+
* @param body
|
|
35
|
+
* @param {{ mask: boolean }} options
|
|
36
|
+
* @returns {void}
|
|
37
|
+
*/
|
|
38
|
+
export const setHttpRequestBody = (
|
|
39
|
+
body: any,
|
|
40
|
+
options: { mask: boolean } = { mask: true }
|
|
41
|
+
) => {
|
|
42
|
+
const span = trace.getSpan(context.active())
|
|
43
|
+
if (!span) return
|
|
44
|
+
|
|
45
|
+
if (options?.mask) {
|
|
46
|
+
body = mask(sensitiveFields)(body, span)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
span.setAttribute(ATTR_MULTIPLAYER_HTTP_REQUEST_BODY, body)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @description Set request headers to current span attributes
|
|
54
|
+
* @param body
|
|
55
|
+
* @param {{ mask: boolean }} options
|
|
56
|
+
* @returns {void}
|
|
57
|
+
*/
|
|
58
|
+
export const setHttpRequestHeaders = (
|
|
59
|
+
body: any,
|
|
60
|
+
options: { mask: boolean } = { mask: true }
|
|
61
|
+
) => {
|
|
62
|
+
const span = trace.getSpan(context.active())
|
|
63
|
+
if (!span) return
|
|
64
|
+
|
|
65
|
+
if (options?.mask) {
|
|
66
|
+
body = mask(sensitiveHeaders)(body, span)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
span.setAttribute(ATTR_MULTIPLAYER_HTTP_REQUEST_HEADERS, body)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @description Set response body to current span attributes
|
|
74
|
+
* @param body
|
|
75
|
+
* @param {{ mask: boolean }} options
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
export const setHttpResponseBody = (
|
|
79
|
+
body: any,
|
|
80
|
+
options: { mask: boolean } = { mask: true }
|
|
81
|
+
) => {
|
|
82
|
+
const span = trace.getSpan(context.active())
|
|
83
|
+
if (!span) return
|
|
84
|
+
|
|
85
|
+
if (options?.mask) {
|
|
86
|
+
body = mask(sensitiveFields)(body, span)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
span.setAttribute(ATTR_MULTIPLAYER_HTTP_RESPONSE_BODY, body)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @description Set response body to current span attributes
|
|
94
|
+
* @param body
|
|
95
|
+
* @param {{ mask: boolean }} options
|
|
96
|
+
* @returns {void}
|
|
97
|
+
*/
|
|
98
|
+
export const setHttpResponseHeaders = (
|
|
99
|
+
body: any,
|
|
100
|
+
options: { mask: boolean } = { mask: true }
|
|
101
|
+
) => {
|
|
102
|
+
const span = trace.getSpan(context.active())
|
|
103
|
+
if (!span) return
|
|
104
|
+
|
|
105
|
+
if (options?.mask) {
|
|
106
|
+
body = mask(sensitiveFields)(body, span)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
span.setAttribute(ATTR_MULTIPLAYER_HTTP_RESPONSE_HEADERS, body)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @description Set message body to current span attributes
|
|
114
|
+
* @param body
|
|
115
|
+
* @param {{ mask: boolean }} options
|
|
116
|
+
* @returns {void}
|
|
117
|
+
*/
|
|
118
|
+
export const setMessageBody = (
|
|
119
|
+
body: any,
|
|
120
|
+
options: { mask: boolean } = { mask: true }
|
|
121
|
+
) => {
|
|
122
|
+
const span = trace.getSpan(context.active())
|
|
123
|
+
if (!span) return
|
|
124
|
+
|
|
125
|
+
if (options?.mask) {
|
|
126
|
+
body = mask(sensitiveFields)(body, span)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
span.setAttribute(ATTR_MULTIPLAYER_MESSAGING_MESSAGE_BODY, body)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @description Set rpc request message to current span attributes
|
|
134
|
+
* @param body
|
|
135
|
+
* @param {{ mask: boolean }} options
|
|
136
|
+
* @returns {void}
|
|
137
|
+
*/
|
|
138
|
+
export const setRpcRequestMessage = (
|
|
139
|
+
body: any,
|
|
140
|
+
options: { mask: boolean } = { mask: true }
|
|
141
|
+
) => {
|
|
142
|
+
const span = trace.getSpan(context.active())
|
|
143
|
+
if (!span) return
|
|
144
|
+
|
|
145
|
+
if (options?.mask) {
|
|
146
|
+
body = mask(sensitiveFields)(body, span)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
span.setAttribute(ATTR_MULTIPLAYER_RPC_REQUEST_MESSAGE, body)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @description Set rpc response message to current span attributes
|
|
154
|
+
* @param body
|
|
155
|
+
* @param {{ mask: boolean }} options
|
|
156
|
+
* @returns {void}
|
|
157
|
+
*/
|
|
158
|
+
export const setRpcResponseMessage = (
|
|
159
|
+
body: any,
|
|
160
|
+
options: { mask: boolean } = { mask: true }
|
|
161
|
+
) => {
|
|
162
|
+
const span = trace.getSpan(context.active())
|
|
163
|
+
if (!span) return
|
|
164
|
+
|
|
165
|
+
if (options?.mask) {
|
|
166
|
+
body = mask(sensitiveFields)(body, span)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
span.setAttribute(ATTR_MULTIPLAYER_RPC_RESPONSE_MESSAGE, body)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @description Set grpc request message to current span attributes
|
|
174
|
+
* @param body
|
|
175
|
+
* @param {{ mask: boolean }} options
|
|
176
|
+
* @returns {void}
|
|
177
|
+
*/
|
|
178
|
+
export const setGrpcRequestMessage = (
|
|
179
|
+
body: any,
|
|
180
|
+
options: { mask: boolean } = { mask: true }
|
|
181
|
+
) => {
|
|
182
|
+
const span = trace.getSpan(context.active())
|
|
183
|
+
if (!span) return
|
|
184
|
+
|
|
185
|
+
if (options?.mask) {
|
|
186
|
+
body = mask(sensitiveFields)(body, span)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
span.setAttribute(ATTR_MULTIPLAYER_GRPC_REQUEST_MESSAGE, body)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @description Set grpc response message to current span attributes
|
|
194
|
+
* @param body
|
|
195
|
+
* @param {{ mask: boolean }} options
|
|
196
|
+
* @returns {void}
|
|
197
|
+
*/
|
|
198
|
+
export const setGrpcResponseMessage = (
|
|
199
|
+
body: any,
|
|
200
|
+
options: { mask: boolean } = { mask: true }
|
|
201
|
+
) => {
|
|
202
|
+
const span = trace.getSpan(context.active())
|
|
203
|
+
if (!span) return
|
|
204
|
+
|
|
205
|
+
if (options?.mask) {
|
|
206
|
+
body = mask(sensitiveFields)(body, span)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
span.setAttribute(ATTR_MULTIPLAYER_GRPC_RESPONSE_MESSAGE, body)
|
|
210
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './session-type.enum'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowSyntheticDefaultImports": true,
|
|
4
|
+
"allowUnreachableCode": false,
|
|
5
|
+
"allowUnusedLabels": false,
|
|
6
|
+
"composite": true,
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"incremental": true,
|
|
11
|
+
"inlineSources": true,
|
|
12
|
+
"module": "commonjs",
|
|
13
|
+
"newLine": "LF",
|
|
14
|
+
"noEmitOnError": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"noImplicitOverride": true,
|
|
17
|
+
"noImplicitReturns": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"pretty": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"sourceMap": true,
|
|
22
|
+
"strict": true,
|
|
23
|
+
"strictNullChecks": true,
|
|
24
|
+
"target": "es2017",
|
|
25
|
+
"useUnknownInCatchVariables": false,
|
|
26
|
+
"lib": [
|
|
27
|
+
"es2017",
|
|
28
|
+
"dom",
|
|
29
|
+
"dom.iterable"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"exclude": [
|
|
33
|
+
"node_modules"
|
|
34
|
+
]
|
|
35
|
+
}
|