@uoa/lambda-tracing 2.0.0-beta.3 → 2.0.0-beta.5
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/zipkin/zipkin.js +3 -9
- package/package.json +2 -2
- package/zipkin/zipkin.ts +11 -25
package/dist/zipkin/zipkin.js
CHANGED
|
@@ -56,7 +56,6 @@ class ZipkinExporter {
|
|
|
56
56
|
const serviceName = String(this._serviceName ||
|
|
57
57
|
spans[0].resource.attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] ||
|
|
58
58
|
this.DEFAULT_SERVICE_NAME);
|
|
59
|
-
api_1.diag.debug('export: ', serviceName);
|
|
60
59
|
api_1.diag.debug('Zipkin exporter export');
|
|
61
60
|
if (this._isShutdown) {
|
|
62
61
|
setTimeout(() => resultCallback({
|
|
@@ -105,14 +104,9 @@ class ZipkinExporter {
|
|
|
105
104
|
* Transform spans and sends to Zipkin service.
|
|
106
105
|
*/
|
|
107
106
|
_sendSpans(spans, serviceName, done) {
|
|
108
|
-
const zipkinSpans = spans.map(span =>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
span.resource.attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]));
|
|
112
|
-
return (0, transform_1.toZipkinSpan)(span, String(serviceName ||
|
|
113
|
-
span.attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] ||
|
|
114
|
-
span.resource.attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]), this._statusCodeTagName, this._statusDescriptionTagName);
|
|
115
|
-
});
|
|
107
|
+
const zipkinSpans = spans.map(span => (0, transform_1.toZipkinSpan)(span, String(serviceName ||
|
|
108
|
+
span.attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] ||
|
|
109
|
+
span.resource.attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]), this._statusCodeTagName, this._statusDescriptionTagName));
|
|
116
110
|
this._beforeSend();
|
|
117
111
|
return this._send(zipkinSpans, (result) => {
|
|
118
112
|
if (done) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uoa/lambda-tracing",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.5",
|
|
4
4
|
"description": "Library for logging & distributed tracing in UoA Lambda projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"types": "dist/tracing.d.ts",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
-
"
|
|
22
|
+
"prepare": "tsc"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
".": "./dist/tracing.js",
|
package/zipkin/zipkin.ts
CHANGED
|
@@ -61,7 +61,6 @@ export class ZipkinExporter implements SpanExporter {
|
|
|
61
61
|
// noop
|
|
62
62
|
this._beforeSend = function () {};
|
|
63
63
|
}
|
|
64
|
-
console.log('zipkin constructor serviceName: ', this._serviceName);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
/**
|
|
@@ -76,10 +75,6 @@ export class ZipkinExporter implements SpanExporter {
|
|
|
76
75
|
spans[0].resource.attributes[SemanticResourceAttributes.SERVICE_NAME] ||
|
|
77
76
|
this.DEFAULT_SERVICE_NAME
|
|
78
77
|
);
|
|
79
|
-
console.log('zipkin export serviceName: ', serviceName);
|
|
80
|
-
console.log('zipkin export this._serviceName: ', this._serviceName);
|
|
81
|
-
console.log('zipkin export [SERVICE_NAME]: ', spans[0].resource.attributes[SemanticResourceAttributes.SERVICE_NAME]);
|
|
82
|
-
console.log('zipkin export DEFAULT_SERVICE_NAME: ', this.DEFAULT_SERVICE_NAME);
|
|
83
78
|
|
|
84
79
|
diag.debug('Zipkin exporter export');
|
|
85
80
|
if (this._isShutdown) {
|
|
@@ -140,26 +135,17 @@ export class ZipkinExporter implements SpanExporter {
|
|
|
140
135
|
serviceName: string,
|
|
141
136
|
done?: (result: ExportResult) => void
|
|
142
137
|
) {
|
|
143
|
-
const zipkinSpans = spans.map(span =>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
String(
|
|
155
|
-
serviceName ||
|
|
156
|
-
span.attributes[SemanticResourceAttributes.SERVICE_NAME] ||
|
|
157
|
-
span.resource.attributes[SemanticResourceAttributes.SERVICE_NAME]
|
|
158
|
-
),
|
|
159
|
-
this._statusCodeTagName,
|
|
160
|
-
this._statusDescriptionTagName
|
|
161
|
-
)
|
|
162
|
-
}
|
|
138
|
+
const zipkinSpans = spans.map(span =>
|
|
139
|
+
toZipkinSpan(
|
|
140
|
+
span,
|
|
141
|
+
String(
|
|
142
|
+
serviceName ||
|
|
143
|
+
span.attributes[SemanticResourceAttributes.SERVICE_NAME] ||
|
|
144
|
+
span.resource.attributes[SemanticResourceAttributes.SERVICE_NAME]
|
|
145
|
+
),
|
|
146
|
+
this._statusCodeTagName,
|
|
147
|
+
this._statusDescriptionTagName
|
|
148
|
+
)
|
|
163
149
|
);
|
|
164
150
|
this._beforeSend();
|
|
165
151
|
return this._send(zipkinSpans, (result: ExportResult) => {
|