rian 0.0.2-alpha.12 → 0.0.2-alpha.13

Sign up to get free protection for your applications and to get access to all the features.
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 Pick<Scope, 'traceparent'> {
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
- return {
109
- traceparent: root.traceparent,
110
- span: root.fork.bind(root),
111
- measure: root.measure.bind(root),
112
- async end() {
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
- return {
87
- traceparent: root.traceparent,
88
- span: root.fork.bind(root),
89
- measure: root.measure.bind(root),
90
- async end() {
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rian",
3
- "version": "0.0.2-alpha.12",
3
+ "version": "0.0.2-alpha.13",
4
4
  "description": "A tracer for the edge",
5
5
  "keywords": [
6
6
  "TODO"