Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing .fields() method in jaeger propagator #268

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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