Skip to content

Commit

Permalink
Merge branch 'master' into getentriesbytype-undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
obecny authored Dec 8, 2020
2 parents e65ff54 + d896904 commit 82e1ad5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ OpenTelemetry can collect tracing data automatically using plugins. Vendors/User
- [@opentelemetry/plugin-dns][otel-plugin-dns]
- [@opentelemetry/hapi-instrumentation][otel-contrib-hapi-instrumentation]
- [@opentelemetry/koa-instrumentation][otel-contrib-koa-instrumentation]
- [@opentelemetry/instrumentation-graphql][otel-contrib-instrumentation-graphql]

### Web Plugins

Expand Down Expand Up @@ -135,3 +136,4 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[otel-plugins-node-core-and-contrib]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/metapackages/plugins-node-core-and-contrib
[otel-contrib-hapi-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-hapi-instrumentation
[otel-contrib-koa-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-koa-instrumentation
[otel-contrib-instrumentation-graphql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-hapi-instrumentation
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 82e1ad5

Please sign in to comment.