@multiplayer-app/session-recorder-common 2.0.65 → 2.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/esm/exporters/SessionRecorderHttpTraceExporter.d.ts.map +1 -1
  2. package/dist/esm/exporters/SessionRecorderHttpTraceExporter.js +5 -2
  3. package/dist/esm/exporters/SessionRecorderHttpTraceExporter.js.map +1 -1
  4. package/dist/esm/sdk/index.d.ts +1 -0
  5. package/dist/esm/sdk/index.d.ts.map +1 -1
  6. package/dist/esm/sdk/index.js +1 -0
  7. package/dist/esm/sdk/index.js.map +1 -1
  8. package/dist/esm/sdk/is-error-span.d.ts +3 -0
  9. package/dist/esm/sdk/is-error-span.d.ts.map +1 -0
  10. package/dist/esm/sdk/is-error-span.js +8 -0
  11. package/dist/esm/sdk/is-error-span.js.map +1 -0
  12. package/dist/esnext/exporters/SessionRecorderHttpTraceExporter.d.ts.map +1 -1
  13. package/dist/esnext/exporters/SessionRecorderHttpTraceExporter.js +5 -2
  14. package/dist/esnext/exporters/SessionRecorderHttpTraceExporter.js.map +1 -1
  15. package/dist/esnext/sdk/index.d.ts +1 -0
  16. package/dist/esnext/sdk/index.d.ts.map +1 -1
  17. package/dist/esnext/sdk/index.js +1 -0
  18. package/dist/esnext/sdk/index.js.map +1 -1
  19. package/dist/esnext/sdk/is-error-span.d.ts +3 -0
  20. package/dist/esnext/sdk/is-error-span.d.ts.map +1 -0
  21. package/dist/esnext/sdk/is-error-span.js +8 -0
  22. package/dist/esnext/sdk/is-error-span.js.map +1 -0
  23. package/dist/src/exporters/SessionRecorderHttpTraceExporter.d.ts.map +1 -1
  24. package/dist/src/exporters/SessionRecorderHttpTraceExporter.js +4 -1
  25. package/dist/src/exporters/SessionRecorderHttpTraceExporter.js.map +1 -1
  26. package/dist/src/sdk/index.d.ts +1 -0
  27. package/dist/src/sdk/index.d.ts.map +1 -1
  28. package/dist/src/sdk/index.js +1 -0
  29. package/dist/src/sdk/index.js.map +1 -1
  30. package/dist/src/sdk/is-error-span.d.ts +3 -0
  31. package/dist/src/sdk/is-error-span.d.ts.map +1 -0
  32. package/dist/src/sdk/is-error-span.js +12 -0
  33. package/dist/src/sdk/is-error-span.js.map +1 -0
  34. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRecorderHttpTraceExporter.d.ts","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAO3E,MAAM,WAAW,sCAAsC;IACrD,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,iBAAiB;gBACzD,MAAM,EAAE,sCAAsC;IAwBjD,MAAM,CACb,KAAK,EAAE,GAAG,EAAE,EACZ,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACjD,IAAI;CAcR"}
1
+ {"version":3,"file":"SessionRecorderHttpTraceExporter.d.ts","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAS3E,MAAM,WAAW,sCAAsC;IACrD,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,iBAAiB;gBACzD,MAAM,EAAE,sCAAsC;IAwBjD,MAAM,CACb,KAAK,EAAE,GAAG,EAAE,EACZ,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACjD,IAAI;CAgBR"}
@@ -25,7 +25,8 @@ var __assign = (this && this.__assign) || function () {
25
25
  return __assign.apply(this, arguments);
26
26
  };
27
27
  import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
28
- import { MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL, MULTIPLAYER_TRACE_DEBUG_PREFIX, MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX, } from '../constants/constants.base';
28
+ import { MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL, MULTIPLAYER_TRACE_DEBUG_PREFIX, MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX, MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX, } from '../constants/constants.base';
29
+ import { isErrorSpan } from '../sdk';
29
30
  /**
30
31
  * HTTP trace exporter for Session Recorder
31
32
  * Exports traces via HTTP to Multiplayer's OTLP endpoint
@@ -49,7 +50,9 @@ var SessionRecorderHttpTraceExporter = /** @class */ (function (_super) {
49
50
  var filteredSpans = spans.filter(function (span) {
50
51
  var traceId = span.spanContext().traceId;
51
52
  return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||
52
- traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX);
53
+ traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX) ||
54
+ traceId.startsWith(MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX) ||
55
+ isErrorSpan(span);
53
56
  });
54
57
  if (filteredSpans.length === 0) {
55
58
  resultCallback({ code: 0 });
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRecorderHttpTraceExporter.js","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,iDAAiD,EACjD,8BAA8B,EAC9B,yCAAyC,GAC1C,MAAM,6BAA6B,CAAA;AAepC;;;;GAIG;AACH;IAAsD,oDAAiB;IACrE,0CAAY,MAA8C;QAEtD,IAAA,KAKE,MAAM,IAL+C,EAAvD,GAAG,mBAAG,iDAAiD,KAAA,EACvD,MAAM,GAIJ,MAAM,OAJF,EACN,KAGE,MAAM,cAHa,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,KAEE,MAAM,UAFQ,EAAhB,SAAS,mBAAG,IAAI,KAAA,EAChB,KACE,MAAM,iBADa,EAArB,gBAAgB,mBAAG,EAAE,KAAA,CACb;QAEV,OAAA,MAAK,YAAC;YACJ,GAAG,KAAA;YACH,OAAO,aACL,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gDAAgD,IAC3D,MAAM;gBACP,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;gBAC7B,CAAC,CAAC,EAAE,CACP;YACD,aAAa,eAAA;YACb,SAAS,WAAA;YACT,gBAAgB,kBAAA;SACjB,CAAC,SAAA;IACJ,CAAC;IAEQ,iDAAM,GAAf,UACE,KAAY,EACZ,cAAkD;QAElD,IAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,UAAA,IAAI;YACrC,IAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;gBACvD,OAAO,CAAC,UAAU,CAAC,yCAAyC,CAAC,CAAA;QACjE,CAAC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QAED,gBAAK,CAAC,MAAM,YAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,CAAC;IACH,uCAAC;AAAD,CAAC,AA1CD,CAAsD,iBAAiB,GA0CtE","sourcesContent":["import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'\nimport {\n MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n} from '../constants/constants.base'\n\nexport interface SessionRecorderHttpTraceExporterConfig {\n /** The URL to send traces to. Defaults to MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL */\n url?: string\n /** API key for authentication. Required. */\n apiKey: string\n /** Timeout for HTTP requests in milliseconds. Defaults to 30000 */\n timeoutMillis?: number\n /** Whether to keep the connection alive. Defaults to true */\n keepAlive?: boolean\n /** Maximum number of concurrent requests. Defaults to 20 */\n concurrencyLimit?: number\n}\n\n/**\n * HTTP trace exporter for Session Recorder\n * Exports traces via HTTP to Multiplayer's OTLP endpoint\n * Only exports spans with trace IDs starting with Multiplayer prefixes\n */\nexport class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {\n constructor(config: SessionRecorderHttpTraceExporterConfig) {\n const {\n url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n apiKey,\n timeoutMillis = 30000,\n keepAlive = true,\n concurrencyLimit = 20,\n } = config\n\n super({\n url,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': '@multiplayer-app/session-recorder-common/1.0.0',\n ...apiKey\n ? { 'Authorization': apiKey }\n : {},\n },\n timeoutMillis,\n keepAlive,\n concurrencyLimit,\n })\n }\n\n override export(\n spans: any[],\n resultCallback: (result: { code: number }) => void,\n ): void {\n const filteredSpans = spans.filter(span => {\n const traceId = span.spanContext().traceId\n return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX)\n })\n\n if (filteredSpans.length === 0) {\n resultCallback({ code: 0 })\n return\n }\n\n super.export(filteredSpans, resultCallback)\n }\n}\n"]}
1
+ {"version":3,"file":"SessionRecorderHttpTraceExporter.js","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,iDAAiD,EACjD,8BAA8B,EAC9B,yCAAyC,EACzC,sCAAsC,GACvC,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAepC;;;;GAIG;AACH;IAAsD,oDAAiB;IACrE,0CAAY,MAA8C;QAEtD,IAAA,KAKE,MAAM,IAL+C,EAAvD,GAAG,mBAAG,iDAAiD,KAAA,EACvD,MAAM,GAIJ,MAAM,OAJF,EACN,KAGE,MAAM,cAHa,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,KAEE,MAAM,UAFQ,EAAhB,SAAS,mBAAG,IAAI,KAAA,EAChB,KACE,MAAM,iBADa,EAArB,gBAAgB,mBAAG,EAAE,KAAA,CACb;QAEV,OAAA,MAAK,YAAC;YACJ,GAAG,KAAA;YACH,OAAO,aACL,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gDAAgD,IAC3D,MAAM;gBACP,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;gBAC7B,CAAC,CAAC,EAAE,CACP;YACD,aAAa,eAAA;YACb,SAAS,WAAA;YACT,gBAAgB,kBAAA;SACjB,CAAC,SAAA;IACJ,CAAC;IAEQ,iDAAM,GAAf,UACE,KAAY,EACZ,cAAkD;QAElD,IAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,UAAA,IAAI;YACrC,IAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;gBACvD,OAAO,CAAC,UAAU,CAAC,yCAAyC,CAAC;gBAC7D,OAAO,CAAC,UAAU,CAAC,sCAAsC,CAAC;gBAC1D,WAAW,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QAED,gBAAK,CAAC,MAAM,YAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,CAAC;IACH,uCAAC;AAAD,CAAC,AA5CD,CAAsD,iBAAiB,GA4CtE","sourcesContent":["import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'\nimport {\n MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX,\n} from '../constants/constants.base'\nimport { isErrorSpan } from '../sdk'\n\nexport interface SessionRecorderHttpTraceExporterConfig {\n /** The URL to send traces to. Defaults to MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL */\n url?: string\n /** API key for authentication. Required. */\n apiKey: string\n /** Timeout for HTTP requests in milliseconds. Defaults to 30000 */\n timeoutMillis?: number\n /** Whether to keep the connection alive. Defaults to true */\n keepAlive?: boolean\n /** Maximum number of concurrent requests. Defaults to 20 */\n concurrencyLimit?: number\n}\n\n/**\n * HTTP trace exporter for Session Recorder\n * Exports traces via HTTP to Multiplayer's OTLP endpoint\n * Only exports spans with trace IDs starting with Multiplayer prefixes\n */\nexport class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {\n constructor(config: SessionRecorderHttpTraceExporterConfig) {\n const {\n url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n apiKey,\n timeoutMillis = 30000,\n keepAlive = true,\n concurrencyLimit = 20,\n } = config\n\n super({\n url,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': '@multiplayer-app/session-recorder-common/1.0.0',\n ...apiKey\n ? { 'Authorization': apiKey }\n : {},\n },\n timeoutMillis,\n keepAlive,\n concurrencyLimit,\n })\n }\n\n override export(\n spans: any[],\n resultCallback: (result: { code: number }) => void,\n ): void {\n const filteredSpans = spans.filter(span => {\n const traceId = span.spanContext().traceId\n return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX) ||\n isErrorSpan(span)\n })\n\n if (filteredSpans.length === 0) {\n resultCallback({ code: 0 })\n return\n }\n\n super.export(filteredSpans, resultCallback)\n }\n}\n"]}
@@ -6,4 +6,5 @@ export * from './capture-exception';
6
6
  export * from './set-attribute';
7
7
  export * from './save-continuous-deb-session';
8
8
  export * from './set-resource-attributes';
9
+ export * from './is-error-span';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA"}
@@ -6,4 +6,5 @@ export * from './capture-exception';
6
6
  export * from './set-attribute';
7
7
  export * from './save-continuous-deb-session';
8
8
  export * from './set-resource-attributes';
9
+ export * from './is-error-span';
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA","sourcesContent":["export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'\nexport { default as schemify } from './schemify'\nexport * from './is-gzip'\nexport * from './id-generator'\nexport * from './capture-exception'\nexport * from './set-attribute'\nexport * from './save-continuous-deb-session'\nexport * from './set-resource-attributes'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA","sourcesContent":["export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'\nexport { default as schemify } from './schemify'\nexport * from './is-gzip'\nexport * from './id-generator'\nexport * from './capture-exception'\nexport * from './set-attribute'\nexport * from './save-continuous-deb-session'\nexport * from './set-resource-attributes'\nexport * from './is-error-span'\n"]}
@@ -0,0 +1,3 @@
1
+ import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
2
+ export declare const isErrorSpan: (span: ReadableSpan) => boolean;
3
+ //# sourceMappingURL=is-error-span.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-error-span.d.ts","sourceRoot":"","sources":["../../../src/sdk/is-error-span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAO5D,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,KAAG,OAMhD,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { SpanStatusCode } from '@opentelemetry/api';
2
+ import { ATTR_EXCEPTION_TYPE, ATTR_EXCEPTION_MESSAGE, } from '@opentelemetry/semantic-conventions';
3
+ export var isErrorSpan = function (span) {
4
+ return span.status.code === SpanStatusCode.ERROR
5
+ || (!!span.attributes[ATTR_EXCEPTION_TYPE]
6
+ && !!span.attributes[ATTR_EXCEPTION_MESSAGE]);
7
+ };
8
+ //# sourceMappingURL=is-error-span.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-error-span.js","sourceRoot":"","sources":["../../../src/sdk/is-error-span.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qCAAqC,CAAA;AAE5C,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,IAAkB;IAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,KAAK;WAC3C,CACD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;eACjC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAC/C,CAAA;AACL,CAAC,CAAA","sourcesContent":["import { ReadableSpan } from '@opentelemetry/sdk-trace-base'\nimport { SpanStatusCode } from '@opentelemetry/api'\nimport {\n ATTR_EXCEPTION_TYPE,\n ATTR_EXCEPTION_MESSAGE,\n} from '@opentelemetry/semantic-conventions'\n\nexport const isErrorSpan = (span: ReadableSpan): boolean => {\n return span.status.code === SpanStatusCode.ERROR\n || (\n !!span.attributes[ATTR_EXCEPTION_TYPE]\n && !!span.attributes[ATTR_EXCEPTION_MESSAGE]\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRecorderHttpTraceExporter.d.ts","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAO3E,MAAM,WAAW,sCAAsC;IACrD,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,iBAAiB;gBACzD,MAAM,EAAE,sCAAsC;IAwBjD,MAAM,CACb,KAAK,EAAE,GAAG,EAAE,EACZ,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACjD,IAAI;CAcR"}
1
+ {"version":3,"file":"SessionRecorderHttpTraceExporter.d.ts","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAS3E,MAAM,WAAW,sCAAsC;IACrD,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,iBAAiB;gBACzD,MAAM,EAAE,sCAAsC;IAwBjD,MAAM,CACb,KAAK,EAAE,GAAG,EAAE,EACZ,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACjD,IAAI;CAgBR"}
@@ -1,5 +1,6 @@
1
1
  import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
2
- import { MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL, MULTIPLAYER_TRACE_DEBUG_PREFIX, MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX, } from '../constants/constants.base';
2
+ import { MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL, MULTIPLAYER_TRACE_DEBUG_PREFIX, MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX, MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX, } from '../constants/constants.base';
3
+ import { isErrorSpan } from '../sdk';
3
4
  /**
4
5
  * HTTP trace exporter for Session Recorder
5
6
  * Exports traces via HTTP to Multiplayer's OTLP endpoint
@@ -22,7 +23,9 @@ export class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {
22
23
  const filteredSpans = spans.filter(span => {
23
24
  const traceId = span.spanContext().traceId;
24
25
  return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||
25
- traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX);
26
+ traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX) ||
27
+ traceId.startsWith(MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX) ||
28
+ isErrorSpan(span);
26
29
  });
27
30
  if (filteredSpans.length === 0) {
28
31
  resultCallback({ code: 0 });
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRecorderHttpTraceExporter.js","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,iDAAiD,EACjD,8BAA8B,EAC9B,yCAAyC,GAC1C,MAAM,6BAA6B,CAAA;AAepC;;;;GAIG;AACH,MAAM,OAAO,gCAAiC,SAAQ,iBAAiB;IACrE,YAAY,MAA8C;QACxD,MAAM,EACJ,GAAG,GAAG,iDAAiD,EACvD,MAAM,EACN,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,IAAI,EAChB,gBAAgB,GAAG,EAAE,GACtB,GAAG,MAAM,CAAA;QAEV,KAAK,CAAC;YACJ,GAAG;YACH,OAAO,kBACL,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gDAAgD,IAC3D,MAAM;gBACP,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;gBAC7B,CAAC,CAAC,EAAE,CACP;YACD,aAAa;YACb,SAAS;YACT,gBAAgB;SACjB,CAAC,CAAA;IACJ,CAAC;IAEQ,MAAM,CACb,KAAY,EACZ,cAAkD;QAElD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;gBACvD,OAAO,CAAC,UAAU,CAAC,yCAAyC,CAAC,CAAA;QACjE,CAAC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,CAAC;CACF","sourcesContent":["import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'\nimport {\n MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n} from '../constants/constants.base'\n\nexport interface SessionRecorderHttpTraceExporterConfig {\n /** The URL to send traces to. Defaults to MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL */\n url?: string\n /** API key for authentication. Required. */\n apiKey: string\n /** Timeout for HTTP requests in milliseconds. Defaults to 30000 */\n timeoutMillis?: number\n /** Whether to keep the connection alive. Defaults to true */\n keepAlive?: boolean\n /** Maximum number of concurrent requests. Defaults to 20 */\n concurrencyLimit?: number\n}\n\n/**\n * HTTP trace exporter for Session Recorder\n * Exports traces via HTTP to Multiplayer's OTLP endpoint\n * Only exports spans with trace IDs starting with Multiplayer prefixes\n */\nexport class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {\n constructor(config: SessionRecorderHttpTraceExporterConfig) {\n const {\n url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n apiKey,\n timeoutMillis = 30000,\n keepAlive = true,\n concurrencyLimit = 20,\n } = config\n\n super({\n url,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': '@multiplayer-app/session-recorder-common/1.0.0',\n ...apiKey\n ? { 'Authorization': apiKey }\n : {},\n },\n timeoutMillis,\n keepAlive,\n concurrencyLimit,\n })\n }\n\n override export(\n spans: any[],\n resultCallback: (result: { code: number }) => void,\n ): void {\n const filteredSpans = spans.filter(span => {\n const traceId = span.spanContext().traceId\n return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX)\n })\n\n if (filteredSpans.length === 0) {\n resultCallback({ code: 0 })\n return\n }\n\n super.export(filteredSpans, resultCallback)\n }\n}\n"]}
1
+ {"version":3,"file":"SessionRecorderHttpTraceExporter.js","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,iDAAiD,EACjD,8BAA8B,EAC9B,yCAAyC,EACzC,sCAAsC,GACvC,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAepC;;;;GAIG;AACH,MAAM,OAAO,gCAAiC,SAAQ,iBAAiB;IACrE,YAAY,MAA8C;QACxD,MAAM,EACJ,GAAG,GAAG,iDAAiD,EACvD,MAAM,EACN,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,IAAI,EAChB,gBAAgB,GAAG,EAAE,GACtB,GAAG,MAAM,CAAA;QAEV,KAAK,CAAC;YACJ,GAAG;YACH,OAAO,kBACL,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gDAAgD,IAC3D,MAAM;gBACP,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;gBAC7B,CAAC,CAAC,EAAE,CACP;YACD,aAAa;YACb,SAAS;YACT,gBAAgB;SACjB,CAAC,CAAA;IACJ,CAAC;IAEQ,MAAM,CACb,KAAY,EACZ,cAAkD;QAElD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;gBACvD,OAAO,CAAC,UAAU,CAAC,yCAAyC,CAAC;gBAC7D,OAAO,CAAC,UAAU,CAAC,sCAAsC,CAAC;gBAC1D,WAAW,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,CAAC;CACF","sourcesContent":["import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'\nimport {\n MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX,\n} from '../constants/constants.base'\nimport { isErrorSpan } from '../sdk'\n\nexport interface SessionRecorderHttpTraceExporterConfig {\n /** The URL to send traces to. Defaults to MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL */\n url?: string\n /** API key for authentication. Required. */\n apiKey: string\n /** Timeout for HTTP requests in milliseconds. Defaults to 30000 */\n timeoutMillis?: number\n /** Whether to keep the connection alive. Defaults to true */\n keepAlive?: boolean\n /** Maximum number of concurrent requests. Defaults to 20 */\n concurrencyLimit?: number\n}\n\n/**\n * HTTP trace exporter for Session Recorder\n * Exports traces via HTTP to Multiplayer's OTLP endpoint\n * Only exports spans with trace IDs starting with Multiplayer prefixes\n */\nexport class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {\n constructor(config: SessionRecorderHttpTraceExporterConfig) {\n const {\n url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n apiKey,\n timeoutMillis = 30000,\n keepAlive = true,\n concurrencyLimit = 20,\n } = config\n\n super({\n url,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': '@multiplayer-app/session-recorder-common/1.0.0',\n ...apiKey\n ? { 'Authorization': apiKey }\n : {},\n },\n timeoutMillis,\n keepAlive,\n concurrencyLimit,\n })\n }\n\n override export(\n spans: any[],\n resultCallback: (result: { code: number }) => void,\n ): void {\n const filteredSpans = spans.filter(span => {\n const traceId = span.spanContext().traceId\n return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX) ||\n isErrorSpan(span)\n })\n\n if (filteredSpans.length === 0) {\n resultCallback({ code: 0 })\n return\n }\n\n super.export(filteredSpans, resultCallback)\n }\n}\n"]}
@@ -6,4 +6,5 @@ export * from './capture-exception';
6
6
  export * from './set-attribute';
7
7
  export * from './save-continuous-deb-session';
8
8
  export * from './set-resource-attributes';
9
+ export * from './is-error-span';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA"}
@@ -6,4 +6,5 @@ export * from './capture-exception';
6
6
  export * from './set-attribute';
7
7
  export * from './save-continuous-deb-session';
8
8
  export * from './set-resource-attributes';
9
+ export * from './is-error-span';
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA","sourcesContent":["export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'\nexport { default as schemify } from './schemify'\nexport * from './is-gzip'\nexport * from './id-generator'\nexport * from './capture-exception'\nexport * from './set-attribute'\nexport * from './save-continuous-deb-session'\nexport * from './set-resource-attributes'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA","sourcesContent":["export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'\nexport { default as schemify } from './schemify'\nexport * from './is-gzip'\nexport * from './id-generator'\nexport * from './capture-exception'\nexport * from './set-attribute'\nexport * from './save-continuous-deb-session'\nexport * from './set-resource-attributes'\nexport * from './is-error-span'\n"]}
@@ -0,0 +1,3 @@
1
+ import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
2
+ export declare const isErrorSpan: (span: ReadableSpan) => boolean;
3
+ //# sourceMappingURL=is-error-span.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-error-span.d.ts","sourceRoot":"","sources":["../../../src/sdk/is-error-span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAO5D,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,KAAG,OAMhD,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { SpanStatusCode } from '@opentelemetry/api';
2
+ import { ATTR_EXCEPTION_TYPE, ATTR_EXCEPTION_MESSAGE, } from '@opentelemetry/semantic-conventions';
3
+ export const isErrorSpan = (span) => {
4
+ return span.status.code === SpanStatusCode.ERROR
5
+ || (!!span.attributes[ATTR_EXCEPTION_TYPE]
6
+ && !!span.attributes[ATTR_EXCEPTION_MESSAGE]);
7
+ };
8
+ //# sourceMappingURL=is-error-span.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-error-span.js","sourceRoot":"","sources":["../../../src/sdk/is-error-span.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qCAAqC,CAAA;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAkB,EAAW,EAAE;IACzD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,KAAK;WAC3C,CACD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;eACjC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAC/C,CAAA;AACL,CAAC,CAAA","sourcesContent":["import { ReadableSpan } from '@opentelemetry/sdk-trace-base'\nimport { SpanStatusCode } from '@opentelemetry/api'\nimport {\n ATTR_EXCEPTION_TYPE,\n ATTR_EXCEPTION_MESSAGE,\n} from '@opentelemetry/semantic-conventions'\n\nexport const isErrorSpan = (span: ReadableSpan): boolean => {\n return span.status.code === SpanStatusCode.ERROR\n || (\n !!span.attributes[ATTR_EXCEPTION_TYPE]\n && !!span.attributes[ATTR_EXCEPTION_MESSAGE]\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRecorderHttpTraceExporter.d.ts","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAO3E,MAAM,WAAW,sCAAsC;IACrD,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,iBAAiB;gBACzD,MAAM,EAAE,sCAAsC;IAwBjD,MAAM,CACb,KAAK,EAAE,GAAG,EAAE,EACZ,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACjD,IAAI;CAcR"}
1
+ {"version":3,"file":"SessionRecorderHttpTraceExporter.d.ts","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAS3E,MAAM,WAAW,sCAAsC;IACrD,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,iBAAiB;gBACzD,MAAM,EAAE,sCAAsC;IAwBjD,MAAM,CACb,KAAK,EAAE,GAAG,EAAE,EACZ,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACjD,IAAI;CAgBR"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SessionRecorderHttpTraceExporter = void 0;
4
4
  const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-http");
5
5
  const constants_base_1 = require("../constants/constants.base");
6
+ const sdk_1 = require("../sdk");
6
7
  /**
7
8
  * HTTP trace exporter for Session Recorder
8
9
  * Exports traces via HTTP to Multiplayer's OTLP endpoint
@@ -25,7 +26,9 @@ class SessionRecorderHttpTraceExporter extends exporter_trace_otlp_http_1.OTLPTr
25
26
  const filteredSpans = spans.filter(span => {
26
27
  const traceId = span.spanContext().traceId;
27
28
  return traceId.startsWith(constants_base_1.MULTIPLAYER_TRACE_DEBUG_PREFIX) ||
28
- traceId.startsWith(constants_base_1.MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX);
29
+ traceId.startsWith(constants_base_1.MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX) ||
30
+ traceId.startsWith(constants_base_1.MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX) ||
31
+ (0, sdk_1.isErrorSpan)(span);
29
32
  });
30
33
  if (filteredSpans.length === 0) {
31
34
  resultCallback({ code: 0 });
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRecorderHttpTraceExporter.js","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":";;;AAAA,sFAA2E;AAC3E,gEAIoC;AAepC;;;;GAIG;AACH,MAAa,gCAAiC,SAAQ,4CAAiB;IACrE,YAAY,MAA8C;QACxD,MAAM,EACJ,GAAG,GAAG,kEAAiD,EACvD,MAAM,EACN,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,IAAI,EAChB,gBAAgB,GAAG,EAAE,GACtB,GAAG,MAAM,CAAA;QAEV,KAAK,CAAC;YACJ,GAAG;YACH,OAAO,kBACL,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gDAAgD,IAC3D,MAAM;gBACP,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;gBAC7B,CAAC,CAAC,EAAE,CACP;YACD,aAAa;YACb,SAAS;YACT,gBAAgB;SACjB,CAAC,CAAA;IACJ,CAAC;IAEQ,MAAM,CACb,KAAY,EACZ,cAAkD;QAElD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,+CAA8B,CAAC;gBACvD,OAAO,CAAC,UAAU,CAAC,0DAAyC,CAAC,CAAA;QACjE,CAAC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,CAAC;CACF;AA1CD,4EA0CC","sourcesContent":["import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'\nimport {\n MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n} from '../constants/constants.base'\n\nexport interface SessionRecorderHttpTraceExporterConfig {\n /** The URL to send traces to. Defaults to MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL */\n url?: string\n /** API key for authentication. Required. */\n apiKey: string\n /** Timeout for HTTP requests in milliseconds. Defaults to 30000 */\n timeoutMillis?: number\n /** Whether to keep the connection alive. Defaults to true */\n keepAlive?: boolean\n /** Maximum number of concurrent requests. Defaults to 20 */\n concurrencyLimit?: number\n}\n\n/**\n * HTTP trace exporter for Session Recorder\n * Exports traces via HTTP to Multiplayer's OTLP endpoint\n * Only exports spans with trace IDs starting with Multiplayer prefixes\n */\nexport class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {\n constructor(config: SessionRecorderHttpTraceExporterConfig) {\n const {\n url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n apiKey,\n timeoutMillis = 30000,\n keepAlive = true,\n concurrencyLimit = 20,\n } = config\n\n super({\n url,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': '@multiplayer-app/session-recorder-common/1.0.0',\n ...apiKey\n ? { 'Authorization': apiKey }\n : {},\n },\n timeoutMillis,\n keepAlive,\n concurrencyLimit,\n })\n }\n\n override export(\n spans: any[],\n resultCallback: (result: { code: number }) => void,\n ): void {\n const filteredSpans = spans.filter(span => {\n const traceId = span.spanContext().traceId\n return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX)\n })\n\n if (filteredSpans.length === 0) {\n resultCallback({ code: 0 })\n return\n }\n\n super.export(filteredSpans, resultCallback)\n }\n}\n"]}
1
+ {"version":3,"file":"SessionRecorderHttpTraceExporter.js","sourceRoot":"","sources":["../../../src/exporters/SessionRecorderHttpTraceExporter.ts"],"names":[],"mappings":";;;AAAA,sFAA2E;AAC3E,gEAKoC;AACpC,gCAAoC;AAepC;;;;GAIG;AACH,MAAa,gCAAiC,SAAQ,4CAAiB;IACrE,YAAY,MAA8C;QACxD,MAAM,EACJ,GAAG,GAAG,kEAAiD,EACvD,MAAM,EACN,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,IAAI,EAChB,gBAAgB,GAAG,EAAE,GACtB,GAAG,MAAM,CAAA;QAEV,KAAK,CAAC;YACJ,GAAG;YACH,OAAO,kBACL,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gDAAgD,IAC3D,MAAM;gBACP,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;gBAC7B,CAAC,CAAC,EAAE,CACP;YACD,aAAa;YACb,SAAS;YACT,gBAAgB;SACjB,CAAC,CAAA;IACJ,CAAC;IAEQ,MAAM,CACb,KAAY,EACZ,cAAkD;QAElD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAA;YAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,+CAA8B,CAAC;gBACvD,OAAO,CAAC,UAAU,CAAC,0DAAyC,CAAC;gBAC7D,OAAO,CAAC,UAAU,CAAC,uDAAsC,CAAC;gBAC1D,IAAA,iBAAW,EAAC,IAAI,CAAC,CAAA;QACrB,CAAC,CAAC,CAAA;QAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,CAAC;CACF;AA5CD,4EA4CC","sourcesContent":["import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'\nimport {\n MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n MULTIPLAYER_TRACE_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX,\n MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX,\n} from '../constants/constants.base'\nimport { isErrorSpan } from '../sdk'\n\nexport interface SessionRecorderHttpTraceExporterConfig {\n /** The URL to send traces to. Defaults to MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL */\n url?: string\n /** API key for authentication. Required. */\n apiKey: string\n /** Timeout for HTTP requests in milliseconds. Defaults to 30000 */\n timeoutMillis?: number\n /** Whether to keep the connection alive. Defaults to true */\n keepAlive?: boolean\n /** Maximum number of concurrent requests. Defaults to 20 */\n concurrencyLimit?: number\n}\n\n/**\n * HTTP trace exporter for Session Recorder\n * Exports traces via HTTP to Multiplayer's OTLP endpoint\n * Only exports spans with trace IDs starting with Multiplayer prefixes\n */\nexport class SessionRecorderHttpTraceExporter extends OTLPTraceExporter {\n constructor(config: SessionRecorderHttpTraceExporterConfig) {\n const {\n url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,\n apiKey,\n timeoutMillis = 30000,\n keepAlive = true,\n concurrencyLimit = 20,\n } = config\n\n super({\n url,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': '@multiplayer-app/session-recorder-common/1.0.0',\n ...apiKey\n ? { 'Authorization': apiKey }\n : {},\n },\n timeoutMillis,\n keepAlive,\n concurrencyLimit,\n })\n }\n\n override export(\n spans: any[],\n resultCallback: (result: { code: number }) => void,\n ): void {\n const filteredSpans = spans.filter(span => {\n const traceId = span.spanContext().traceId\n return traceId.startsWith(MULTIPLAYER_TRACE_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_CONTINUOUS_DEBUG_PREFIX) ||\n traceId.startsWith(MULTIPLAYER_TRACE_SESSION_CACHE_PREFIX) ||\n isErrorSpan(span)\n })\n\n if (filteredSpans.length === 0) {\n resultCallback({ code: 0 })\n return\n }\n\n super.export(filteredSpans, resultCallback)\n }\n}\n"]}
@@ -6,4 +6,5 @@ export * from './capture-exception';
6
6
  export * from './set-attribute';
7
7
  export * from './save-continuous-deb-session';
8
8
  export * from './set-resource-attributes';
9
+ export * from './is-error-span';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA"}
@@ -27,4 +27,5 @@ __exportStar(require("./capture-exception"), exports);
27
27
  __exportStar(require("./set-attribute"), exports);
28
28
  __exportStar(require("./save-continuous-deb-session"), exports);
29
29
  __exportStar(require("./set-resource-attributes"), exports);
30
+ __exportStar(require("./is-error-span"), exports);
30
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAA2E;AAAlE,4FAAA,OAAO,OAAQ;AAAE,uGAAA,eAAe,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AAC3D,uCAAgD;AAAvC,oGAAA,OAAO,OAAY;AAC5B,4CAAyB;AACzB,iDAA8B;AAC9B,sDAAmC;AACnC,kDAA+B;AAC/B,gEAA6C;AAC7C,4DAAyC","sourcesContent":["export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'\nexport { default as schemify } from './schemify'\nexport * from './is-gzip'\nexport * from './id-generator'\nexport * from './capture-exception'\nexport * from './set-attribute'\nexport * from './save-continuous-deb-session'\nexport * from './set-resource-attributes'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAA2E;AAAlE,4FAAA,OAAO,OAAQ;AAAE,uGAAA,eAAe,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AAC3D,uCAAgD;AAAvC,oGAAA,OAAO,OAAY;AAC5B,4CAAyB;AACzB,iDAA8B;AAC9B,sDAAmC;AACnC,kDAA+B;AAC/B,gEAA6C;AAC7C,4DAAyC;AACzC,kDAA+B","sourcesContent":["export { default as mask, sensitiveFields, sensitiveHeaders } from './mask'\nexport { default as schemify } from './schemify'\nexport * from './is-gzip'\nexport * from './id-generator'\nexport * from './capture-exception'\nexport * from './set-attribute'\nexport * from './save-continuous-deb-session'\nexport * from './set-resource-attributes'\nexport * from './is-error-span'\n"]}
@@ -0,0 +1,3 @@
1
+ import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
2
+ export declare const isErrorSpan: (span: ReadableSpan) => boolean;
3
+ //# sourceMappingURL=is-error-span.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-error-span.d.ts","sourceRoot":"","sources":["../../../src/sdk/is-error-span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAO5D,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,KAAG,OAMhD,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isErrorSpan = void 0;
4
+ const api_1 = require("@opentelemetry/api");
5
+ const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
6
+ const isErrorSpan = (span) => {
7
+ return span.status.code === api_1.SpanStatusCode.ERROR
8
+ || (!!span.attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE]
9
+ && !!span.attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]);
10
+ };
11
+ exports.isErrorSpan = isErrorSpan;
12
+ //# sourceMappingURL=is-error-span.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-error-span.js","sourceRoot":"","sources":["../../../src/sdk/is-error-span.ts"],"names":[],"mappings":";;;AACA,4CAAmD;AACnD,8EAG4C;AAErC,MAAM,WAAW,GAAG,CAAC,IAAkB,EAAW,EAAE;IACzD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,oBAAc,CAAC,KAAK;WAC3C,CACD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,0CAAmB,CAAC;eACjC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,6CAAsB,CAAC,CAC/C,CAAA;AACL,CAAC,CAAA;AANY,QAAA,WAAW,eAMvB","sourcesContent":["import { ReadableSpan } from '@opentelemetry/sdk-trace-base'\nimport { SpanStatusCode } from '@opentelemetry/api'\nimport {\n ATTR_EXCEPTION_TYPE,\n ATTR_EXCEPTION_MESSAGE,\n} from '@opentelemetry/semantic-conventions'\n\nexport const isErrorSpan = (span: ReadableSpan): boolean => {\n return span.status.code === SpanStatusCode.ERROR\n || (\n !!span.attributes[ATTR_EXCEPTION_TYPE]\n && !!span.attributes[ATTR_EXCEPTION_MESSAGE]\n )\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplayer-app/session-recorder-common",
3
- "version": "2.0.65",
3
+ "version": "2.0.67",
4
4
  "description": "Multiplayer Fullstack Session Recorder - opentelemetry",
5
5
  "author": {
6
6
  "name": "Multiplayer Software, Inc.",