@opentelemetry/resource-detector-instana 0.17.0 → 0.18.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.
@@ -0,0 +1,13 @@
1
+ import { DetectorSync, IResource } from '@opentelemetry/resources';
2
+ declare class InstanaAgentDetector implements DetectorSync {
3
+ readonly INSTANA_AGENT_DEFAULT_HOST = "localhost";
4
+ readonly INSTANA_AGENT_DEFAULT_PORT = 42699;
5
+ detect(): IResource;
6
+ private _getAttributes;
7
+ private timeout;
8
+ private _retryHandler;
9
+ private _fetchAgentData;
10
+ }
11
+ export declare const instanaAgentDetector: InstanaAgentDetector;
12
+ export {};
13
+ //# sourceMappingURL=InstanaAgentDetector.d.ts.map
@@ -0,0 +1,183 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ /*
38
+ * Copyright The OpenTelemetry Authors
39
+ *
40
+ * Licensed under the Apache License, Version 2.0 (the "License");
41
+ * you may not use this file except in compliance with the License.
42
+ * You may obtain a copy of the License at
43
+ *
44
+ * https://www.apache.org/licenses/LICENSE-2.0
45
+ *
46
+ * Unless required by applicable law or agreed to in writing, software
47
+ * distributed under the License is distributed on an "AS IS" BASIS,
48
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
49
+ * See the License for the specific language governing permissions and
50
+ * limitations under the License.
51
+ */
52
+ import { Resource, } from '@opentelemetry/resources';
53
+ import { diag } from '@opentelemetry/api';
54
+ import { SEMRESATTRS_PROCESS_PID, SEMRESATTRS_SERVICE_INSTANCE_ID, } from '@opentelemetry/semantic-conventions';
55
+ import * as http from 'http';
56
+ var InstanaAgentDetector = /** @class */ (function () {
57
+ function InstanaAgentDetector() {
58
+ this.INSTANA_AGENT_DEFAULT_HOST = 'localhost';
59
+ this.INSTANA_AGENT_DEFAULT_PORT = 42699;
60
+ }
61
+ InstanaAgentDetector.prototype.detect = function () {
62
+ return new Resource({}, this._getAttributes());
63
+ };
64
+ InstanaAgentDetector.prototype._getAttributes = function () {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ var host, port, data, _a;
67
+ var _b;
68
+ return __generator(this, function (_c) {
69
+ switch (_c.label) {
70
+ case 0:
71
+ host = process.env.INSTANA_AGENT_HOST || this.INSTANA_AGENT_DEFAULT_HOST;
72
+ port = Number(process.env.INSTANA_AGENT_PORT || this.INSTANA_AGENT_DEFAULT_PORT);
73
+ _c.label = 1;
74
+ case 1:
75
+ _c.trys.push([1, 3, , 4]);
76
+ return [4 /*yield*/, this._retryHandler(host, port, 0)];
77
+ case 2:
78
+ data = _c.sent();
79
+ return [2 /*return*/, (_b = {},
80
+ _b[SEMRESATTRS_PROCESS_PID] = data.pid,
81
+ _b[SEMRESATTRS_SERVICE_INSTANCE_ID] = data.agentUuid,
82
+ _b)];
83
+ case 3:
84
+ _a = _c.sent();
85
+ return [2 /*return*/, {}];
86
+ case 4: return [2 /*return*/];
87
+ }
88
+ });
89
+ });
90
+ };
91
+ InstanaAgentDetector.prototype.timeout = function (ms) {
92
+ return new Promise(function (resolve) { return setTimeout(resolve, ms).unref(); });
93
+ };
94
+ InstanaAgentDetector.prototype._retryHandler = function (host, port, tries) {
95
+ return __awaiter(this, void 0, void 0, function () {
96
+ var MAX_TRIES, err_1, retryTimeout;
97
+ return __generator(this, function (_a) {
98
+ switch (_a.label) {
99
+ case 0:
100
+ MAX_TRIES = 3;
101
+ _a.label = 1;
102
+ case 1:
103
+ _a.trys.push([1, 3, , 7]);
104
+ return [4 /*yield*/, this._fetchAgentData(host, port)];
105
+ case 2: return [2 /*return*/, _a.sent()];
106
+ case 3:
107
+ err_1 = _a.sent();
108
+ if (!(tries < MAX_TRIES)) return [3 /*break*/, 6];
109
+ diag.debug("Retrying to connect to the Instana agent on " + host + ":" + port + "....");
110
+ retryTimeout = process.env.INSTANA_RETRY_TIMEOUT_MS
111
+ ? Number(process.env.INSTANA_RETRY_TIMEOUT_MS)
112
+ : 1000;
113
+ return [4 /*yield*/, this.timeout(retryTimeout)];
114
+ case 4:
115
+ _a.sent();
116
+ return [4 /*yield*/, this._retryHandler(host, port, tries + 1)];
117
+ case 5: return [2 /*return*/, _a.sent()];
118
+ case 6: throw err_1;
119
+ case 7: return [2 /*return*/];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ InstanaAgentDetector.prototype._fetchAgentData = function (host, port) {
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ var agentTimeoutMs, payload, payloadStr, contentLength;
127
+ return __generator(this, function (_a) {
128
+ agentTimeoutMs = process.env.INSTANA_AGENT_TIMEOUT_MS
129
+ ? Number(process.env.INSTANA_AGENT_TIMEOUT_MS)
130
+ : 3 * 1000;
131
+ payload = {
132
+ pid: process.pid,
133
+ };
134
+ payloadStr = JSON.stringify(payload);
135
+ contentLength = Buffer.from(payloadStr, 'utf8').length;
136
+ diag.debug("Instana Agent: " + host + ", " + port);
137
+ return [2 /*return*/, new Promise(function (resolve, reject) {
138
+ var opts = {
139
+ host: host,
140
+ port: port,
141
+ method: 'PUT',
142
+ path: '/com.instana.plugin.nodejs.discovery',
143
+ headers: {
144
+ Accept: 'application/json',
145
+ 'Content-Type': 'application/json; charset=UTF-8',
146
+ 'Content-Length': contentLength,
147
+ },
148
+ timeout: agentTimeoutMs,
149
+ };
150
+ var req = http.request(opts, function (res) {
151
+ res.setEncoding('utf8');
152
+ var rawData = '';
153
+ res.on('data', function (chunk) { return (rawData += chunk); });
154
+ res.on('end', function () {
155
+ if (!res.statusCode || res.statusCode !== 200) {
156
+ return reject(new Error("Instana Agent returned status code " + res.statusCode));
157
+ }
158
+ try {
159
+ var data = JSON.parse(rawData);
160
+ if (data.pid && data.agentUuid) {
161
+ return resolve(data);
162
+ }
163
+ reject(new Error("Invalid Instana Agent response format: " + data + "."));
164
+ }
165
+ catch (e) {
166
+ reject(e);
167
+ }
168
+ });
169
+ });
170
+ req.on('timeout', function () {
171
+ return reject(new Error('Instana Agent request timed out.'));
172
+ });
173
+ req.on('error', function (err) { return reject(err); });
174
+ req.write(Buffer.from(payloadStr), 'utf8');
175
+ req.end();
176
+ })];
177
+ });
178
+ });
179
+ };
180
+ return InstanaAgentDetector;
181
+ }());
182
+ export var instanaAgentDetector = new InstanaAgentDetector();
183
+ //# sourceMappingURL=InstanaAgentDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstanaAgentDetector.js","sourceRoot":"","sources":["../../../src/detectors/InstanaAgentDetector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAEL,QAAQ,GAGT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;IAAA;QACW,+BAA0B,GAAG,WAAW,CAAC;QACzC,+BAA0B,GAAG,KAAK,CAAC;IA0H9C,CAAC;IAxHC,qCAAM,GAAN;QACE,OAAO,IAAI,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IACjD,CAAC;IAEa,6CAAc,GAA5B;;;;;;;wBACQ,IAAI,GACR,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,CAAC,0BAA0B,CAAC;wBAC9D,IAAI,GAAG,MAAM,CACjB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,CAAC,0BAA0B,CAClE,CAAC;;;;wBAGa,qBAAM,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAA;;wBAA9C,IAAI,GAAG,SAAuC;wBAEpD;gCACE,GAAC,uBAAuB,IAAG,IAAI,CA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C9B,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;qCACtB;oCAED,MAAM,CACJ,IAAI,KAAK,CAAC,4CAA0C,IAAI,MAAG,CAAC,CAC7D,CAAC;iCACH;gCAAC,OAAO,CAAC,EAAE;oCACV,MAAM,CAAC,CAAC,CAAC,CAAC;iCACX;4BACH,CAAC,CAAC,CAAC;wBACL,CAAC,CAAC,CAAC;wBAEH,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE;4BAChB,OAAA,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;wBAArD,CAAqD,CACtD,CAAC;wBACF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,UAAA,GAAG,IAAI,OAAA,MAAM,CAAC,GAAG,CAAC,EAAX,CAAW,CAAC,CAAC;wBAEpC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;wBAC3C,GAAG,CAAC,GAAG,EAAE,CAAC;oBACZ,CAAC,CAAC,EAAC;;;KACJ;IACH,2BAAC;AAAD,CAAC,AA5HD,IA4HC;AAED,MAAM,CAAC,IAAM,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n DetectorSync,\n Resource,\n IResource,\n ResourceAttributes,\n} from '@opentelemetry/resources';\nimport { diag } from '@opentelemetry/api';\nimport {\n SEMRESATTRS_PROCESS_PID,\n SEMRESATTRS_SERVICE_INSTANCE_ID,\n} from '@opentelemetry/semantic-conventions';\nimport * as http from 'http';\n\nclass InstanaAgentDetector implements DetectorSync {\n readonly INSTANA_AGENT_DEFAULT_HOST = 'localhost';\n readonly INSTANA_AGENT_DEFAULT_PORT = 42699;\n\n detect(): IResource {\n return new Resource({}, this._getAttributes());\n }\n\n private async _getAttributes(): Promise<ResourceAttributes> {\n const host =\n process.env.INSTANA_AGENT_HOST || this.INSTANA_AGENT_DEFAULT_HOST;\n const port = Number(\n process.env.INSTANA_AGENT_PORT || this.INSTANA_AGENT_DEFAULT_PORT\n );\n\n try {\n const data = await this._retryHandler(host, port, 0);\n\n return {\n [SEMRESATTRS_PROCESS_PID]: data.pid,\n [SEMRESATTRS_SERVICE_INSTANCE_ID]: data.agentUuid,\n };\n } catch {\n return {};\n }\n }\n\n private timeout(ms: number) {\n return new Promise(resolve => setTimeout(resolve, ms).unref());\n }\n\n private async _retryHandler(\n host: string,\n port: number,\n tries: number\n ): Promise<{ pid: number; agentUuid: string }> {\n const MAX_TRIES = 3;\n\n try {\n return await this._fetchAgentData(host, port);\n } catch (err) {\n if (tries < MAX_TRIES) {\n diag.debug(\n `Retrying to connect to the Instana agent on ${host}:${port}....`\n );\n\n const retryTimeout = process.env.INSTANA_RETRY_TIMEOUT_MS\n ? Number(process.env.INSTANA_RETRY_TIMEOUT_MS)\n : 1000;\n\n await this.timeout(retryTimeout);\n return await this._retryHandler(host, port, tries + 1);\n }\n\n throw err;\n }\n }\n\n private async _fetchAgentData(\n host: string,\n port: number\n ): Promise<{ pid: number; agentUuid: string }> {\n const agentTimeoutMs = process.env.INSTANA_AGENT_TIMEOUT_MS\n ? Number(process.env.INSTANA_AGENT_TIMEOUT_MS)\n : 3 * 1000;\n\n const payload = {\n pid: process.pid,\n };\n\n const payloadStr = JSON.stringify(payload);\n const contentLength = Buffer.from(payloadStr, 'utf8').length;\n diag.debug(`Instana Agent: ${host}, ${port}`);\n\n return new Promise((resolve, reject) => {\n const opts = {\n host,\n port,\n method: 'PUT',\n path: '/com.instana.plugin.nodejs.discovery',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json; charset=UTF-8',\n 'Content-Length': contentLength,\n },\n timeout: agentTimeoutMs,\n };\n\n const req = http.request(opts, res => {\n res.setEncoding('utf8');\n let rawData = '';\n\n res.on('data', chunk => (rawData += chunk));\n res.on('end', () => {\n if (!res.statusCode || res.statusCode !== 200) {\n return reject(\n new Error(`Instana Agent returned status code ${res.statusCode}`)\n );\n }\n\n try {\n const data = JSON.parse(rawData);\n if (data.pid && data.agentUuid) {\n return resolve(data);\n }\n\n reject(\n new Error(`Invalid Instana Agent response format: ${data}.`)\n );\n } catch (e) {\n reject(e);\n }\n });\n });\n\n req.on('timeout', () =>\n reject(new Error('Instana Agent request timed out.'))\n );\n req.on('error', err => reject(err));\n\n req.write(Buffer.from(payloadStr), 'utf8');\n req.end();\n });\n }\n}\n\nexport const instanaAgentDetector = new InstanaAgentDetector();\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './InstanaAgentDetector';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export * from './InstanaAgentDetector';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/detectors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './InstanaAgentDetector';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './detectors';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export * from './detectors';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,aAAa,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './detectors';\n"]}
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@opentelemetry/resource-detector-instana",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "OpenTelemetry SDK resource detector for Instana",
5
5
  "main": "build/src/index.js",
6
+ "module": "build/esm/index.js",
6
7
  "types": "build/src/index.d.ts",
7
8
  "repository": "open-telemetry/opentelemetry-js-contrib",
8
9
  "scripts": {
9
- "clean": "rimraf build/*",
10
- "compile": "tsc -p .",
10
+ "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
11
+ "compile": "tsc --build tsconfig.json tsconfig.esm.json",
11
12
  "lint": "eslint . --ext .ts",
12
13
  "lint:fix": "eslint . --ext .ts --fix",
13
14
  "prewatch": "npm run precompile",
14
15
  "prepublishOnly": "npm run compile",
15
16
  "test": "nyc mocha 'test/**/*.test.ts'",
16
17
  "tdd": "npm run test -- --watch-extensions ts --watch",
17
- "watch": "tsc -w"
18
+ "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
18
19
  },
19
20
  "keywords": [
20
21
  "opentelemetry",
@@ -30,7 +31,10 @@
30
31
  "files": [
31
32
  "build/src/**/*.js",
32
33
  "build/src/**/*.js.map",
33
- "build/src/**/*.d.ts"
34
+ "build/src/**/*.d.ts",
35
+ "build/esm/**/*.js",
36
+ "build/esm/**/*.js.map",
37
+ "build/esm/**/*.d.ts"
34
38
  ],
35
39
  "publishConfig": {
36
40
  "access": "public"
@@ -55,5 +59,6 @@
55
59
  "@opentelemetry/api": "^1.3.0"
56
60
  },
57
61
  "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-instana#readme",
58
- "gitHead": "3ef5205e5353010184c69ff7b9f0f4830f0932de"
62
+ "sideEffects": false,
63
+ "gitHead": "bcf1da7964e72c47e127cfc3f615c79da3c5dc30"
59
64
  }