Skip to content

Commit

Permalink
feat: Add event type
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Mar 4, 2019
1 parent f256960 commit f3df061
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/opentracing/src/tracer.ts
Expand Up @@ -43,7 +43,10 @@ export class Tracer extends opentracing.Tracer {
public flush(): void {
const finishedSpans = this.spans.filter((span: Span) => span.isFinished() && !span.isFlushed());
if (finishedSpans.length) {
getCurrentHub().captureEvent({ spans: finishedSpans.map((span: Span) => span.flush()) });
getCurrentHub().captureEvent({
spans: finishedSpans.map((span: Span) => span.flush()),
type: 'none',
});
}
}
}
4 changes: 4 additions & 0 deletions packages/types/src/event.ts
Expand Up @@ -34,8 +34,12 @@ export interface Event {
extra?: { [key: string]: any };
user?: User;
spans?: Span[];
type?: EventType;
}

/** JSDoc */
export type EventType = 'none';

/** JSDoc */
export interface EventHint {
event_id?: string;
Expand Down

0 comments on commit f3df061

Please sign in to comment.