Skip to content

Commit f5f9d2d

Browse files
committed
fix: Also add operation
1 parent 38639b0 commit f5f9d2d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/opentracing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"access": "public"
1616
},
1717
"dependencies": {
18-
"@sentry/hub": "4.6.1",
19-
"@sentry/utils": "4.6.1",
18+
"@sentry/hub": "4.6.2",
19+
"@sentry/utils": "4.6.2",
2020
"@sentry/types": "4.5.3",
2121
"opentracing": "0.14.3"
2222
},

packages/opentracing/src/span.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Tracer } from './tracer';
55

66
/** JSDoc */
77
interface Log {
8-
keyValuePairs: { [key: string]: any };
8+
data: { [key: string]: any };
99
timestamp?: number;
1010
}
1111

@@ -78,9 +78,9 @@ export class Span extends opentracing.Span implements SpanInterface {
7878
/**
7979
* Store log entry.
8080
*/
81-
protected _log(keyValuePairs: { [key: string]: any }, timestamp?: number): void {
81+
protected _log(data: { [key: string]: any }, timestamp?: number): void {
8282
this.logs.push({
83-
keyValuePairs,
83+
data,
8484
timestamp,
8585
});
8686
}
@@ -133,12 +133,13 @@ export class Span extends opentracing.Span implements SpanInterface {
133133
*/
134134
public toJSON(): object {
135135
return {
136-
finishTime: this.finishTime || undefined,
137-
logs: this.logs,
138-
references: this.references,
136+
finishTime: (this.finishTime && this.finishTime / 1000) || undefined,
137+
logs: this.logs.length === 0 ? undefined : this.logs,
138+
operation: this.operation,
139+
references: this.references && this.references,
139140
span_id: this.spanContext.spanId,
140-
startTime: this.startTime,
141-
tags: this.tags,
141+
startTime: this.startTime / 1000,
142+
tags: Object.keys(this.tags).length === 0 ? undefined : this.tags,
142143
trace_id: this.spanContext.traceId,
143144
};
144145
}

0 commit comments

Comments
 (0)