UNPKG

lightstep-tracer

Version:

> ❗ **This instrumentation is no longer recommended**. Please review [documentation on setting up and configuring the OpenTelemetry Node.js Launcher](https://github.com/lightstep/otel-launcher-node) or [OpenTelemetry JS (Browser)](https://github.com/open-

67 lines (49 loc) 3.93 kB
"use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _platform_abstraction_layer = require("../platform_abstraction_layer"); var _each2 = _interopRequireDefault(require("../_each")); var coerce = _interopRequireWildcard(require("./coerce")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var RuntimeImp = /*#__PURE__*/function () { function RuntimeImp(runtimeGUID, startMicros, componentName, attributes) { _classCallCheck(this, RuntimeImp); this._runtimeGUID = runtimeGUID; this._startMicros = startMicros; this._componentName = componentName; this._attributes = attributes; } _createClass(RuntimeImp, [{ key: "toThrift", value: function toThrift() { var thriftAttrs = []; (0, _each2["default"])(this._attributes, function (val, key) { // eslint-disable-next-line camelcase thriftAttrs.push(new _platform_abstraction_layer.crouton_thrift.KeyValue({ Key: coerce.toString(key), Value: coerce.toString(val) })); }); // NOTE: for legacy reasons, the Thrift field is called "group_name" // but is semantically equivalent to the "component_name" // eslint-disable-next-line camelcase return new _platform_abstraction_layer.crouton_thrift.Runtime({ guid: this._runtimeGUID, start_micros: this._startMicros, group_name: this._componentName, attrs: thriftAttrs }); } }]); return RuntimeImp; }(); exports["default"] = RuntimeImp; module.exports = exports.default; //# sourceMappingURL=runtime_imp.js.map