@grafana/faro-transport-otlp-http 2.13.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/faro-transport-otlp-http.iife.js +1 -1
- package/dist/bundle/faro-transport-otlp-http.iife.js.map +1 -1
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/asyncToGenerator.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/defineProperty.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/objectSpread2.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/objectWithoutProperties.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPrimitive.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPropertyKey.js +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/typeof.js +1 -2
- package/dist/cjs/payload/OtelPayload.js +1 -2
- package/dist/cjs/payload/attribute/attributeUtils.js +1 -2
- package/dist/cjs/payload/transform/transform.js +2 -3
- package/dist/cjs/semconv.js +1 -2
- package/dist/cjs/transport.js +5 -6
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/asyncToGenerator.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/defineProperty.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/objectSpread2.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/objectWithoutProperties.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPrimitive.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPropertyKey.js +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/typeof.js +1 -2
- package/dist/esm/payload/OtelPayload.js +1 -2
- package/dist/esm/payload/attribute/attributeUtils.js +1 -2
- package/dist/esm/payload/transform/transform.js +2 -3
- package/dist/esm/semconv.js +1 -2
- package/dist/esm/transport.js +5 -6
- package/dist/types/index.d.ts +1 -1
- package/dist/types/payload/OtelPayload.d.ts +0 -2
- package/dist/types/payload/attribute/attributeUtils.d.ts +1 -3
- package/dist/types/payload/index.d.ts +1 -1
- package/dist/types/payload/transform/index.d.ts +1 -1
- package/dist/types/payload/transform/transform.d.ts +1 -3
- package/dist/types/payload/transform/types.d.ts +1 -3
- package/dist/types/payload/types.d.ts +1 -3
- package/dist/types/semconv.d.ts +1 -3
- package/dist/types/transport.d.ts +1 -3
- package/dist/types/types.d.ts +1 -3
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/asyncToGenerator.js
|
|
3
3
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
4
4
|
try {
|
|
5
5
|
var i = n[a](c), u = i.value;
|
|
@@ -24,5 +24,4 @@ function _asyncToGenerator(n) {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.default = _asyncToGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_toPropertyKey = require("./toPropertyKey.js");
|
|
3
|
-
|
|
3
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
4
4
|
function _defineProperty(e, r, t) {
|
|
5
5
|
return (r = require_toPropertyKey.default(r)) in e ? Object.defineProperty(e, r, {
|
|
6
6
|
value: t,
|
|
@@ -9,5 +9,4 @@ function _defineProperty(e, r, t) {
|
|
|
9
9
|
writable: !0
|
|
10
10
|
}) : e[r] = t, e;
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
exports.default = _defineProperty;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_defineProperty = require("./defineProperty.js");
|
|
3
|
-
|
|
3
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectSpread2.js
|
|
4
4
|
function ownKeys(e, r) {
|
|
5
5
|
var t = Object.keys(e);
|
|
6
6
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -22,5 +22,4 @@ function _objectSpread2(e) {
|
|
|
22
22
|
}
|
|
23
23
|
return e;
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
exports.default = _objectSpread2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.js");
|
|
3
|
-
|
|
3
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutProperties.js
|
|
4
4
|
function _objectWithoutProperties(e, t) {
|
|
5
5
|
if (null == e) return {};
|
|
6
6
|
var o, r, i = require_objectWithoutPropertiesLoose.default(e, t);
|
|
@@ -10,5 +10,4 @@ function _objectWithoutProperties(e, t) {
|
|
|
10
10
|
}
|
|
11
11
|
return i;
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
exports.default = _objectWithoutProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
4
4
|
if (null == r) return {};
|
|
5
5
|
var t = {};
|
|
@@ -9,5 +9,4 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
exports.default = _objectWithoutPropertiesLoose;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_typeof = require("./typeof.js");
|
|
3
|
-
|
|
3
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
4
4
|
function toPrimitive(t, r) {
|
|
5
5
|
if ("object" != require_typeof.default(t) || !t) return t;
|
|
6
6
|
var e = t[Symbol.toPrimitive];
|
|
@@ -11,5 +11,4 @@ function toPrimitive(t, r) {
|
|
|
11
11
|
}
|
|
12
12
|
return ("string" === r ? String : Number)(t);
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
exports.default = toPrimitive;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_typeof = require("./typeof.js");
|
|
3
3
|
const require_toPrimitive = require("./toPrimitive.js");
|
|
4
|
-
|
|
4
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
5
5
|
function toPropertyKey(t) {
|
|
6
6
|
var i = require_toPrimitive.default(t, "string");
|
|
7
7
|
return "symbol" == require_typeof.default(i) ? i : i + "";
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
exports.default = toPropertyKey;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
3
3
|
function _typeof(o) {
|
|
4
4
|
"@babel/helpers - typeof";
|
|
5
5
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -8,7 +8,6 @@ function _typeof(o) {
|
|
|
8
8
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
9
9
|
}, _typeof(o);
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
Object.defineProperty(exports, "default", {
|
|
13
12
|
enumerable: true,
|
|
14
13
|
get: function() {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const require_payload_transform_transform = require("./transform/transform.js");
|
|
4
4
|
require("./transform/index.js");
|
|
5
5
|
let _grafana_faro_core = require("@grafana/faro-core");
|
|
6
|
-
|
|
6
|
+
// src/payload/OtelPayload.ts
|
|
7
7
|
var OtelPayload = class {
|
|
8
8
|
constructor({ internalLogger, customOtlpTransform, transportItem }) {
|
|
9
9
|
this.resourceSpans = [];
|
|
@@ -50,7 +50,6 @@ var OtelPayload = class {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
53
|
exports.OtelPayload = OtelPayload;
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=OtelPayload.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
let _grafana_faro_core = require("@grafana/faro-core");
|
|
4
|
-
|
|
4
|
+
// src/payload/attribute/attributeUtils.ts
|
|
5
5
|
function toAttributeValue(value) {
|
|
6
6
|
if ((0, _grafana_faro_core.isString)(value)) return { stringValue: value };
|
|
7
7
|
if ((0, _grafana_faro_core.isInt)(value)) return { intValue: value };
|
|
@@ -22,7 +22,6 @@ function toAttribute(attributeName, attributeValue) {
|
|
|
22
22
|
function isAttribute(item) {
|
|
23
23
|
return Boolean(item) && typeof (item === null || item === void 0 ? void 0 : item.key) === "string" && typeof (item === null || item === void 0 ? void 0 : item.value) !== "undefined";
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
exports.isAttribute = isAttribute;
|
|
27
26
|
exports.toAttribute = toAttribute;
|
|
28
27
|
exports.toAttributeValue = toAttributeValue;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const require_semconv = require("../../semconv.js");
|
|
4
4
|
const require_payload_attribute_attributeUtils = require("../attribute/attributeUtils.js");
|
|
5
5
|
require("../attribute/index.js");
|
|
6
|
-
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.
|
|
6
|
+
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js");
|
|
7
7
|
let _grafana_faro_core = require("@grafana/faro-core");
|
|
8
8
|
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
9
|
-
|
|
9
|
+
// src/payload/transform/transform.ts
|
|
10
10
|
function getLogTransforms(internalLogger, customOtlpTransform) {
|
|
11
11
|
function toResourceLog(transportItem) {
|
|
12
12
|
return {
|
|
@@ -190,7 +190,6 @@ function toResource(transportItem) {
|
|
|
190
190
|
function getCustomLogBody(transportItem, createCustomLogBody) {
|
|
191
191
|
return typeof createCustomLogBody === "function" ? require_payload_attribute_attributeUtils.toAttributeValue(createCustomLogBody(transportItem)) : void 0;
|
|
192
192
|
}
|
|
193
|
-
//#endregion
|
|
194
193
|
exports.getLogTransforms = getLogTransforms;
|
|
195
194
|
exports.getTraceTransforms = getTraceTransforms;
|
|
196
195
|
|
package/dist/cjs/semconv.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
// src/semconv.ts
|
|
4
4
|
/**
|
|
5
5
|
Unstable SemConv
|
|
6
6
|
Because the "incubating" entry-point may include breaking changes in minor versions,
|
|
@@ -23,7 +23,6 @@ const ATTR_USER_HASH = "user.hash";
|
|
|
23
23
|
const ATTR_USER_ID = "user.id";
|
|
24
24
|
const ATTR_USER_NAME = "user.name";
|
|
25
25
|
const ATTR_USER_ROLES = "user.roles";
|
|
26
|
-
//#endregion
|
|
27
26
|
exports.ATTR_BROWSER_BRANDS = ATTR_BROWSER_BRANDS;
|
|
28
27
|
exports.ATTR_BROWSER_LANGUAGE = ATTR_BROWSER_LANGUAGE;
|
|
29
28
|
exports.ATTR_BROWSER_MOBILE = ATTR_BROWSER_MOBILE;
|
package/dist/cjs/transport.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const require_objectSpread2 = require("./_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/objectSpread2.js");
|
|
4
|
-
const require_payload_OtelPayload = require("./payload/OtelPayload.js");
|
|
5
3
|
require("./payload/index.js");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
const require_payload_OtelPayload = require("./payload/OtelPayload.js");
|
|
5
|
+
const require_asyncToGenerator = require("./_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/asyncToGenerator.js");
|
|
6
|
+
const require_objectWithoutProperties = require("./_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js");
|
|
7
|
+
const require_objectSpread2 = require("./_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js");
|
|
8
8
|
let _grafana_faro_core = require("@grafana/faro-core");
|
|
9
|
-
|
|
9
|
+
// src/transport.ts
|
|
10
10
|
const _excluded = ["headers"];
|
|
11
11
|
const DEFAULT_BUFFER_SIZE = 30;
|
|
12
12
|
const DEFAULT_CONCURRENCY = 5;
|
|
@@ -117,7 +117,6 @@ var OtlpHttpTransport = class extends _grafana_faro_core.BaseTransport {
|
|
|
117
117
|
return new Date(now + this.rateLimitBackoffMs);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
//#endregion
|
|
121
120
|
exports.OtlpHttpTransport = OtlpHttpTransport;
|
|
122
121
|
|
|
123
122
|
//# sourceMappingURL=transport.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/asyncToGenerator.js
|
|
2
2
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
3
3
|
try {
|
|
4
4
|
var i = n[a](c), u = i.value;
|
|
@@ -23,5 +23,4 @@ function _asyncToGenerator(n) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { _asyncToGenerator as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import toPropertyKey from "./toPropertyKey.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
3
3
|
function _defineProperty(e, r, t) {
|
|
4
4
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
5
|
value: t,
|
|
@@ -8,5 +8,4 @@ function _defineProperty(e, r, t) {
|
|
|
8
8
|
writable: !0
|
|
9
9
|
}) : e[r] = t, e;
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { _defineProperty as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "./defineProperty.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectSpread2.js
|
|
3
3
|
function ownKeys(e, r) {
|
|
4
4
|
var t = Object.keys(e);
|
|
5
5
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -21,5 +21,4 @@ function _objectSpread2(e) {
|
|
|
21
21
|
}
|
|
22
22
|
return e;
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { _objectSpread2 as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutProperties.js
|
|
3
3
|
function _objectWithoutProperties(e, t) {
|
|
4
4
|
if (null == e) return {};
|
|
5
5
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
@@ -9,5 +9,4 @@ function _objectWithoutProperties(e, t) {
|
|
|
9
9
|
}
|
|
10
10
|
return i;
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { _objectWithoutProperties as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
2
2
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
3
3
|
if (null == r) return {};
|
|
4
4
|
var t = {};
|
|
@@ -8,5 +8,4 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
8
8
|
}
|
|
9
9
|
return t;
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { _objectWithoutPropertiesLoose as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
3
3
|
function toPrimitive(t, r) {
|
|
4
4
|
if ("object" != _typeof(t) || !t) return t;
|
|
5
5
|
var e = t[Symbol.toPrimitive];
|
|
@@ -10,5 +10,4 @@ function toPrimitive(t, r) {
|
|
|
10
10
|
}
|
|
11
11
|
return ("string" === r ? String : Number)(t);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { toPrimitive as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
2
|
import toPrimitive from "./toPrimitive.js";
|
|
3
|
-
|
|
3
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
4
4
|
function toPropertyKey(t) {
|
|
5
5
|
var i = toPrimitive(t, "string");
|
|
6
6
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { toPropertyKey as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
2
2
|
function _typeof(o) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -7,5 +7,4 @@ function _typeof(o) {
|
|
|
7
7
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
8
|
}, _typeof(o);
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { _typeof as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLogTransforms, getTraceTransforms } from "./transform/transform.js";
|
|
2
2
|
import "./transform/index.js";
|
|
3
3
|
import { TransportItemType } from "@grafana/faro-core";
|
|
4
|
-
|
|
4
|
+
// src/payload/OtelPayload.ts
|
|
5
5
|
var OtelPayload = class {
|
|
6
6
|
constructor({ internalLogger, customOtlpTransform, transportItem }) {
|
|
7
7
|
this.resourceSpans = [];
|
|
@@ -48,7 +48,6 @@ var OtelPayload = class {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { OtelPayload };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=OtelPayload.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isArray, isBoolean, isInt, isNumber, isObject, isString } from "@grafana/faro-core";
|
|
2
|
-
|
|
2
|
+
// src/payload/attribute/attributeUtils.ts
|
|
3
3
|
function toAttributeValue(value) {
|
|
4
4
|
if (isString(value)) return { stringValue: value };
|
|
5
5
|
if (isInt(value)) return { intValue: value };
|
|
@@ -20,7 +20,6 @@ function toAttribute(attributeName, attributeValue) {
|
|
|
20
20
|
function isAttribute(item) {
|
|
21
21
|
return Boolean(item) && typeof (item === null || item === void 0 ? void 0 : item.key) === "string" && typeof (item === null || item === void 0 ? void 0 : item.value) !== "undefined";
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { isAttribute, toAttribute, toAttributeValue };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=attributeUtils.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ATTR_BROWSER_BRANDS, ATTR_BROWSER_LANGUAGE, ATTR_BROWSER_MOBILE, ATTR_BROWSER_PLATFORM, ATTR_DEPLOYMENT_ENVIRONMENT_NAME, ATTR_SERVICE_NAMESPACE, ATTR_SESSION_ID, ATTR_USER_ATTRIBUTES, ATTR_USER_EMAIL, ATTR_USER_FULL_NAME, ATTR_USER_HASH, ATTR_USER_ID, ATTR_USER_NAME, ATTR_USER_ROLES } from "../../semconv.js";
|
|
2
2
|
import { isAttribute, toAttribute, toAttributeValue } from "../attribute/attributeUtils.js";
|
|
3
3
|
import "../attribute/index.js";
|
|
4
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js";
|
|
5
5
|
import { LogLevel, TransportItemType, VERSION } from "@grafana/faro-core";
|
|
6
6
|
import { ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_TYPE, ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION, ATTR_TELEMETRY_SDK_LANGUAGE, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, ATTR_URL_FULL, ATTR_USER_AGENT_ORIGINAL, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS } from "@opentelemetry/semantic-conventions";
|
|
7
|
-
|
|
7
|
+
// src/payload/transform/transform.ts
|
|
8
8
|
function getLogTransforms(internalLogger, customOtlpTransform) {
|
|
9
9
|
function toResourceLog(transportItem) {
|
|
10
10
|
return {
|
|
@@ -188,7 +188,6 @@ function toResource(transportItem) {
|
|
|
188
188
|
function getCustomLogBody(transportItem, createCustomLogBody) {
|
|
189
189
|
return typeof createCustomLogBody === "function" ? toAttributeValue(createCustomLogBody(transportItem)) : void 0;
|
|
190
190
|
}
|
|
191
|
-
//#endregion
|
|
192
191
|
export { getLogTransforms, getTraceTransforms };
|
|
193
192
|
|
|
194
193
|
//# sourceMappingURL=transform.js.map
|
package/dist/esm/semconv.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/semconv.ts
|
|
2
2
|
/**
|
|
3
3
|
Unstable SemConv
|
|
4
4
|
Because the "incubating" entry-point may include breaking changes in minor versions,
|
|
@@ -21,7 +21,6 @@ const ATTR_USER_HASH = "user.hash";
|
|
|
21
21
|
const ATTR_USER_ID = "user.id";
|
|
22
22
|
const ATTR_USER_NAME = "user.name";
|
|
23
23
|
const ATTR_USER_ROLES = "user.roles";
|
|
24
|
-
//#endregion
|
|
25
24
|
export { ATTR_BROWSER_BRANDS, ATTR_BROWSER_LANGUAGE, ATTR_BROWSER_MOBILE, ATTR_BROWSER_PLATFORM, ATTR_DEPLOYMENT_ENVIRONMENT_NAME, ATTR_SERVICE_NAMESPACE, ATTR_SESSION_ID, ATTR_USER_ATTRIBUTES, ATTR_USER_EMAIL, ATTR_USER_FULL_NAME, ATTR_USER_HASH, ATTR_USER_ID, ATTR_USER_NAME, ATTR_USER_ROLES };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=semconv.js.map
|
package/dist/esm/transport.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/objectSpread2.js";
|
|
2
|
-
import { OtelPayload } from "./payload/OtelPayload.js";
|
|
3
1
|
import "./payload/index.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { OtelPayload } from "./payload/OtelPayload.js";
|
|
3
|
+
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/asyncToGenerator.js";
|
|
4
|
+
import _objectWithoutProperties from "./_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectWithoutProperties.js";
|
|
5
|
+
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/objectSpread2.js";
|
|
6
6
|
import { BaseTransport, VERSION, createPromiseBuffer, isArray, noop } from "@grafana/faro-core";
|
|
7
|
-
|
|
7
|
+
// src/transport.ts
|
|
8
8
|
const _excluded = ["headers"];
|
|
9
9
|
const DEFAULT_BUFFER_SIZE = 30;
|
|
10
10
|
const DEFAULT_CONCURRENCY = 5;
|
|
@@ -115,7 +115,6 @@ var OtlpHttpTransport = class extends BaseTransport {
|
|
|
115
115
|
return new Date(now + this.rateLimitBackoffMs);
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
//#endregion
|
|
119
118
|
export { OtlpHttpTransport };
|
|
120
119
|
|
|
121
120
|
//# sourceMappingURL=transport.js.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OtlpHttpTransportOptions, OtlpTransportRequestOptions } from "./types.js";
|
|
2
1
|
import { OtlpHttpTransport } from "./transport.js";
|
|
2
|
+
import { OtlpHttpTransportOptions, OtlpTransportRequestOptions } from "./types.js";
|
|
3
3
|
export { OtlpHttpTransport, type OtlpHttpTransportOptions, type OtlpTransportRequestOptions };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OtlpHttpTransportOptions } from "../types.js";
|
|
2
2
|
import { OtelTransportPayload } from "./types.js";
|
|
3
3
|
import { InternalLogger, TransportItem } from "@grafana/faro-core";
|
|
4
|
-
//#region src/payload/OtelPayload.d.ts
|
|
5
4
|
type OtelPayloadParams = {
|
|
6
5
|
internalLogger: InternalLogger;
|
|
7
6
|
transportItem?: TransportItem;
|
|
@@ -17,5 +16,4 @@ export declare class OtelPayload {
|
|
|
17
16
|
getPayload(): OtelTransportPayload;
|
|
18
17
|
addResourceItem(transportItem: TransportItem): void;
|
|
19
18
|
}
|
|
20
|
-
//#endregion
|
|
21
19
|
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { IAnyValue, IKeyValue } from "@opentelemetry/otlp-transformer/build/src/common/internal-types";
|
|
2
|
-
//#region src/payload/attribute/attributeUtils.d.ts
|
|
3
2
|
export declare function toAttributeValue(value: unknown): IAnyValue;
|
|
4
3
|
export declare function toAttribute(attributeName: string, attributeValue: any): IKeyValue | undefined;
|
|
5
|
-
export declare function isAttribute(item: any): item is IKeyValue;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare function isAttribute(item: any): item is IKeyValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogRecord, LogTransportItem, Resource, ResourceLog, ResourceLogs, Scope, ScopeLog } from "./transform/types.js";
|
|
2
|
+
import { OtelPayload } from "./OtelPayload.js";
|
|
2
3
|
import "./transform/index.js";
|
|
3
4
|
import { Logs, OtelTransportPayload, Traces } from "./types.js";
|
|
4
|
-
import { OtelPayload } from "./OtelPayload.js";
|
|
5
5
|
export { type LogRecord, type LogTransportItem, type Logs, OtelPayload, type OtelTransportPayload, type Resource, type ResourceLog, type ResourceLogs, type Scope, type ScopeLog, type Traces };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LogRecord, LogTransportItem, LogsTransform, Resource, ResourceLog, ResourceLogs, ResourceSpan, ResourceSpans, Scope, ScopeLog, StringValueNonNullable, TraceTransform } from "./types.js";
|
|
2
1
|
import { getLogTransforms, getTraceTransforms } from "./transform.js";
|
|
2
|
+
import { LogRecord, LogTransportItem, LogsTransform, Resource, ResourceLog, ResourceLogs, ResourceSpan, ResourceSpans, Scope, ScopeLog, StringValueNonNullable, TraceTransform } from "./types.js";
|
|
3
3
|
export { type LogRecord, type LogTransportItem, type LogsTransform, type Resource, type ResourceLog, type ResourceLogs, type ResourceSpan, type ResourceSpans, type Scope, type ScopeLog, type StringValueNonNullable, type TraceTransform, getLogTransforms, getTraceTransforms };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { OtlpHttpTransportOptions } from "../../types.js";
|
|
2
2
|
import { LogsTransform, TraceTransform } from "./types.js";
|
|
3
3
|
import { InternalLogger } from "@grafana/faro-core";
|
|
4
|
-
//#region src/payload/transform/transform.d.ts
|
|
5
4
|
export declare function getLogTransforms(internalLogger: InternalLogger, customOtlpTransform?: OtlpHttpTransportOptions["otlpTransform"]): LogsTransform;
|
|
6
|
-
export declare function getTraceTransforms(_internalLogger?: InternalLogger): TraceTransform;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function getTraceTransforms(_internalLogger?: InternalLogger): TraceTransform;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { APIEvent, Meta, TraceEvent, TransportItem } from "@grafana/faro-core";
|
|
2
2
|
import { IKeyValue, Resource as Resource$1 } from "@opentelemetry/otlp-transformer/build/src/common/internal-types";
|
|
3
3
|
import { IResourceSpans } from "@opentelemetry/otlp-transformer/build/src/trace/internal-types";
|
|
4
|
-
//#region src/payload/transform/types.d.ts
|
|
5
4
|
export interface Resource extends Partial<Pick<Resource$1, "droppedAttributesCount">> {
|
|
6
5
|
attributes: IKeyValue[];
|
|
7
6
|
}
|
|
@@ -50,5 +49,4 @@ export type TraceTransform = {
|
|
|
50
49
|
export type ResourceMeta = Pick<Meta, "app" | "browser" | "sdk">;
|
|
51
50
|
export type StringValueNonNullable = {
|
|
52
51
|
stringValue: string;
|
|
53
|
-
};
|
|
54
|
-
//#endregion
|
|
52
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ResourceLogs, ResourceSpans } from "./transform/types.js";
|
|
2
2
|
import "./transform/index.js";
|
|
3
|
-
//#region src/payload/types.d.ts
|
|
4
3
|
export interface OtelTransportPayload {
|
|
5
4
|
readonly resourceLogs: Readonly<ResourceLogs>;
|
|
6
5
|
readonly resourceSpans: Readonly<ResourceSpans>;
|
|
7
6
|
}
|
|
8
7
|
export type Logs = Pick<OtelTransportPayload, "resourceLogs">;
|
|
9
|
-
export type Traces = Pick<OtelTransportPayload, "resourceSpans">;
|
|
10
|
-
//#endregion
|
|
8
|
+
export type Traces = Pick<OtelTransportPayload, "resourceSpans">;
|
package/dist/types/semconv.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/semconv.d.ts
|
|
2
1
|
/**
|
|
3
2
|
Unstable SemConv
|
|
4
3
|
Because the "incubating" entry-point may include breaking changes in minor versions,
|
|
@@ -20,5 +19,4 @@ export declare const ATTR_USER_FULL_NAME = "user.full_name";
|
|
|
20
19
|
export declare const ATTR_USER_HASH = "user.hash";
|
|
21
20
|
export declare const ATTR_USER_ID = "user.id";
|
|
22
21
|
export declare const ATTR_USER_NAME = "user.name";
|
|
23
|
-
export declare const ATTR_USER_ROLES = "user.roles";
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare const ATTR_USER_ROLES = "user.roles";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OtlpHttpTransportOptions } from "./types.js";
|
|
2
2
|
import { BaseTransport, Patterns, TransportItem } from "@grafana/faro-core";
|
|
3
|
-
//#region src/transport.d.ts
|
|
4
3
|
export declare class OtlpHttpTransport extends BaseTransport {
|
|
5
4
|
private options;
|
|
6
5
|
readonly name = "@grafana/faro-web-sdk:transport-otlp-http";
|
|
@@ -15,5 +14,4 @@ export declare class OtlpHttpTransport extends BaseTransport {
|
|
|
15
14
|
send(items: TransportItem[]): Promise<void>;
|
|
16
15
|
private sendPayload;
|
|
17
16
|
private getRetryAfterDate;
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
17
|
+
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExceptionEvent, MeasurementEvent, TransportItem } from "@grafana/faro-core";
|
|
2
|
-
//#region src/types.d.ts
|
|
3
2
|
export interface OtlpTransportRequestOptions extends Omit<RequestInit, "body" | "headers"> {
|
|
4
3
|
/**
|
|
5
4
|
* Headers to include in every request.
|
|
@@ -22,5 +21,4 @@ export interface OtlpHttpTransportOptions {
|
|
|
22
21
|
createErrorLogBody?: (item: TransportItem<ExceptionEvent>) => string;
|
|
23
22
|
createMeasurementLogBody?: (item: TransportItem<MeasurementEvent>) => string;
|
|
24
23
|
};
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/faro-transport-otlp-http",
|
|
3
3
|
"packageManager": "yarn@4.18.1",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.14.0",
|
|
5
5
|
"description": "Faro transport which converts the Faro data model to the Otlp data model.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"observability",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@grafana/faro-core": "^2.
|
|
54
|
+
"@grafana/faro-core": "^2.14.0",
|
|
55
55
|
"@opentelemetry/otlp-transformer": "^0.223.0",
|
|
56
56
|
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "dc5de25e07bf4010e020b228031573b51a0ba3a5"
|
|
59
59
|
}
|