@multiplayer-app/session-recorder-common 1.0.1-alpha.0 → 1.0.1-alpha.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/dist/esm/SessionRecorderIdGenerator.d.ts +1 -6
- package/dist/esm/SessionRecorderIdGenerator.d.ts.map +1 -1
- package/dist/esm/SessionRecorderIdGenerator.js +3 -12
- package/dist/esm/SessionRecorderIdGenerator.js.map +1 -1
- package/dist/esm/index-browser.d.ts +0 -1
- package/dist/esm/index-browser.d.ts.map +1 -1
- package/dist/esm/index-browser.js +0 -1
- package/dist/esm/index-browser.js.map +1 -1
- package/dist/esm/index-node.d.ts +0 -1
- package/dist/esm/index-node.d.ts.map +1 -1
- package/dist/esm/index-node.js +0 -1
- package/dist/esm/index-node.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esnext/SessionRecorderIdGenerator.d.ts +1 -6
- package/dist/esnext/SessionRecorderIdGenerator.d.ts.map +1 -1
- package/dist/esnext/SessionRecorderIdGenerator.js +3 -11
- package/dist/esnext/SessionRecorderIdGenerator.js.map +1 -1
- package/dist/esnext/index-browser.d.ts +0 -1
- package/dist/esnext/index-browser.d.ts.map +1 -1
- package/dist/esnext/index-browser.js +0 -1
- package/dist/esnext/index-browser.js.map +1 -1
- package/dist/esnext/index-node.d.ts +0 -1
- package/dist/esnext/index-node.d.ts.map +1 -1
- package/dist/esnext/index-node.js +0 -1
- package/dist/esnext/index-node.js.map +1 -1
- package/dist/esnext/tsconfig.esnext.tsbuildinfo +1 -1
- package/dist/src/SessionRecorderIdGenerator.d.ts +1 -6
- package/dist/src/SessionRecorderIdGenerator.d.ts.map +1 -1
- package/dist/src/SessionRecorderIdGenerator.js +1 -9
- package/dist/src/SessionRecorderIdGenerator.js.map +1 -1
- package/dist/src/index-browser.d.ts +0 -1
- package/dist/src/index-browser.d.ts.map +1 -1
- package/dist/src/index-browser.js +1 -3
- package/dist/src/index-browser.js.map +1 -1
- package/dist/src/index-node.d.ts +0 -1
- package/dist/src/index-node.d.ts.map +1 -1
- package/dist/src/index-node.js +1 -3
- package/dist/src/index-node.js.map +1 -1
- package/package.json +1 -1
- package/src/SessionRecorderIdGenerator.ts +2 -21
- package/src/index-browser.ts +0 -1
- package/src/index-node.ts +0 -1
- package/dist/esm/SessionRecorderJsonTraceSerializer.d.ts +0 -4
- package/dist/esm/SessionRecorderJsonTraceSerializer.d.ts.map +0 -1
- package/dist/esm/SessionRecorderJsonTraceSerializer.js +0 -94
- package/dist/esm/SessionRecorderJsonTraceSerializer.js.map +0 -1
- package/dist/esnext/SessionRecorderJsonTraceSerializer.d.ts +0 -4
- package/dist/esnext/SessionRecorderJsonTraceSerializer.d.ts.map +0 -1
- package/dist/esnext/SessionRecorderJsonTraceSerializer.js +0 -66
- package/dist/esnext/SessionRecorderJsonTraceSerializer.js.map +0 -1
- package/dist/src/SessionRecorderJsonTraceSerializer.d.ts +0 -4
- package/dist/src/SessionRecorderJsonTraceSerializer.d.ts.map +0 -1
- package/dist/src/SessionRecorderJsonTraceSerializer.js +0 -69
- package/dist/src/SessionRecorderJsonTraceSerializer.js.map +0 -1
- package/src/SessionRecorderJsonTraceSerializer.ts +0 -83
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { RandomIdGenerator } from '@opentelemetry/sdk-trace-base';
|
|
2
2
|
import { SessionType } from './type';
|
|
3
|
-
import { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler';
|
|
4
3
|
export declare class SessionRecorderIdGenerator extends RandomIdGenerator {
|
|
5
4
|
sessionShortId: string;
|
|
6
5
|
sessionType: SessionType;
|
|
7
|
-
docSpanSampler: SessionRecorderTraceIdRatioBasedSampler;
|
|
8
6
|
generateLongId: () => string;
|
|
9
|
-
constructor(
|
|
10
|
-
autoDocTracesRatio?: number | undefined;
|
|
11
|
-
});
|
|
7
|
+
constructor();
|
|
12
8
|
setSessionId(sessionShortId: string, sessionType?: SessionType): void;
|
|
13
|
-
_isDocTrace(traceId: string): boolean;
|
|
14
9
|
}
|
|
15
10
|
//# sourceMappingURL=SessionRecorderIdGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecorderIdGenerator.d.ts","sourceRoot":"","sources":["../../src/SessionRecorderIdGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionRecorderIdGenerator.d.ts","sourceRoot":"","sources":["../../src/SessionRecorderIdGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAOpC,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC/D,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IAExB,cAAc,EAAE,MAAM,MAAM,CAAA;;IAiC5B,YAAY,CACV,cAAc,EAAE,MAAM,EACtB,WAAW,GAAE,WAA+B;CAK/C"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { RandomIdGenerator
|
|
1
|
+
import { RandomIdGenerator } from '@opentelemetry/sdk-trace-base';
|
|
2
2
|
import { SessionType } from './type';
|
|
3
|
-
import {
|
|
4
|
-
import { MULTIPLAYER_TRACE_DEBUG_PREFIX, MULTIPLAYER_TRACE_DOC_PREFIX, MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX, } from './constants/constants.base';
|
|
3
|
+
import { MULTIPLAYER_TRACE_DEBUG_PREFIX, MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX, } from './constants/constants.base';
|
|
5
4
|
import { getIdGenerator } from './sdk';
|
|
6
5
|
export class SessionRecorderIdGenerator extends RandomIdGenerator {
|
|
7
|
-
constructor(
|
|
6
|
+
constructor() {
|
|
8
7
|
super();
|
|
9
|
-
this.docSpanSampler = new SessionRecorderTraceIdRatioBasedSampler(autoDocTracesRatio);
|
|
10
8
|
this.generateLongId = getIdGenerator(16);
|
|
11
9
|
this.sessionShortId = '';
|
|
12
10
|
this.sessionType = SessionType.PLAIN;
|
|
@@ -25,9 +23,6 @@ export class SessionRecorderIdGenerator extends RandomIdGenerator {
|
|
|
25
23
|
const sessionTraceId = `${prefix}${traceId.substring(prefix.length, traceId.length)}`;
|
|
26
24
|
return sessionTraceId;
|
|
27
25
|
}
|
|
28
|
-
else if (this._isDocTrace(traceId)) {
|
|
29
|
-
return `${MULTIPLAYER_TRACE_DOC_PREFIX}${traceId.slice(MULTIPLAYER_TRACE_DOC_PREFIX.length, traceId.length)}`;
|
|
30
|
-
}
|
|
31
26
|
return traceId;
|
|
32
27
|
};
|
|
33
28
|
}
|
|
@@ -35,8 +30,5 @@ export class SessionRecorderIdGenerator extends RandomIdGenerator {
|
|
|
35
30
|
this.sessionShortId = sessionShortId;
|
|
36
31
|
this.sessionType = sessionType;
|
|
37
32
|
}
|
|
38
|
-
_isDocTrace(traceId) {
|
|
39
|
-
return this.docSpanSampler.shouldSample(undefined, traceId).decision === SamplingDecision.RECORD_AND_SAMPLED;
|
|
40
|
-
}
|
|
41
33
|
}
|
|
42
34
|
//# sourceMappingURL=SessionRecorderIdGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecorderIdGenerator.js","sourceRoot":"","sources":["../../src/SessionRecorderIdGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionRecorderIdGenerator.js","sourceRoot":"","sources":["../../src/SessionRecorderIdGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EACL,8BAA8B,EAC9B,yCAAyC,GAC1C,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,OAAO,0BAA2B,SAAQ,iBAAiB;IAM/D;QACE,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,EAAE,CAAC,CAAA;QACxC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,KAAK,CAAA;QAEpC,IAAI,CAAC,eAAe,GAAG,GAAG,EAAE;YAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;YAErC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,iBAAiB,GAAW,EAAE,CAAA;gBAClC,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;oBACzB,KAAK,WAAW,CAAC,UAAU;wBACzB,iBAAiB,GAAG,yCAAyC,CAAA;wBAC7D,MAAK;oBACP;wBACE,iBAAiB,GAAG,8BAA8B,CAAA;gBACtD,CAAC;gBAED,MAAM,MAAM,GAAG,GAAG,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;gBAE3D,MAAM,cAAc,GAAG,GAAG,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAA;gBAErF,OAAO,cAAc,CAAA;YACvB,CAAC;YAED,OAAO,OAAO,CAAA;QAChB,CAAC,CAAA;IACH,CAAC;IAED,YAAY,CACV,cAAsB,EACtB,cAA2B,WAAW,CAAC,KAAK;QAE5C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;CACF","sourcesContent":["import { RandomIdGenerator } from '@opentelemetry/sdk-trace-base'\nimport { SessionType } from './type'\nimport {\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n} from './constants/constants.base'\nimport { getIdGenerator } from './sdk'\n\nexport class SessionRecorderIdGenerator extends RandomIdGenerator {\n sessionShortId: string\n sessionType: SessionType\n\n generateLongId: () => string\n\n constructor() {\n super()\n\n this.generateLongId = getIdGenerator(16)\n this.sessionShortId = ''\n this.sessionType = SessionType.PLAIN\n\n this.generateTraceId = () => {\n const traceId = this.generateLongId()\n\n if (this.sessionShortId) {\n let sessionTypePrefix: string = ''\n switch (this.sessionType) {\n case SessionType.CONTINUOUS:\n sessionTypePrefix = MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX\n break\n default:\n sessionTypePrefix = MULTIPLAYER_TRACE_DEBUG_PREFIX\n }\n\n const prefix = `${sessionTypePrefix}${this.sessionShortId}`\n\n const sessionTraceId = `${prefix}${traceId.substring(prefix.length, traceId.length)}`\n\n return sessionTraceId\n }\n\n return traceId\n }\n }\n\n setSessionId(\n sessionShortId: string,\n sessionType: SessionType = SessionType.PLAIN,\n ) {\n this.sessionShortId = sessionShortId\n this.sessionType = sessionType\n }\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from './constants/constants.browser';
|
|
2
2
|
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator';
|
|
3
|
-
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer';
|
|
4
3
|
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler';
|
|
5
4
|
export * as SessionRecorderSdk from './sdk';
|
|
6
5
|
export * from './type';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAA;AACnG,OAAO,KAAK,kBAAkB,MAAM,OAAO,CAAA;AAC3C,cAAc,QAAQ,CAAA;AACtB,cAAc,2BAA2B,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from './constants/constants.browser';
|
|
2
2
|
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator';
|
|
3
|
-
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer';
|
|
4
3
|
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler';
|
|
5
4
|
export * as SessionRecorderSdk from './sdk';
|
|
6
5
|
export * from './type';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.js","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index-browser.js","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAA;AACnG,OAAO,KAAK,kBAAkB,MAAM,OAAO,CAAA;AAC3C,cAAc,QAAQ,CAAA;AACtB,cAAc,2BAA2B,CAAA","sourcesContent":["export * from './constants/constants.browser'\nexport { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator'\nexport { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler'\nexport * as SessionRecorderSdk from './sdk'\nexport * from './type'\nexport * from './exporters/index-browser'\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './constants/constants.node';
|
|
2
2
|
export { SessionRecorderHttpInstrumentationHooksNode } from './instrumentations/SessionRecorderHttpInstrumentationHooksNode';
|
|
3
3
|
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator';
|
|
4
|
-
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer';
|
|
5
4
|
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler';
|
|
6
5
|
export * as SessionRecorderSdk from './sdk';
|
|
7
6
|
export * from './type';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,2CAA2C,EAAE,MAAM,gEAAgE,CAAA;AAC5H,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,2CAA2C,EAAE,MAAM,gEAAgE,CAAA;AAC5H,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAA;AACnG,OAAO,KAAK,kBAAkB,MAAM,OAAO,CAAA;AAC3C,cAAc,QAAQ,CAAA;AACtB,cAAc,wBAAwB,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './constants/constants.node';
|
|
2
2
|
export { SessionRecorderHttpInstrumentationHooksNode } from './instrumentations/SessionRecorderHttpInstrumentationHooksNode';
|
|
3
3
|
export { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator';
|
|
4
|
-
export { SessionRecorderJsonTraceSerializer } from './SessionRecorderJsonTraceSerializer';
|
|
5
4
|
export { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler';
|
|
6
5
|
export * as SessionRecorderSdk from './sdk';
|
|
7
6
|
export * from './type';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node.js","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,2CAA2C,EAAE,MAAM,gEAAgE,CAAA;AAC5H,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index-node.js","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,2CAA2C,EAAE,MAAM,gEAAgE,CAAA;AAC5H,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAA;AACnG,OAAO,KAAK,kBAAkB,MAAM,OAAO,CAAA;AAC3C,cAAc,QAAQ,CAAA;AACtB,cAAc,wBAAwB,CAAA","sourcesContent":["export * from './constants/constants.node'\nexport { SessionRecorderHttpInstrumentationHooksNode } from './instrumentations/SessionRecorderHttpInstrumentationHooksNode'\nexport { SessionRecorderIdGenerator } from './SessionRecorderIdGenerator'\nexport { SessionRecorderTraceIdRatioBasedSampler } from './SessionRecorderTraceIdRatioBasedSampler'\nexport * as SessionRecorderSdk from './sdk'\nexport * from './type'\nexport * from './exporters/index-node'\n"]}
|