Skip to content

Commit

Permalink
fix: missing .fields() method in jaeger propagator (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmalinowski authored Dec 8, 2020
1 parent 6449f22 commit d896904
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export class JaegerHttpTracePropagator implements TextMapPropagator {

return setExtractedSpanContext(context, spanContext);
}

fields(): string[] {
return [this._jaegerTraceHeader];
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ describe('JaegerHttpTracePropagator', () => {
});
});

describe('.fields()', () => {
it('returns the default header if not customized', () => {
assert.deepStrictEqual(jaegerHttpTracePropagator.fields(), [
'uber-trace-id',
]);
});
it('returns the customized header if customized', () => {
assert.deepStrictEqual(customJaegerHttpTracePropagator.fields(), [
customHeader,
]);
});
});

it('should fail gracefully on bad responses from getter', () => {
const ctx1 = jaegerHttpTracePropagator.extract(
ROOT_CONTEXT,
Expand Down

0 comments on commit d896904

Please sign in to comment.