-
Notifications
You must be signed in to change notification settings - Fork 39
feat: added support for @confluentinc/kafka-javascript #2221
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
Conversation
b494aa5 to
702163b
Compare
refs #2221 - we had no esm app for the Otel integration - proofed that it works
50edd3c to
f955561
Compare
11640e5 to
81080d1
Compare
refs #2221 - global agent defined once - some more helpful logs - oracledb needs sometimes longer on CI to connect to the sidecar - better cleanup
81080d1 to
00d4ab3
Compare
refs https://jsw.ibm.com/browse/INSTA-66145 - added a single place to prepare the otel data - extracted from feat: added support for @confluentinc/kafka-javascript #2221 to improve readability on feat: added support for @confluentinc/kafka-javascript #2221 - reordered and regrouped code - no functional changes!
00d4ab3 to
af6e9ae
Compare
| * | ||
| * Trace correlation does not work with socket.io, because they do not support | ||
| * headers or meta data, only payload. | ||
| * headers or meta data, only payload! |
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.
We did not had support yet for Exit/Entry or Entry/Exit correlation in our integration.
Will re-investigate socket.io via https://jsw.ibm.com/browse/INSTA-70626
| * - manipulate the returned context of `setSpan` with our ids | ||
| * - the Otel span will be cleaned up automatically from Otel SDK | ||
| */ | ||
| module.exports.setW3CTraceContext = (api, preparedData, otelSpan, instanaSpan, originalCtx) => { |
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.
setW3CTraceContext and extractW3CTraceContext can be moved to general utility as soon as we have a second case. This is general logic.
packages/core/src/tracing/opentelemetry-instrumentations/confluent-kafka.js
Outdated
Show resolved
Hide resolved
aryamohanan
left a comment
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 really great work 🎖️
I’ve completed my first round of review and will do some testing, then come back with any further feedback.
Thanks for taking care of this Kate ❤️
packages/collector/test/tracing/opentelemetry/confluent-kafka-consumer-app.js
Outdated
Show resolved
Hide resolved
packages/collector/test/tracing/opentelemetry/confluent-kafka-consumer-app.mjs
Outdated
Show resolved
Hide resolved
packages/collector/test/tracing/opentelemetry/confluent-kafka-producer-app.mjs
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,149 @@ | |||
| /* | |||
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.
suggestion:
It would be good to have a dedicated folder under opentelemetry, for example confluent-kafka/consumer-app.js, to better organize these files. This structure would improve clarity and maintainability.
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.
Yeah, we will create a better structure via https://jsw.ibm.com/browse/INSTA-70618
| let sampled = true; | ||
| const spanContext = otelSpan.spanContext(); | ||
|
|
||
| if (spanContext?.traceFlags !== undefined) { |
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.
It would be good to add some unit test coverage for this file. Normally, TraceFlags should contain a value, right? so having tests would help identify the behavior.
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.
These lines are auto-tested, but I will check the coverage again 👍
7f407dc to
1e12ff8
Compare
aryamohanan
left a comment
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.
❤️
That is wrong, but I understand why this happens: We install core + collector as zips into the target otel folder. The lines are not counted. |
|
Try to fix via sonar config |
abhilash-sivan
left a comment
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.
Super
|
Sonar is not fixed yet. Raised https://jsw.ibm.com/browse/INSTA-70905 |
4369a71 to
32533f8
Compare
Co-authored-by: Arya <[email protected]>
32533f8 to
13063f9
Compare
|


refs https://jsw.ibm.com/browse/INSTA-66145
Description
Added support for @confluentinc/kafka-javascript including full correlation across multiple processes.
Initially inspired by a community Otel instrumentation, but the instrumentation was not finished and lacked support of various features.
Forked into https://github.com/instana/instrumentation-confluent-kafka-javascript and added:
Tasks
@confluentinc/kafka-javascriptworks out of the box, because we have support for kafkajs and rdkafka [does not work] - see https://github.com/confluentinc/confluent-kafka-javascript/blob/master/LICENSE.kafkajshttp://127.0.0.1:${process.env.INSTANA_AGENT_PORT}/ping);Post Release
https://jsw.ibm.com/browse/INSTA-70616