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

feat(otel-node): add @opentelemetry/instrumentation-kafkajs #570

Merged
merged 10 commits into from
Jan 29, 2025

Conversation

david-luna
Copy link
Member

Closes: #235

@david-luna david-luna requested a review from trentm January 28, 2025 14:29
// span 199d7e "manual-parent-span" (3.4ms, SPAN_KIND_INTERNAL)
// -3ms `- span 2da778 "edot-test-topic" (19.6ms, SPAN_KIND_PRODUCER)
// +1ms `- span 6d088b "edot-test-topic" (19.4ms, SPAN_KIND_PRODUCER)
// TODO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this "TODO" be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

* under the License.
*/

// Usage: node -r @elastic/opentelemetry-node use-kafkajs.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// Usage: node -r @elastic/opentelemetry-node use-kafkajs.js
// Usage: node --env-file ../test-services.env -r @elastic/opentelemetry-node use-kafkajs.js

Perhaps add this, because the KAFKA_HOST setting is needed for this to work locally.
Eventually we could add the same --env-file ... usage to the other fixtures, but that is low priority.

Comment on lines 40 to 41
// ref: https://kafka.js.org/docs/migration-guide-v2.0.0#producer-new-default-partitioner
KAFKAJS_NO_PARTITIONER_WARNING: '1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on moving this to the test-services.env?

Copy link
Member Author

@david-luna david-luna Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't add it to the env file since is not a mandatory config for kafka tests to work. Actually we're not checking the stdout of the fixture within the test so we can remove it.

// ref: https://kafka.js.org/docs/migration-guide-v2.0.0#producer-new-default-partitioner
KAFKAJS_NO_PARTITIONER_WARNING: '1',
// test specific vars
KAFKA_HOST: 'localhost',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove this one from here. It is defined in test-services.env.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

KAFKAJS_NO_PARTITIONER_WARNING: '1',
// test specific vars
KAFKA_HOST: 'localhost',
KAFKAJS_TOPIC: 'edot-test-topic',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we prefix this with TEST_? E.g. the same as is done for TEST_ENDPOINT and TEST_REGION for the aws-sdk fixtures.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also yes

@david-luna david-luna merged commit 9121984 into main Jan 29, 2025
12 checks passed
@david-luna david-luna deleted the 235-instr-kafka branch January 29, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add instr-kafkajs
2 participants