@opentelemetry/exporter-zipkin 1.24.1 → 1.25.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.
- package/build/esm/version.d.ts +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/build/esm/zipkin.js +4 -4
- package/build/esm/zipkin.js.map +1 -1
- package/build/esnext/version.d.ts +1 -1
- package/build/esnext/version.js +1 -1
- package/build/esnext/version.js.map +1 -1
- package/build/esnext/zipkin.js +4 -4
- package/build/esnext/zipkin.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/build/src/zipkin.js +3 -3
- package/build/src/zipkin.js.map +1 -1
- package/package.json +14 -13
package/build/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.25.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/esm/version.js
CHANGED
package/build/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.25.1';\n"]}
|
package/build/esm/zipkin.js
CHANGED
|
@@ -17,7 +17,7 @@ import { diag } from '@opentelemetry/api';
|
|
|
17
17
|
import { ExportResultCode, getEnv } from '@opentelemetry/core';
|
|
18
18
|
import { prepareSend } from './platform/index';
|
|
19
19
|
import { toZipkinSpan, defaultStatusCodeTagName, defaultStatusErrorTagName, } from './transform';
|
|
20
|
-
import {
|
|
20
|
+
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
21
21
|
import { prepareGetHeaders } from './utils';
|
|
22
22
|
/**
|
|
23
23
|
* Zipkin Exporter
|
|
@@ -49,7 +49,7 @@ var ZipkinExporter = /** @class */ (function () {
|
|
|
49
49
|
ZipkinExporter.prototype.export = function (spans, resultCallback) {
|
|
50
50
|
var _this = this;
|
|
51
51
|
var serviceName = String(this._serviceName ||
|
|
52
|
-
spans[0].resource.attributes[
|
|
52
|
+
spans[0].resource.attributes[SEMRESATTRS_SERVICE_NAME] ||
|
|
53
53
|
this.DEFAULT_SERVICE_NAME);
|
|
54
54
|
diag.debug('Zipkin exporter export');
|
|
55
55
|
if (this._isShutdown) {
|
|
@@ -110,8 +110,8 @@ var ZipkinExporter = /** @class */ (function () {
|
|
|
110
110
|
ZipkinExporter.prototype._sendSpans = function (spans, serviceName, done) {
|
|
111
111
|
var _this = this;
|
|
112
112
|
var zipkinSpans = spans.map(function (span) {
|
|
113
|
-
return toZipkinSpan(span, String(span.attributes[
|
|
114
|
-
span.resource.attributes[
|
|
113
|
+
return toZipkinSpan(span, String(span.attributes[SEMRESATTRS_SERVICE_NAME] ||
|
|
114
|
+
span.resource.attributes[SEMRESATTRS_SERVICE_NAME] ||
|
|
115
115
|
serviceName), _this._statusCodeTagName, _this._statusDescriptionTagName);
|
|
116
116
|
});
|
|
117
117
|
this._beforeSend();
|
package/build/esm/zipkin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zipkin.js","sourceRoot":"","sources":["../../src/zipkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"zipkin.js","sourceRoot":"","sources":["../../src/zipkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SA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AW,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC;IAED;;OAEG;IACK,mCAAU,GAAlB,UACE,KAAqB,EACrB,WAAmB,EACnB,IAAqC;QAHvC,iBAuBC;QAlBC,IAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI;YAChC,OAAA,YAAY,CACV,IAAI,EACJ,MAAM,CACJ,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;gBACvC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;gBAClD,WAAW,CACd,EACD,KAAI,CAAC,kBAAkB,EACvB,KAAI,CAAC,yBAAyB,CAC/B;QATD,CASC,CACF,CAAC;QACF,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,UAAC,MAAoB;YAClD,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;aACrB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,qBAAC;AAAD,CAAC,AA7HD,IA6HC","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\nimport { diag } from '@opentelemetry/api';\nimport { ExportResult, ExportResultCode, getEnv } from '@opentelemetry/core';\nimport { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { prepareSend } from './platform/index';\nimport * as zipkinTypes from './types';\nimport {\n toZipkinSpan,\n defaultStatusCodeTagName,\n defaultStatusErrorTagName,\n} from './transform';\nimport { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { prepareGetHeaders } from './utils';\n\n/**\n * Zipkin Exporter\n */\nexport class ZipkinExporter implements SpanExporter {\n private readonly DEFAULT_SERVICE_NAME = 'OpenTelemetry Service';\n private readonly _statusCodeTagName: string;\n private readonly _statusDescriptionTagName: string;\n private _urlStr: string;\n private _send: zipkinTypes.SendFunction;\n private _getHeaders: zipkinTypes.GetHeaders | undefined;\n private _serviceName?: string;\n private _isShutdown: boolean;\n private _sendingPromises: Promise<unknown>[] = [];\n\n constructor(config: zipkinTypes.ExporterConfig = {}) {\n this._urlStr = config.url || getEnv().OTEL_EXPORTER_ZIPKIN_ENDPOINT;\n this._send = prepareSend(this._urlStr, config.headers);\n this._serviceName = config.serviceName;\n this._statusCodeTagName =\n config.statusCodeTagName || defaultStatusCodeTagName;\n this._statusDescriptionTagName =\n config.statusDescriptionTagName || defaultStatusErrorTagName;\n this._isShutdown = false;\n if (typeof config.getExportRequestHeaders === 'function') {\n this._getHeaders = prepareGetHeaders(config.getExportRequestHeaders);\n } else {\n // noop\n this._beforeSend = function () {};\n }\n }\n\n /**\n * Export spans.\n */\n export(\n spans: ReadableSpan[],\n resultCallback: (result: ExportResult) => void\n ): void {\n const serviceName = String(\n this._serviceName ||\n spans[0].resource.attributes[SEMRESATTRS_SERVICE_NAME] ||\n this.DEFAULT_SERVICE_NAME\n );\n\n diag.debug('Zipkin exporter export');\n if (this._isShutdown) {\n setTimeout(() =>\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Exporter has been shutdown'),\n })\n );\n return;\n }\n const promise = new Promise<void>(resolve => {\n this._sendSpans(spans, serviceName, result => {\n resolve();\n resultCallback(result);\n });\n });\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n /**\n * Shutdown exporter. Noop operation in this exporter.\n */\n shutdown(): Promise<void> {\n diag.debug('Zipkin exporter shutdown');\n this._isShutdown = true;\n return this.forceFlush();\n }\n\n /**\n * Exports any pending spans in exporter\n */\n forceFlush(): Promise<void> {\n return new Promise((resolve, reject) => {\n Promise.all(this._sendingPromises).then(() => {\n resolve();\n }, reject);\n });\n }\n\n /**\n * if user defines getExportRequestHeaders in config then this will be called\n * every time before send, otherwise it will be replaced with noop in\n * constructor\n * @default noop\n */\n private _beforeSend() {\n if (this._getHeaders) {\n this._send = prepareSend(this._urlStr, this._getHeaders());\n }\n }\n\n /**\n * Transform spans and sends to Zipkin service.\n */\n private _sendSpans(\n spans: ReadableSpan[],\n serviceName: string,\n done?: (result: ExportResult) => void\n ) {\n const zipkinSpans = spans.map(span =>\n toZipkinSpan(\n span,\n String(\n span.attributes[SEMRESATTRS_SERVICE_NAME] ||\n span.resource.attributes[SEMRESATTRS_SERVICE_NAME] ||\n serviceName\n ),\n this._statusCodeTagName,\n this._statusDescriptionTagName\n )\n );\n this._beforeSend();\n return this._send(zipkinSpans, (result: ExportResult) => {\n if (done) {\n return done(result);\n }\n });\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.25.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/esnext/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.25.1';\n"]}
|
package/build/esnext/zipkin.js
CHANGED
|
@@ -17,7 +17,7 @@ import { diag } from '@opentelemetry/api';
|
|
|
17
17
|
import { ExportResultCode, getEnv } from '@opentelemetry/core';
|
|
18
18
|
import { prepareSend } from './platform/index';
|
|
19
19
|
import { toZipkinSpan, defaultStatusCodeTagName, defaultStatusErrorTagName, } from './transform';
|
|
20
|
-
import {
|
|
20
|
+
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
21
21
|
import { prepareGetHeaders } from './utils';
|
|
22
22
|
/**
|
|
23
23
|
* Zipkin Exporter
|
|
@@ -47,7 +47,7 @@ export class ZipkinExporter {
|
|
|
47
47
|
*/
|
|
48
48
|
export(spans, resultCallback) {
|
|
49
49
|
const serviceName = String(this._serviceName ||
|
|
50
|
-
spans[0].resource.attributes[
|
|
50
|
+
spans[0].resource.attributes[SEMRESATTRS_SERVICE_NAME] ||
|
|
51
51
|
this.DEFAULT_SERVICE_NAME);
|
|
52
52
|
diag.debug('Zipkin exporter export');
|
|
53
53
|
if (this._isShutdown) {
|
|
@@ -103,8 +103,8 @@ export class ZipkinExporter {
|
|
|
103
103
|
* Transform spans and sends to Zipkin service.
|
|
104
104
|
*/
|
|
105
105
|
_sendSpans(spans, serviceName, done) {
|
|
106
|
-
const zipkinSpans = spans.map(span => toZipkinSpan(span, String(span.attributes[
|
|
107
|
-
span.resource.attributes[
|
|
106
|
+
const zipkinSpans = spans.map(span => toZipkinSpan(span, String(span.attributes[SEMRESATTRS_SERVICE_NAME] ||
|
|
107
|
+
span.resource.attributes[SEMRESATTRS_SERVICE_NAME] ||
|
|
108
108
|
serviceName), this._statusCodeTagName, this._statusDescriptionTagName));
|
|
109
109
|
this._beforeSend();
|
|
110
110
|
return this._send(zipkinSpans, (result) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zipkin.js","sourceRoot":"","sources":["../../src/zipkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"zipkin.js","sourceRoot":"","sources":["../../src/zipkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,wBAAwB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G,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC;IAED;;OAEG;IACK,UAAU,CAChB,KAAqB,EACrB,WAAmB,EACnB,IAAqC;QAErC,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACnC,YAAY,CACV,IAAI,EACJ,MAAM,CACJ,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;YACvC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YAClD,WAAW,CACd,EACD,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,yBAAyB,CAC/B,CACF,CAAC;QACF,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAoB,EAAE,EAAE;YACtD,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;aACrB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF","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\nimport { diag } from '@opentelemetry/api';\nimport { ExportResult, ExportResultCode, getEnv } from '@opentelemetry/core';\nimport { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { prepareSend } from './platform/index';\nimport * as zipkinTypes from './types';\nimport {\n toZipkinSpan,\n defaultStatusCodeTagName,\n defaultStatusErrorTagName,\n} from './transform';\nimport { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { prepareGetHeaders } from './utils';\n\n/**\n * Zipkin Exporter\n */\nexport class ZipkinExporter implements SpanExporter {\n private readonly DEFAULT_SERVICE_NAME = 'OpenTelemetry Service';\n private readonly _statusCodeTagName: string;\n private readonly _statusDescriptionTagName: string;\n private _urlStr: string;\n private _send: zipkinTypes.SendFunction;\n private _getHeaders: zipkinTypes.GetHeaders | undefined;\n private _serviceName?: string;\n private _isShutdown: boolean;\n private _sendingPromises: Promise<unknown>[] = [];\n\n constructor(config: zipkinTypes.ExporterConfig = {}) {\n this._urlStr = config.url || getEnv().OTEL_EXPORTER_ZIPKIN_ENDPOINT;\n this._send = prepareSend(this._urlStr, config.headers);\n this._serviceName = config.serviceName;\n this._statusCodeTagName =\n config.statusCodeTagName || defaultStatusCodeTagName;\n this._statusDescriptionTagName =\n config.statusDescriptionTagName || defaultStatusErrorTagName;\n this._isShutdown = false;\n if (typeof config.getExportRequestHeaders === 'function') {\n this._getHeaders = prepareGetHeaders(config.getExportRequestHeaders);\n } else {\n // noop\n this._beforeSend = function () {};\n }\n }\n\n /**\n * Export spans.\n */\n export(\n spans: ReadableSpan[],\n resultCallback: (result: ExportResult) => void\n ): void {\n const serviceName = String(\n this._serviceName ||\n spans[0].resource.attributes[SEMRESATTRS_SERVICE_NAME] ||\n this.DEFAULT_SERVICE_NAME\n );\n\n diag.debug('Zipkin exporter export');\n if (this._isShutdown) {\n setTimeout(() =>\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Exporter has been shutdown'),\n })\n );\n return;\n }\n const promise = new Promise<void>(resolve => {\n this._sendSpans(spans, serviceName, result => {\n resolve();\n resultCallback(result);\n });\n });\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n /**\n * Shutdown exporter. Noop operation in this exporter.\n */\n shutdown(): Promise<void> {\n diag.debug('Zipkin exporter shutdown');\n this._isShutdown = true;\n return this.forceFlush();\n }\n\n /**\n * Exports any pending spans in exporter\n */\n forceFlush(): Promise<void> {\n return new Promise((resolve, reject) => {\n Promise.all(this._sendingPromises).then(() => {\n resolve();\n }, reject);\n });\n }\n\n /**\n * if user defines getExportRequestHeaders in config then this will be called\n * every time before send, otherwise it will be replaced with noop in\n * constructor\n * @default noop\n */\n private _beforeSend() {\n if (this._getHeaders) {\n this._send = prepareSend(this._urlStr, this._getHeaders());\n }\n }\n\n /**\n * Transform spans and sends to Zipkin service.\n */\n private _sendSpans(\n spans: ReadableSpan[],\n serviceName: string,\n done?: (result: ExportResult) => void\n ) {\n const zipkinSpans = spans.map(span =>\n toZipkinSpan(\n span,\n String(\n span.attributes[SEMRESATTRS_SERVICE_NAME] ||\n span.resource.attributes[SEMRESATTRS_SERVICE_NAME] ||\n serviceName\n ),\n this._statusCodeTagName,\n this._statusDescriptionTagName\n )\n );\n this._beforeSend();\n return this._send(zipkinSpans, (result: ExportResult) => {\n if (done) {\n return done(result);\n }\n });\n }\n}\n"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.25.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.25.1';\n"]}
|
package/build/src/zipkin.js
CHANGED
|
@@ -50,7 +50,7 @@ class ZipkinExporter {
|
|
|
50
50
|
*/
|
|
51
51
|
export(spans, resultCallback) {
|
|
52
52
|
const serviceName = String(this._serviceName ||
|
|
53
|
-
spans[0].resource.attributes[semantic_conventions_1.
|
|
53
|
+
spans[0].resource.attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] ||
|
|
54
54
|
this.DEFAULT_SERVICE_NAME);
|
|
55
55
|
api_1.diag.debug('Zipkin exporter export');
|
|
56
56
|
if (this._isShutdown) {
|
|
@@ -106,8 +106,8 @@ class ZipkinExporter {
|
|
|
106
106
|
* Transform spans and sends to Zipkin service.
|
|
107
107
|
*/
|
|
108
108
|
_sendSpans(spans, serviceName, done) {
|
|
109
|
-
const zipkinSpans = spans.map(span => (0, transform_1.toZipkinSpan)(span, String(span.attributes[semantic_conventions_1.
|
|
110
|
-
span.resource.attributes[semantic_conventions_1.
|
|
109
|
+
const zipkinSpans = spans.map(span => (0, transform_1.toZipkinSpan)(span, String(span.attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] ||
|
|
110
|
+
span.resource.attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] ||
|
|
111
111
|
serviceName), this._statusCodeTagName, this._statusDescriptionTagName));
|
|
112
112
|
this._beforeSend();
|
|
113
113
|
return this._send(zipkinSpans, (result) => {
|
package/build/src/zipkin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zipkin.js","sourceRoot":"","sources":["../../src/zipkin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAC1C,8CAA6E;AAE7E,4CAA+C;AAE/C,2CAIqB;AACrB,
|
|
1
|
+
{"version":3,"file":"zipkin.js","sourceRoot":"","sources":["../../src/zipkin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAC1C,8CAA6E;AAE7E,4CAA+C;AAE/C,2CAIqB;AACrB,8EAA+E;AAC/E,mCAA4C;AAE5C;;GAEG;AACH,MAAa,cAAc;IAWzB,YAAY,SAAqC,EAAE;QAVlC,yBAAoB,GAAG,uBAAuB,CAAC;QAQxD,qBAAgB,GAAuB,EAAE,CAAC;QAGhD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,IAAI,IAAA,aAAM,GAAE,CAAC,6BAA6B,CAAC;QACpE,IAAI,CAAC,KAAK,GAAG,IAAA,mBAAW,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,kBAAkB;YACrB,MAAM,CAAC,iBAAiB,IAAI,oCAAwB,CAAC;QACvD,IAAI,CAAC,yBAAyB;YAC5B,MAAM,CAAC,wBAAwB,IAAI,qCAAyB,CAAC;QAC/D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IA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AAC,CAAC,CAAC;IACL,CAAC;CACF;AA7HD,wCA6HC","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\nimport { diag } from '@opentelemetry/api';\nimport { ExportResult, ExportResultCode, getEnv } from '@opentelemetry/core';\nimport { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { prepareSend } from './platform/index';\nimport * as zipkinTypes from './types';\nimport {\n toZipkinSpan,\n defaultStatusCodeTagName,\n defaultStatusErrorTagName,\n} from './transform';\nimport { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport { prepareGetHeaders } from './utils';\n\n/**\n * Zipkin Exporter\n */\nexport class ZipkinExporter implements SpanExporter {\n private readonly DEFAULT_SERVICE_NAME = 'OpenTelemetry Service';\n private readonly _statusCodeTagName: string;\n private readonly _statusDescriptionTagName: string;\n private _urlStr: string;\n private _send: zipkinTypes.SendFunction;\n private _getHeaders: zipkinTypes.GetHeaders | undefined;\n private _serviceName?: string;\n private _isShutdown: boolean;\n private _sendingPromises: Promise<unknown>[] = [];\n\n constructor(config: zipkinTypes.ExporterConfig = {}) {\n this._urlStr = config.url || getEnv().OTEL_EXPORTER_ZIPKIN_ENDPOINT;\n this._send = prepareSend(this._urlStr, config.headers);\n this._serviceName = config.serviceName;\n this._statusCodeTagName =\n config.statusCodeTagName || defaultStatusCodeTagName;\n this._statusDescriptionTagName =\n config.statusDescriptionTagName || defaultStatusErrorTagName;\n this._isShutdown = false;\n if (typeof config.getExportRequestHeaders === 'function') {\n this._getHeaders = prepareGetHeaders(config.getExportRequestHeaders);\n } else {\n // noop\n this._beforeSend = function () {};\n }\n }\n\n /**\n * Export spans.\n */\n export(\n spans: ReadableSpan[],\n resultCallback: (result: ExportResult) => void\n ): void {\n const serviceName = String(\n this._serviceName ||\n spans[0].resource.attributes[SEMRESATTRS_SERVICE_NAME] ||\n this.DEFAULT_SERVICE_NAME\n );\n\n diag.debug('Zipkin exporter export');\n if (this._isShutdown) {\n setTimeout(() =>\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Exporter has been shutdown'),\n })\n );\n return;\n }\n const promise = new Promise<void>(resolve => {\n this._sendSpans(spans, serviceName, result => {\n resolve();\n resultCallback(result);\n });\n });\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n /**\n * Shutdown exporter. Noop operation in this exporter.\n */\n shutdown(): Promise<void> {\n diag.debug('Zipkin exporter shutdown');\n this._isShutdown = true;\n return this.forceFlush();\n }\n\n /**\n * Exports any pending spans in exporter\n */\n forceFlush(): Promise<void> {\n return new Promise((resolve, reject) => {\n Promise.all(this._sendingPromises).then(() => {\n resolve();\n }, reject);\n });\n }\n\n /**\n * if user defines getExportRequestHeaders in config then this will be called\n * every time before send, otherwise it will be replaced with noop in\n * constructor\n * @default noop\n */\n private _beforeSend() {\n if (this._getHeaders) {\n this._send = prepareSend(this._urlStr, this._getHeaders());\n }\n }\n\n /**\n * Transform spans and sends to Zipkin service.\n */\n private _sendSpans(\n spans: ReadableSpan[],\n serviceName: string,\n done?: (result: ExportResult) => void\n ) {\n const zipkinSpans = spans.map(span =>\n toZipkinSpan(\n span,\n String(\n span.attributes[SEMRESATTRS_SERVICE_NAME] ||\n span.resource.attributes[SEMRESATTRS_SERVICE_NAME] ||\n serviceName\n ),\n this._statusCodeTagName,\n this._statusDescriptionTagName\n )\n );\n this._beforeSend();\n return this._send(zipkinSpans, (result: ExportResult) => {\n if (done) {\n return done(result);\n }\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/exporter-zipkin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.1",
|
|
4
4
|
"description": "OpenTelemetry Zipkin Exporter allows the user to send collected traces to Zipkin.",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
29
29
|
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
|
|
30
30
|
"prewatch": "npm run precompile",
|
|
31
|
-
"peer-api-check": "node ../../scripts/peer-api-check.js"
|
|
31
|
+
"peer-api-check": "node ../../scripts/peer-api-check.js",
|
|
32
|
+
"align-api-deps": "node ../../scripts/align-api-deps.js"
|
|
32
33
|
},
|
|
33
34
|
"keywords": [
|
|
34
35
|
"opentelemetry",
|
|
@@ -60,29 +61,29 @@
|
|
|
60
61
|
"access": "public"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
|
-
"@babel/core": "7.
|
|
64
|
-
"@babel/preset-env": "7.
|
|
64
|
+
"@babel/core": "7.24.7",
|
|
65
|
+
"@babel/preset-env": "7.24.7",
|
|
65
66
|
"@opentelemetry/api": "^1.0.0",
|
|
66
67
|
"@types/mocha": "10.0.6",
|
|
67
68
|
"@types/node": "18.6.5",
|
|
68
|
-
"@types/sinon": "
|
|
69
|
+
"@types/sinon": "17.0.3",
|
|
69
70
|
"@types/webpack-env": "1.16.3",
|
|
70
71
|
"babel-loader": "8.3.0",
|
|
71
72
|
"babel-plugin-istanbul": "6.1.1",
|
|
72
73
|
"codecov": "3.8.3",
|
|
73
74
|
"cross-var": "1.1.0",
|
|
74
|
-
"karma": "6.4.
|
|
75
|
+
"karma": "6.4.3",
|
|
75
76
|
"karma-chrome-launcher": "3.1.0",
|
|
76
77
|
"karma-coverage": "2.2.1",
|
|
77
78
|
"karma-mocha": "2.0.1",
|
|
78
79
|
"karma-spec-reporter": "0.0.36",
|
|
79
|
-
"karma-webpack": "
|
|
80
|
+
"karma-webpack": "5.0.1",
|
|
80
81
|
"lerna": "6.6.2",
|
|
81
82
|
"mocha": "10.2.0",
|
|
82
83
|
"nock": "13.3.8",
|
|
83
84
|
"nyc": "15.1.0",
|
|
84
85
|
"sinon": "15.1.2",
|
|
85
|
-
"ts-loader": "
|
|
86
|
+
"ts-loader": "9.5.1",
|
|
86
87
|
"ts-mocha": "10.0.0",
|
|
87
88
|
"typescript": "4.4.4",
|
|
88
89
|
"webpack": "5.89.0",
|
|
@@ -93,12 +94,12 @@
|
|
|
93
94
|
"@opentelemetry/api": "^1.0.0"
|
|
94
95
|
},
|
|
95
96
|
"dependencies": {
|
|
96
|
-
"@opentelemetry/core": "1.
|
|
97
|
-
"@opentelemetry/resources": "1.
|
|
98
|
-
"@opentelemetry/sdk-trace-base": "1.
|
|
99
|
-
"@opentelemetry/semantic-conventions": "1.
|
|
97
|
+
"@opentelemetry/core": "1.25.1",
|
|
98
|
+
"@opentelemetry/resources": "1.25.1",
|
|
99
|
+
"@opentelemetry/sdk-trace-base": "1.25.1",
|
|
100
|
+
"@opentelemetry/semantic-conventions": "1.25.1"
|
|
100
101
|
},
|
|
101
102
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-zipkin",
|
|
102
103
|
"sideEffects": false,
|
|
103
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "0608f405573901e54db01e44c533009cf28be262"
|
|
104
105
|
}
|