-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: add jaeger http trace format (#696) #701
Conversation
Codecov Report
@@ Coverage Diff @@
## master #701 +/- ##
=========================================
Coverage ? 91.01%
=========================================
Files ? 221
Lines ? 10366
Branches ? 959
=========================================
Hits ? 9435
Misses ? 931
Partials ? 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start, thanks for this.
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
You just need to fix the formatting now by running |
sorry first time touching js ts and etc |
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment previously but the mechanism you used will convert it to decimal not hex and only will give a single character.
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be in a new package ? I don't believe that core
should have something with Jaeger implementation. Because after that we could have Zipkin, Elastic APM etc...
packages/opentelemetry-core/src/context/propagation/JaegerHttpTraceFormat.ts
Outdated
Show resolved
Hide resolved
+1 I would suggest to create a new package (something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this looks good now. Thanks for doing this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, added few comments - some minor changes, but the urls in readme needs to be changed,
thx
[![devDependencies][devDependencies-image]][devDependencies-url] | ||
[![Apache License][license-image]][license-image] | ||
|
||
OpenTelemetry propagation Jaeger provide HTTP header propagation for systems that using Jaeger HTTP header format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you say for such description?:
OpenTelemetry Jaeger Propagator provides HTTP header propagation for systems that are using Jaeger HTTP header format.
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE | ||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-core | ||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have wrong url, it should be opentelemetry-propagator-jaeger
instead of opentelemetry-core
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-core | ||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core | ||
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/dev-status.svg?path=packages/opentelemetry-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have wrong url, it should be opentelemetry-propagator-jaeger
instead of opentelemetry-core
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE | ||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have wrong url, it should be opentelemetry-propagator-jaeger
instead of opentelemetry-core
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-core | ||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core | ||
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/dev-status.svg?path=packages/opentelemetry-core | ||
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core&type=dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have wrong url, it should be opentelemetry-propagator-jaeger
instead of opentelemetry-core
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/dev-status.svg?path=packages/opentelemetry-core | ||
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core&type=dev | ||
[npm-url]: https://www.npmjs.com/package/@opentelemetry/core | ||
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fcore.svg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have wrong url, it should be propagator-jaeger
instead of core
{ | ||
"name": "@opentelemetry/propagator-jaeger", | ||
"version": "0.3.2", | ||
"description": "OpenTelemetry propagator Jaeger provide HTTP header propagation for systems that using Jaeger HTTP header format", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same here?:
OpenTelemetry Jaeger Propagator provides HTTP header propagation for systems that are using Jaeger HTTP header format.
* Propagates {@link SpanContext} through Trace Context format propagation. | ||
* {trace-id}:{span-id}:{parent-span-id}:{flags} | ||
* {trace-id} | ||
* 64-bit or 128-bit random number in base16 format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma in the end ?, and this should apply for other comments too
this._jaegerTraceHeader = customTraceHeader || UBER_TRACE_ID_HEADER; | ||
} | ||
|
||
inject( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add some jsdoc
] = `${spanContext.traceId}:${spanContext.spanId}:0:${traceFlags}`; | ||
} | ||
|
||
extract( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add some jsdoc
@DotSpy could you please add the mentioned screenshot also to the readme, so that it is shown nicely when you view the package ? |
* limitations under the License. | ||
*/ | ||
|
||
export * from './context/propagation/JaegerHttpTraceFormat.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep JaegerTraceFormat
in src/
dirrectly, why do we need to have sub-folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this should be just export * from './context/propagation/JaegerHttpTraceFormat';
or export * from './JaegerHttpTraceFormat';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mayurkale22 i did it like in opentelemetry-core to keep the same structure. I don't know how better, because this is my first experience with this technology stack. In other languages like Java, Scala, Kotlin and etc. we keeping the same structure for the same responsibilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In node it is very common to have a package with a single file in no folder structure of any kind if it only fulfills a single purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for these changes.
One thing and some explanation for this description
"OpenTelemetry propagator-jaeger provides
HTTP header propagation for systems that are
using Jaeger HTTP header format"
propagator-jaeger
is good name when we name package so the the namespace is correct.
For example plugin-xml-http-request
, plugin-http
, plugin-mysql
etc. But when you are describing what it is you are using common language, that's why we have MySql Plugin
and not Plugin MySql
, XMLHttpRequest Plugin
and not Plugin XMLHttpRequest
. So the same applies here.
That's why I think it would sounds more naturally when you say Yaeger Propagator
, instead Propagator Yaeger
, That's why in description I think we should use this form Yaeger Propagator
when we say about @opentelemetry/propagator-yaeger
.
And if in future we want to have more propagators it will be @opentelemetry/propagator-xyz
and we will call it XYZ Propagator
.
I hope my explanation is fine :) besides that great job with your's Yaeger Propagator :)
ohh thanks, got it, will change |
For now i do not understand why it's failing, any ideas? |
require.context only works when used with webpack. your node 8/10/12 tests are attempting to run the |
try to replace in package.json the |
Why does |
i think this issue with test directories in opentelemetry-propagator-jaeger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* @param {string} [customTraceHeader="uber-trace-id"] - HTTP header to inject\extract trace from. | ||
**/ | ||
constructor(customTraceHeader?: string) { | ||
this._jaegerTraceHeader = customTraceHeader || UBER_TRACE_ID_HEADER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…ry#701) * feat: add jaeger http trace format (open-telemetry#696) * feat: add jaeger http trace format (open-telemetry#696) * feat: add jaeger http trace format (open-telemetry#696) * feat: add jaeger http trace format (open-telemetry#696) * feat: add jaeger http trace format (open-telemetry#696) * feat: add jaeger http trace format (open-telemetry#696) * fix: we should set sampled\unsampled via flag * fix: we should set sampled\unsampled via flag * fix: flags should be converted to hex, not decimal * feat: create new package for propagation jaeger * fix: remove unused dependencies, correct readme header, moved out jaeger from core index.ts * fix: added jaeger keyword * fix: remove comma * docs: replace NodeTracer with NodeTracerRegistry * fix: added missing jaeger keyword to exporter-jaeger * fix: remove test for browser * fix: remove yarn for browser * fix: use same naming style as other packages * feat: added index.ts and version.ts, revert test for browser * fix: tests added index-webpack.ts * test: add test with span generated by jaeger client * fix: apply review changes * fix: move out from sub dirs * docs: use common language for docs * fix: test script fix Co-authored-by: Uladzislau Kiva <[email protected]>
Which problem is this PR solving?
Short description of the changes