@codefresh-io/cf-telemetry 3.3.0-alpha-1 → 3.4.0-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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.graphql = void 0;
4
4
  exports.graphql = {
5
- mergeItems: true,
5
+ ignoreResolveSpans: process.env['CF_TELEMETRY_OTEL_GRAPHQL_IGNORE_RESOLVE_SPANS'] === 'true',
6
+ ignoreTrivialResolveSpans: process.env['CF_TELEMETRY_OTEL_GRAPHQL_IGNORE_TRIVIAL_RESOLVE_SPANS'] === 'true',
6
7
  };
7
8
  //# sourceMappingURL=graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/graphql.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAuE;IACzF,UAAU,EAAE,IAAI;CACjB,CAAC"}
1
+ {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/graphql.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAuE;IACzF,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,KAAK,MAAM;IAC5F,yBAAyB,EAAE,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,KAAK,MAAM;CAC5G,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Serialize `db.statement` span attribute, replacing all values with "?".
3
+ *
4
+ * Custom serializer has been implemented for two reasons:
5
+ * 1. Default serializer issue with circular references:
6
+ * https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2281
7
+ *
8
+ * 2. Default serializer is less performant as it iterates over objects twice:
9
+ * initially to replace values with "?" and then to serialize to JSON string.
10
+ *
11
+ * Feel free to get default back once the above issues are resolved.
12
+ */
13
+ export declare const dbStatementSerializer: (cmd: unknown) => string;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dbStatementSerializer = void 0;
4
+ /**
5
+ * Creates a replacer function for JSON.stringify,
6
+ * that replaces all non-object values with "?"
7
+ * and circular references with "[Circular]"
8
+ * @returns a replacer function
9
+ */
10
+ const getCmdReplacer = () => {
11
+ // WeakSet is used for tracking seen objects to avoid memory leaks
12
+ const seen = new WeakSet();
13
+ return (_key, value) => {
14
+ // undefined, boolean, number, bigint, string, symbol, function || null
15
+ if (typeof value !== 'object' || !value)
16
+ return '?';
17
+ // objects (including arrays)
18
+ if (seen.has(value))
19
+ return '[Circular]';
20
+ seen.add(value);
21
+ return value;
22
+ };
23
+ };
24
+ /**
25
+ * Serialize `db.statement` span attribute, replacing all values with "?".
26
+ *
27
+ * Custom serializer has been implemented for two reasons:
28
+ * 1. Default serializer issue with circular references:
29
+ * https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2281
30
+ *
31
+ * 2. Default serializer is less performant as it iterates over objects twice:
32
+ * initially to replace values with "?" and then to serialize to JSON string.
33
+ *
34
+ * Feel free to get default back once the above issues are resolved.
35
+ */
36
+ const dbStatementSerializer = (cmd) => JSON.stringify(cmd, getCmdReplacer());
37
+ exports.dbStatementSerializer = dbStatementSerializer;
38
+ //# sourceMappingURL=db-statement-serializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-statement-serializer.js","sourceRoot":"","sources":["../../../../../src/otel/sdk/instrumentation-configs/helpers/db-statement-serializer.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,MAAM,cAAc,GAAG,GAAa,EAAE;IACpC,kEAAkE;IAClE,MAAM,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACrB,uEAAuE;QACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK;YAAE,OAAO,GAAG,CAAC;QAEpD,6BAA6B;QAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,YAAY,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,qBAAqB,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC;AAAxF,QAAA,qBAAqB,yBAAmE"}
@@ -0,0 +1 @@
1
+ export * from './db-statement-serializer.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./db-statement-serializer.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/otel/sdk/instrumentation-configs/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C"}
@@ -4,9 +4,13 @@ exports.instrumentationConfigs = void 0;
4
4
  const graphql_js_1 = require("./graphql.js");
5
5
  const http_js_1 = require("./http.js");
6
6
  const mongodb_js_1 = require("./mongodb.js");
7
+ const mongoose_js_1 = require("./mongoose.js");
8
+ const pg_js_1 = require("./pg.js");
7
9
  exports.instrumentationConfigs = {
8
- '@opentelemetry/instrumentation-http': http_js_1.http,
9
10
  '@opentelemetry/instrumentation-graphql': graphql_js_1.graphql,
11
+ '@opentelemetry/instrumentation-http': http_js_1.http,
10
12
  '@opentelemetry/instrumentation-mongodb': mongodb_js_1.mongodb,
13
+ '@opentelemetry/instrumentation-mongoose': mongoose_js_1.mongoose,
14
+ '@opentelemetry/instrumentation-pg': pg_js_1.pg,
11
15
  };
12
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/index.ts"],"names":[],"mappings":";;;AACA,6CAAuC;AACvC,uCAAiC;AACjC,6CAAuC;AAE1B,QAAA,sBAAsB,GAA6B;IAC9D,qCAAqC,EAAE,cAAI;IAC3C,wCAAwC,EAAE,oBAAO;IACjD,wCAAwC,EAAE,oBAAO;CAClD,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/index.ts"],"names":[],"mappings":";;;AACA,6CAAuC;AACvC,uCAAiC;AACjC,6CAAuC;AACvC,+CAAyC;AACzC,mCAA6B;AAEhB,QAAA,sBAAsB,GAA6B;IAC9D,wCAAwC,EAAE,oBAAO;IACjD,qCAAqC,EAAE,cAAI;IAC3C,wCAAwC,EAAE,oBAAO;IACjD,yCAAyC,EAAE,sBAAQ;IACnD,mCAAmC,EAAE,UAAE;CACxC,CAAC"}
@@ -1,15 +1,2 @@
1
1
  import type { InstrumentationConfigMap } from '@opentelemetry/auto-instrumentations-node';
2
- /**
3
- * Serialize `db.statement` span attribute, replacing all values with "?".
4
- *
5
- * Custom serializer has been implemented for two reasons:
6
- * 1. Default serializer issue with circular references:
7
- * https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2281
8
- *
9
- * 2. Default serializer is less performant as it iterates over objects twice:
10
- * initially to replace values with "?" and then to serialize to JSON string.
11
- *
12
- * Feel free to get default back once the above issues are resolved.
13
- */
14
- export declare const dbStatementSerializer: (cmd: unknown) => string;
15
2
  export declare const mongodb: InstrumentationConfigMap['@opentelemetry/instrumentation-mongodb'];
@@ -1,41 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mongodb = exports.dbStatementSerializer = void 0;
4
- /**
5
- * Creates a replacer function for JSON.stringify,
6
- * that replaces all non-object values with "?"
7
- * and circular references with "[Circular]"
8
- * @returns a replacer function
9
- */
10
- const getCmdReplacer = () => {
11
- // WeakSet is used for tracking seen objects to avoid memory leaks
12
- const seen = new WeakSet();
13
- return (_key, value) => {
14
- // undefined, boolean, number, bigint, string, symbol, function || null
15
- if (typeof value !== 'object' || !value)
16
- return '?';
17
- // objects (including arrays)
18
- if (seen.has(value))
19
- return '[Circular]';
20
- seen.add(value);
21
- return value;
22
- };
23
- };
24
- /**
25
- * Serialize `db.statement` span attribute, replacing all values with "?".
26
- *
27
- * Custom serializer has been implemented for two reasons:
28
- * 1. Default serializer issue with circular references:
29
- * https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2281
30
- *
31
- * 2. Default serializer is less performant as it iterates over objects twice:
32
- * initially to replace values with "?" and then to serialize to JSON string.
33
- *
34
- * Feel free to get default back once the above issues are resolved.
35
- */
36
- const dbStatementSerializer = (cmd) => JSON.stringify(cmd, getCmdReplacer());
37
- exports.dbStatementSerializer = dbStatementSerializer;
3
+ exports.mongodb = void 0;
4
+ const helpers_1 = require("./helpers");
38
5
  exports.mongodb = {
39
- dbStatementSerializer: exports.dbStatementSerializer,
6
+ requireParentSpan: process.env['CF_TELEMETRY_OTEL_MONGODB_REQUIRE_PARENT_SPAN'] === 'true',
7
+ dbStatementSerializer: helpers_1.dbStatementSerializer,
40
8
  };
41
9
  //# sourceMappingURL=mongodb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongodb.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/mongodb.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACH,MAAM,cAAc,GAAG,GAAa,EAAE;IACpC,kEAAkE;IAClE,MAAM,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACrB,uEAAuE;QACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK;YAAE,OAAO,GAAG,CAAC;QAEpD,6BAA6B;QAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,YAAY,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,qBAAqB,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC;AAAxF,QAAA,qBAAqB,yBAAmE;AAExF,QAAA,OAAO,GAAuE;IACzF,qBAAqB,EAArB,6BAAqB;CACtB,CAAC"}
1
+ {"version":3,"file":"mongodb.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/mongodb.ts"],"names":[],"mappings":";;;AACA,uCAAkD;AAErC,QAAA,OAAO,GAAuE;IACzF,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,KAAK,MAAM;IAC1F,qBAAqB,EAArB,+BAAqB;CACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { InstrumentationConfigMap } from '@opentelemetry/auto-instrumentations-node';
2
+ export declare const mongoose: InstrumentationConfigMap['@opentelemetry/instrumentation-mongoose'];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mongoose = void 0;
4
+ const helpers_1 = require("./helpers");
5
+ exports.mongoose = {
6
+ suppressInternalInstrumentation: process.env['CF_TELEMETRY_OTEL_MONGOOSE_SUPPRESS_INTERNAL_INSTRUMENTATION'] === 'true',
7
+ requireParentSpan: process.env['CF_TELEMETRY_OTEL_MONGOOSE_REQUIRE_PARENT_SPAN'] === 'true',
8
+ dbStatementSerializer: helpers_1.dbStatementSerializer,
9
+ };
10
+ //# sourceMappingURL=mongoose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongoose.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/mongoose.ts"],"names":[],"mappings":";;;AACA,uCAAkD;AAErC,QAAA,QAAQ,GAAwE;IAC3F,+BAA+B,EAAE,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,KAAK,MAAM;IACvH,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,KAAK,MAAM;IAC3F,qBAAqB,EAArB,+BAAqB;CACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { InstrumentationConfigMap } from '@opentelemetry/auto-instrumentations-node';
2
+ export declare const pg: InstrumentationConfigMap['@opentelemetry/instrumentation-pg'];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pg = void 0;
4
+ exports.pg = {
5
+ requireParentSpan: process.env['CF_TELEMETRY_OTEL_PG_REQUIRE_PARENT_SPAN'] === 'true',
6
+ };
7
+ //# sourceMappingURL=pg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pg.js","sourceRoot":"","sources":["../../../../src/otel/sdk/instrumentation-configs/pg.ts"],"names":[],"mappings":";;;AAEa,QAAA,EAAE,GAAkE;IAC/E,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,KAAK,MAAM;CACtF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefresh-io/cf-telemetry",
3
- "version": "3.3.0-alpha-1",
3
+ "version": "3.4.0-alpha.1",
4
4
  "exports": {
5
5
  "./init": {
6
6
  "import": "./dist/init.mjs",