rian 0.0.2-alpha.12 → 0.0.2-alpha.13
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/index.d.ts +1 -9
- package/index.js +6 -9
- package/index.mjs +6 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -126,15 +126,7 @@ interface Scope {
|
|
126
126
|
set_context(context: Context): void;
|
127
127
|
end(): void;
|
128
128
|
}
|
129
|
-
interface Tracer extends
|
130
|
-
/**
|
131
|
-
* @borrows {@link Scope.fork}
|
132
|
-
*/
|
133
|
-
span: Scope['fork'];
|
134
|
-
/**
|
135
|
-
* @borrows {@link Scope.measure}
|
136
|
-
*/
|
137
|
-
measure: Scope['measure'];
|
129
|
+
interface Tracer extends Omit<Scope, 'end'> {
|
138
130
|
end(): ReturnType<Exporter>;
|
139
131
|
}
|
140
132
|
declare const create: (name: string, options: Options) => Tracer;
|
package/index.js
CHANGED
@@ -105,16 +105,13 @@ const create = (name, options) => {
|
|
105
105
|
const root = span(name, typeof options.traceparent === 'string'
|
106
106
|
? tctx__namespace.parse(options.traceparent)
|
107
107
|
: undefined);
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
root.end();
|
114
|
-
await Promise.all(promises);
|
115
|
-
return options.exporter(spans, Object.assign(options.context || {}, sdk_object));
|
116
|
-
},
|
108
|
+
const endRoot = root.end.bind(root);
|
109
|
+
root.end = async () => {
|
110
|
+
endRoot();
|
111
|
+
await Promise.all(promises);
|
112
|
+
return options.exporter(spans, Object.assign(options.context || {}, sdk_object));
|
117
113
|
};
|
114
|
+
return root;
|
118
115
|
};
|
119
116
|
|
120
117
|
exports.create = create;
|
package/index.mjs
CHANGED
@@ -83,16 +83,13 @@ const create = (name, options) => {
|
|
83
83
|
const root = span(name, typeof options.traceparent === 'string'
|
84
84
|
? tctx.parse(options.traceparent)
|
85
85
|
: undefined);
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
root.end();
|
92
|
-
await Promise.all(promises);
|
93
|
-
return options.exporter(spans, Object.assign(options.context || {}, sdk_object));
|
94
|
-
},
|
86
|
+
const endRoot = root.end.bind(root);
|
87
|
+
root.end = async () => {
|
88
|
+
endRoot();
|
89
|
+
await Promise.all(promises);
|
90
|
+
return options.exporter(spans, Object.assign(options.context || {}, sdk_object));
|
95
91
|
};
|
92
|
+
return root;
|
96
93
|
};
|
97
94
|
|
98
95
|
export { create };
|