@opentelemetry/exporter-zipkin 1.9.1 → 1.10.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/transform.d.ts +2 -4
- package/build/esm/transform.js +20 -7
- package/build/esm/transform.js.map +1 -1
- 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/esnext/transform.d.ts +2 -4
- package/build/esnext/transform.js +15 -3
- package/build/esnext/transform.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/src/transform.d.ts +2 -4
- package/build/src/transform.js +15 -3
- package/build/src/transform.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/package.json +6 -6
package/build/esm/transform.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as api from '@opentelemetry/api';
|
|
2
1
|
import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
|
|
3
2
|
import * as zipkinTypes from './types';
|
|
4
|
-
import { Resource } from '@opentelemetry/resources';
|
|
5
3
|
export declare const defaultStatusCodeTagName = "otel.status_code";
|
|
6
4
|
export declare const defaultStatusErrorTagName = "error";
|
|
7
5
|
/**
|
|
@@ -9,8 +7,8 @@ export declare const defaultStatusErrorTagName = "error";
|
|
|
9
7
|
* @param span Span to be translated
|
|
10
8
|
*/
|
|
11
9
|
export declare function toZipkinSpan(span: ReadableSpan, serviceName: string, statusCodeTagName: string, statusErrorTagName: string): zipkinTypes.Span;
|
|
12
|
-
/** Converts OpenTelemetry
|
|
13
|
-
export declare function _toZipkinTags(attributes
|
|
10
|
+
/** Converts OpenTelemetry Span properties to Zipkin Tags format. */
|
|
11
|
+
export declare function _toZipkinTags({ attributes, resource, status, droppedAttributesCount, droppedEventsCount, droppedLinksCount, }: ReadableSpan, statusCodeTagName: string, statusErrorTagName: string): zipkinTypes.Tags;
|
|
14
12
|
/**
|
|
15
13
|
* Converts OpenTelemetry Events to Zipkin Annotations format.
|
|
16
14
|
*/
|
package/build/esm/transform.js
CHANGED
|
@@ -52,27 +52,28 @@ export function toZipkinSpan(span, serviceName, statusCodeTagName, statusErrorTa
|
|
|
52
52
|
timestamp: hrTimeToMicroseconds(span.startTime),
|
|
53
53
|
duration: hrTimeToMicroseconds(span.duration),
|
|
54
54
|
localEndpoint: { serviceName: serviceName },
|
|
55
|
-
tags: _toZipkinTags(span
|
|
55
|
+
tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),
|
|
56
56
|
annotations: span.events.length
|
|
57
57
|
? _toZipkinAnnotations(span.events)
|
|
58
58
|
: undefined,
|
|
59
59
|
};
|
|
60
60
|
return zipkinSpan;
|
|
61
61
|
}
|
|
62
|
-
/** Converts OpenTelemetry
|
|
63
|
-
export function _toZipkinTags(
|
|
64
|
-
var e_1,
|
|
62
|
+
/** Converts OpenTelemetry Span properties to Zipkin Tags format. */
|
|
63
|
+
export function _toZipkinTags(_a, statusCodeTagName, statusErrorTagName) {
|
|
64
|
+
var e_1, _b;
|
|
65
|
+
var attributes = _a.attributes, resource = _a.resource, status = _a.status, droppedAttributesCount = _a.droppedAttributesCount, droppedEventsCount = _a.droppedEventsCount, droppedLinksCount = _a.droppedLinksCount;
|
|
65
66
|
var tags = {};
|
|
66
67
|
try {
|
|
67
|
-
for (var
|
|
68
|
-
var key =
|
|
68
|
+
for (var _c = __values(Object.keys(attributes)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
69
|
+
var key = _d.value;
|
|
69
70
|
tags[key] = String(attributes[key]);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
73
74
|
finally {
|
|
74
75
|
try {
|
|
75
|
-
if (
|
|
76
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
76
77
|
}
|
|
77
78
|
finally { if (e_1) throw e_1.error; }
|
|
78
79
|
}
|
|
@@ -82,6 +83,18 @@ export function _toZipkinTags(attributes, status, statusCodeTagName, statusError
|
|
|
82
83
|
if (status.code === api.SpanStatusCode.ERROR && status.message) {
|
|
83
84
|
tags[statusErrorTagName] = status.message;
|
|
84
85
|
}
|
|
86
|
+
/* Add droppedAttributesCount as a tag */
|
|
87
|
+
if (droppedAttributesCount) {
|
|
88
|
+
tags['otel.dropped_attributes_count'] = String(droppedAttributesCount);
|
|
89
|
+
}
|
|
90
|
+
/* Add droppedEventsCount as a tag */
|
|
91
|
+
if (droppedEventsCount) {
|
|
92
|
+
tags['otel.dropped_events_count'] = String(droppedEventsCount);
|
|
93
|
+
}
|
|
94
|
+
/* Add droppedLinksCount as a tag */
|
|
95
|
+
if (droppedLinksCount) {
|
|
96
|
+
tags['otel.dropped_links_count'] = String(droppedLinksCount);
|
|
97
|
+
}
|
|
85
98
|
Object.keys(resource.attributes).forEach(function (name) { return (tags[name] = String(resource.attributes[name])); });
|
|
86
99
|
return tags;
|
|
87
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,SAAS,CAAC;AAEvC,IAAM,wBAAwB;IAC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CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CACtC,UAAA,IAAI,IAAI,OAAA,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAhD,CAAgD,CACzD,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAoB;IAEpB,OAAO,MAAM,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC;QAC1B,SAAS,EAAE,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC;QAC3C,KAAK,EAAE,KAAK,CAAC,IAAI;KAClB,CAAC,EAHyB,CAGzB,CAAC,CAAC;AACN,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\nimport * as api from '@opentelemetry/api';\nimport { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport { hrTimeToMicroseconds } from '@opentelemetry/core';\nimport * as zipkinTypes from './types';\n\nconst ZIPKIN_SPAN_KIND_MAPPING = {\n [api.SpanKind.CLIENT]: zipkinTypes.SpanKind.CLIENT,\n [api.SpanKind.SERVER]: zipkinTypes.SpanKind.SERVER,\n [api.SpanKind.CONSUMER]: zipkinTypes.SpanKind.CONSUMER,\n [api.SpanKind.PRODUCER]: zipkinTypes.SpanKind.PRODUCER,\n // When absent, the span is local.\n [api.SpanKind.INTERNAL]: undefined,\n};\n\nexport const defaultStatusCodeTagName = 'otel.status_code';\nexport const defaultStatusErrorTagName = 'error';\n\n/**\n * Translate OpenTelemetry ReadableSpan to ZipkinSpan format\n * @param span Span to be translated\n */\nexport function toZipkinSpan(\n span: ReadableSpan,\n serviceName: string,\n statusCodeTagName: string,\n statusErrorTagName: string\n): zipkinTypes.Span {\n const zipkinSpan: zipkinTypes.Span = {\n traceId: span.spanContext().traceId,\n parentId: span.parentSpanId,\n name: span.name,\n id: span.spanContext().spanId,\n kind: ZIPKIN_SPAN_KIND_MAPPING[span.kind],\n timestamp: hrTimeToMicroseconds(span.startTime),\n duration: hrTimeToMicroseconds(span.duration),\n localEndpoint: { serviceName },\n tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),\n annotations: span.events.length\n ? _toZipkinAnnotations(span.events)\n : undefined,\n };\n\n return zipkinSpan;\n}\n\n/** Converts OpenTelemetry Span properties to Zipkin Tags format. */\nexport function _toZipkinTags(\n {\n attributes,\n resource,\n status,\n droppedAttributesCount,\n droppedEventsCount,\n droppedLinksCount,\n }: ReadableSpan,\n statusCodeTagName: string,\n statusErrorTagName: string\n): zipkinTypes.Tags {\n const tags: { [key: string]: string } = {};\n for (const key of Object.keys(attributes)) {\n tags[key] = String(attributes[key]);\n }\n if (status.code !== api.SpanStatusCode.UNSET) {\n tags[statusCodeTagName] = String(api.SpanStatusCode[status.code]);\n }\n if (status.code === api.SpanStatusCode.ERROR && status.message) {\n tags[statusErrorTagName] = status.message;\n }\n /* Add droppedAttributesCount as a tag */\n if (droppedAttributesCount) {\n tags['otel.dropped_attributes_count'] = String(droppedAttributesCount);\n }\n\n /* Add droppedEventsCount as a tag */\n if (droppedEventsCount) {\n tags['otel.dropped_events_count'] = String(droppedEventsCount);\n }\n\n /* Add droppedLinksCount as a tag */\n if (droppedLinksCount) {\n tags['otel.dropped_links_count'] = String(droppedLinksCount);\n }\n\n Object.keys(resource.attributes).forEach(\n name => (tags[name] = String(resource.attributes[name]))\n );\n\n return tags;\n}\n\n/**\n * Converts OpenTelemetry Events to Zipkin Annotations format.\n */\nexport function _toZipkinAnnotations(\n events: TimedEvent[]\n): zipkinTypes.Annotation[] {\n return events.map(event => ({\n timestamp: hrTimeToMicroseconds(event.time),\n value: event.name,\n }));\n}\n"]}
|
package/build/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.10.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,
|
|
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.10.1';\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as api from '@opentelemetry/api';
|
|
2
1
|
import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
|
|
3
2
|
import * as zipkinTypes from './types';
|
|
4
|
-
import { Resource } from '@opentelemetry/resources';
|
|
5
3
|
export declare const defaultStatusCodeTagName = "otel.status_code";
|
|
6
4
|
export declare const defaultStatusErrorTagName = "error";
|
|
7
5
|
/**
|
|
@@ -9,8 +7,8 @@ export declare const defaultStatusErrorTagName = "error";
|
|
|
9
7
|
* @param span Span to be translated
|
|
10
8
|
*/
|
|
11
9
|
export declare function toZipkinSpan(span: ReadableSpan, serviceName: string, statusCodeTagName: string, statusErrorTagName: string): zipkinTypes.Span;
|
|
12
|
-
/** Converts OpenTelemetry
|
|
13
|
-
export declare function _toZipkinTags(attributes
|
|
10
|
+
/** Converts OpenTelemetry Span properties to Zipkin Tags format. */
|
|
11
|
+
export declare function _toZipkinTags({ attributes, resource, status, droppedAttributesCount, droppedEventsCount, droppedLinksCount, }: ReadableSpan, statusCodeTagName: string, statusErrorTagName: string): zipkinTypes.Tags;
|
|
14
12
|
/**
|
|
15
13
|
* Converts OpenTelemetry Events to Zipkin Annotations format.
|
|
16
14
|
*/
|
|
@@ -40,15 +40,15 @@ export function toZipkinSpan(span, serviceName, statusCodeTagName, statusErrorTa
|
|
|
40
40
|
timestamp: hrTimeToMicroseconds(span.startTime),
|
|
41
41
|
duration: hrTimeToMicroseconds(span.duration),
|
|
42
42
|
localEndpoint: { serviceName },
|
|
43
|
-
tags: _toZipkinTags(span
|
|
43
|
+
tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),
|
|
44
44
|
annotations: span.events.length
|
|
45
45
|
? _toZipkinAnnotations(span.events)
|
|
46
46
|
: undefined,
|
|
47
47
|
};
|
|
48
48
|
return zipkinSpan;
|
|
49
49
|
}
|
|
50
|
-
/** Converts OpenTelemetry
|
|
51
|
-
export function _toZipkinTags(attributes, status, statusCodeTagName, statusErrorTagName
|
|
50
|
+
/** Converts OpenTelemetry Span properties to Zipkin Tags format. */
|
|
51
|
+
export function _toZipkinTags({ attributes, resource, status, droppedAttributesCount, droppedEventsCount, droppedLinksCount, }, statusCodeTagName, statusErrorTagName) {
|
|
52
52
|
const tags = {};
|
|
53
53
|
for (const key of Object.keys(attributes)) {
|
|
54
54
|
tags[key] = String(attributes[key]);
|
|
@@ -59,6 +59,18 @@ export function _toZipkinTags(attributes, status, statusCodeTagName, statusError
|
|
|
59
59
|
if (status.code === api.SpanStatusCode.ERROR && status.message) {
|
|
60
60
|
tags[statusErrorTagName] = status.message;
|
|
61
61
|
}
|
|
62
|
+
/* Add droppedAttributesCount as a tag */
|
|
63
|
+
if (droppedAttributesCount) {
|
|
64
|
+
tags['otel.dropped_attributes_count'] = String(droppedAttributesCount);
|
|
65
|
+
}
|
|
66
|
+
/* Add droppedEventsCount as a tag */
|
|
67
|
+
if (droppedEventsCount) {
|
|
68
|
+
tags['otel.dropped_events_count'] = String(droppedEventsCount);
|
|
69
|
+
}
|
|
70
|
+
/* Add droppedLinksCount as a tag */
|
|
71
|
+
if (droppedLinksCount) {
|
|
72
|
+
tags['otel.dropped_links_count'] = String(droppedLinksCount);
|
|
73
|
+
}
|
|
62
74
|
Object.keys(resource.attributes).forEach(name => (tags[name] = String(resource.attributes[name])));
|
|
63
75
|
return tags;
|
|
64
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,SAAS,CAAC;AAEvC,MAAM,wBAAwB,GAAG;IAC/B,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,QA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U,CAAC,IAAI,CAAC,CAAC,CAAC,CACzD,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAoB;IAEpB,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1B,SAAS,EAAE,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC;QAC3C,KAAK,EAAE,KAAK,CAAC,IAAI;KAClB,CAAC,CAAC,CAAC;AACN,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\nimport * as api from '@opentelemetry/api';\nimport { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport { hrTimeToMicroseconds } from '@opentelemetry/core';\nimport * as zipkinTypes from './types';\n\nconst ZIPKIN_SPAN_KIND_MAPPING = {\n [api.SpanKind.CLIENT]: zipkinTypes.SpanKind.CLIENT,\n [api.SpanKind.SERVER]: zipkinTypes.SpanKind.SERVER,\n [api.SpanKind.CONSUMER]: zipkinTypes.SpanKind.CONSUMER,\n [api.SpanKind.PRODUCER]: zipkinTypes.SpanKind.PRODUCER,\n // When absent, the span is local.\n [api.SpanKind.INTERNAL]: undefined,\n};\n\nexport const defaultStatusCodeTagName = 'otel.status_code';\nexport const defaultStatusErrorTagName = 'error';\n\n/**\n * Translate OpenTelemetry ReadableSpan to ZipkinSpan format\n * @param span Span to be translated\n */\nexport function toZipkinSpan(\n span: ReadableSpan,\n serviceName: string,\n statusCodeTagName: string,\n statusErrorTagName: string\n): zipkinTypes.Span {\n const zipkinSpan: zipkinTypes.Span = {\n traceId: span.spanContext().traceId,\n parentId: span.parentSpanId,\n name: span.name,\n id: span.spanContext().spanId,\n kind: ZIPKIN_SPAN_KIND_MAPPING[span.kind],\n timestamp: hrTimeToMicroseconds(span.startTime),\n duration: hrTimeToMicroseconds(span.duration),\n localEndpoint: { serviceName },\n tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),\n annotations: span.events.length\n ? _toZipkinAnnotations(span.events)\n : undefined,\n };\n\n return zipkinSpan;\n}\n\n/** Converts OpenTelemetry Span properties to Zipkin Tags format. */\nexport function _toZipkinTags(\n {\n attributes,\n resource,\n status,\n droppedAttributesCount,\n droppedEventsCount,\n droppedLinksCount,\n }: ReadableSpan,\n statusCodeTagName: string,\n statusErrorTagName: string\n): zipkinTypes.Tags {\n const tags: { [key: string]: string } = {};\n for (const key of Object.keys(attributes)) {\n tags[key] = String(attributes[key]);\n }\n if (status.code !== api.SpanStatusCode.UNSET) {\n tags[statusCodeTagName] = String(api.SpanStatusCode[status.code]);\n }\n if (status.code === api.SpanStatusCode.ERROR && status.message) {\n tags[statusErrorTagName] = status.message;\n }\n /* Add droppedAttributesCount as a tag */\n if (droppedAttributesCount) {\n tags['otel.dropped_attributes_count'] = String(droppedAttributesCount);\n }\n\n /* Add droppedEventsCount as a tag */\n if (droppedEventsCount) {\n tags['otel.dropped_events_count'] = String(droppedEventsCount);\n }\n\n /* Add droppedLinksCount as a tag */\n if (droppedLinksCount) {\n tags['otel.dropped_links_count'] = String(droppedLinksCount);\n }\n\n Object.keys(resource.attributes).forEach(\n name => (tags[name] = String(resource.attributes[name]))\n );\n\n return tags;\n}\n\n/**\n * Converts OpenTelemetry Events to Zipkin Annotations format.\n */\nexport function _toZipkinAnnotations(\n events: TimedEvent[]\n): zipkinTypes.Annotation[] {\n return events.map(event => ({\n timestamp: hrTimeToMicroseconds(event.time),\n value: event.name,\n }));\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.10.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,
|
|
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.10.1';\n"]}
|
package/build/src/transform.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as api from '@opentelemetry/api';
|
|
2
1
|
import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
|
|
3
2
|
import * as zipkinTypes from './types';
|
|
4
|
-
import { Resource } from '@opentelemetry/resources';
|
|
5
3
|
export declare const defaultStatusCodeTagName = "otel.status_code";
|
|
6
4
|
export declare const defaultStatusErrorTagName = "error";
|
|
7
5
|
/**
|
|
@@ -9,8 +7,8 @@ export declare const defaultStatusErrorTagName = "error";
|
|
|
9
7
|
* @param span Span to be translated
|
|
10
8
|
*/
|
|
11
9
|
export declare function toZipkinSpan(span: ReadableSpan, serviceName: string, statusCodeTagName: string, statusErrorTagName: string): zipkinTypes.Span;
|
|
12
|
-
/** Converts OpenTelemetry
|
|
13
|
-
export declare function _toZipkinTags(attributes
|
|
10
|
+
/** Converts OpenTelemetry Span properties to Zipkin Tags format. */
|
|
11
|
+
export declare function _toZipkinTags({ attributes, resource, status, droppedAttributesCount, droppedEventsCount, droppedLinksCount, }: ReadableSpan, statusCodeTagName: string, statusErrorTagName: string): zipkinTypes.Tags;
|
|
14
12
|
/**
|
|
15
13
|
* Converts OpenTelemetry Events to Zipkin Annotations format.
|
|
16
14
|
*/
|
package/build/src/transform.js
CHANGED
|
@@ -43,7 +43,7 @@ function toZipkinSpan(span, serviceName, statusCodeTagName, statusErrorTagName)
|
|
|
43
43
|
timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime),
|
|
44
44
|
duration: (0, core_1.hrTimeToMicroseconds)(span.duration),
|
|
45
45
|
localEndpoint: { serviceName },
|
|
46
|
-
tags: _toZipkinTags(span
|
|
46
|
+
tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),
|
|
47
47
|
annotations: span.events.length
|
|
48
48
|
? _toZipkinAnnotations(span.events)
|
|
49
49
|
: undefined,
|
|
@@ -51,8 +51,8 @@ function toZipkinSpan(span, serviceName, statusCodeTagName, statusErrorTagName)
|
|
|
51
51
|
return zipkinSpan;
|
|
52
52
|
}
|
|
53
53
|
exports.toZipkinSpan = toZipkinSpan;
|
|
54
|
-
/** Converts OpenTelemetry
|
|
55
|
-
function _toZipkinTags(attributes, status, statusCodeTagName, statusErrorTagName
|
|
54
|
+
/** Converts OpenTelemetry Span properties to Zipkin Tags format. */
|
|
55
|
+
function _toZipkinTags({ attributes, resource, status, droppedAttributesCount, droppedEventsCount, droppedLinksCount, }, statusCodeTagName, statusErrorTagName) {
|
|
56
56
|
const tags = {};
|
|
57
57
|
for (const key of Object.keys(attributes)) {
|
|
58
58
|
tags[key] = String(attributes[key]);
|
|
@@ -63,6 +63,18 @@ function _toZipkinTags(attributes, status, statusCodeTagName, statusErrorTagName
|
|
|
63
63
|
if (status.code === api.SpanStatusCode.ERROR && status.message) {
|
|
64
64
|
tags[statusErrorTagName] = status.message;
|
|
65
65
|
}
|
|
66
|
+
/* Add droppedAttributesCount as a tag */
|
|
67
|
+
if (droppedAttributesCount) {
|
|
68
|
+
tags['otel.dropped_attributes_count'] = String(droppedAttributesCount);
|
|
69
|
+
}
|
|
70
|
+
/* Add droppedEventsCount as a tag */
|
|
71
|
+
if (droppedEventsCount) {
|
|
72
|
+
tags['otel.dropped_events_count'] = String(droppedEventsCount);
|
|
73
|
+
}
|
|
74
|
+
/* Add droppedLinksCount as a tag */
|
|
75
|
+
if (droppedLinksCount) {
|
|
76
|
+
tags['otel.dropped_links_count'] = String(droppedLinksCount);
|
|
77
|
+
}
|
|
66
78
|
Object.keys(resource.attributes).forEach(name => (tags[name] = String(resource.attributes[name])));
|
|
67
79
|
return tags;
|
|
68
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,0CAA0C;AAE1C,8CAA2D;AAC3D,uCAAuC;
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,0CAA0C;AAE1C,8CAA2D;AAC3D,uCAAuC;AAEvC,MAAM,wBAAwB,GAAG;IAC/B,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM;IAClD,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM;IAClD,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,QAAQ;IACtD,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CA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C,KAAK,CAAC,IAAI,CAAC;QAC3C,KAAK,EAAE,KAAK,CAAC,IAAI;KAClB,CAAC,CAAC,CAAC;AACN,CAAC;AAPD,oDAOC","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 * as api from '@opentelemetry/api';\nimport { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport { hrTimeToMicroseconds } from '@opentelemetry/core';\nimport * as zipkinTypes from './types';\n\nconst ZIPKIN_SPAN_KIND_MAPPING = {\n [api.SpanKind.CLIENT]: zipkinTypes.SpanKind.CLIENT,\n [api.SpanKind.SERVER]: zipkinTypes.SpanKind.SERVER,\n [api.SpanKind.CONSUMER]: zipkinTypes.SpanKind.CONSUMER,\n [api.SpanKind.PRODUCER]: zipkinTypes.SpanKind.PRODUCER,\n // When absent, the span is local.\n [api.SpanKind.INTERNAL]: undefined,\n};\n\nexport const defaultStatusCodeTagName = 'otel.status_code';\nexport const defaultStatusErrorTagName = 'error';\n\n/**\n * Translate OpenTelemetry ReadableSpan to ZipkinSpan format\n * @param span Span to be translated\n */\nexport function toZipkinSpan(\n span: ReadableSpan,\n serviceName: string,\n statusCodeTagName: string,\n statusErrorTagName: string\n): zipkinTypes.Span {\n const zipkinSpan: zipkinTypes.Span = {\n traceId: span.spanContext().traceId,\n parentId: span.parentSpanId,\n name: span.name,\n id: span.spanContext().spanId,\n kind: ZIPKIN_SPAN_KIND_MAPPING[span.kind],\n timestamp: hrTimeToMicroseconds(span.startTime),\n duration: hrTimeToMicroseconds(span.duration),\n localEndpoint: { serviceName },\n tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),\n annotations: span.events.length\n ? _toZipkinAnnotations(span.events)\n : undefined,\n };\n\n return zipkinSpan;\n}\n\n/** Converts OpenTelemetry Span properties to Zipkin Tags format. */\nexport function _toZipkinTags(\n {\n attributes,\n resource,\n status,\n droppedAttributesCount,\n droppedEventsCount,\n droppedLinksCount,\n }: ReadableSpan,\n statusCodeTagName: string,\n statusErrorTagName: string\n): zipkinTypes.Tags {\n const tags: { [key: string]: string } = {};\n for (const key of Object.keys(attributes)) {\n tags[key] = String(attributes[key]);\n }\n if (status.code !== api.SpanStatusCode.UNSET) {\n tags[statusCodeTagName] = String(api.SpanStatusCode[status.code]);\n }\n if (status.code === api.SpanStatusCode.ERROR && status.message) {\n tags[statusErrorTagName] = status.message;\n }\n /* Add droppedAttributesCount as a tag */\n if (droppedAttributesCount) {\n tags['otel.dropped_attributes_count'] = String(droppedAttributesCount);\n }\n\n /* Add droppedEventsCount as a tag */\n if (droppedEventsCount) {\n tags['otel.dropped_events_count'] = String(droppedEventsCount);\n }\n\n /* Add droppedLinksCount as a tag */\n if (droppedLinksCount) {\n tags['otel.dropped_links_count'] = String(droppedLinksCount);\n }\n\n Object.keys(resource.attributes).forEach(\n name => (tags[name] = String(resource.attributes[name]))\n );\n\n return tags;\n}\n\n/**\n * Converts OpenTelemetry Events to Zipkin Annotations format.\n */\nexport function _toZipkinAnnotations(\n events: TimedEvent[]\n): zipkinTypes.Annotation[] {\n return events.map(event => ({\n timestamp: hrTimeToMicroseconds(event.time),\n value: event.name,\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.10.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,
|
|
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.10.1';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/exporter-zipkin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.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",
|
|
@@ -91,12 +91,12 @@
|
|
|
91
91
|
"@opentelemetry/api": "^1.0.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@opentelemetry/core": "1.
|
|
95
|
-
"@opentelemetry/resources": "1.
|
|
96
|
-
"@opentelemetry/sdk-trace-base": "1.
|
|
97
|
-
"@opentelemetry/semantic-conventions": "1.
|
|
94
|
+
"@opentelemetry/core": "1.10.1",
|
|
95
|
+
"@opentelemetry/resources": "1.10.1",
|
|
96
|
+
"@opentelemetry/sdk-trace-base": "1.10.1",
|
|
97
|
+
"@opentelemetry/semantic-conventions": "1.10.1"
|
|
98
98
|
},
|
|
99
99
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-zipkin",
|
|
100
100
|
"sideEffects": false,
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "486df99906958de9b8b666839785b00160a6a229"
|
|
102
102
|
}
|