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: add kafkajs instrumentation #3786

Merged
merged 68 commits into from
Mar 12, 2024
Merged

Conversation

david-luna
Copy link
Member

@david-luna david-luna commented Dec 12, 2023

PR to add kafkajs instrumentation. Summary of additions

  • instrument send& sendBatch methods of kafkajs producers

    • creating a spans if apply (topic not ignored by config)
    • propagating traceparent info into message headers
  • instruments eachMessage of kafkajs consumers

    • creating a transaction if apply (topic not ignored by config)
    • setting the trace_id if traceparent present in message headers
  • instruments eachBatch of kafkajs consumers

    • creating a transaction if apply (topic not ignored by config)
    • setting the transaction links if traceparent present in message headers

Closes: #2905

Checklist

  • Implement code
  • Add tests
  • Update TypeScript typings
  • Update documentation
  • Add CHANGELOG.asciidoc entry
  • Commit message follows commit guidelines

@david-luna david-luna requested a review from trentm December 12, 2023 19:22
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Dec 12, 2023
Copy link
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

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

This is great. I am sorry for taking so long to review.

@david-luna david-luna requested a review from trentm February 14, 2024 17:38
Copy link
Member Author

@david-luna david-luna left a comment

Choose a reason for hiding this comment

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

/test tav kafkajs

trentm
trentm previously approved these changes Feb 14, 2024
Copy link
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

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

A couple of nits.

@david-luna david-luna requested a review from trentm February 15, 2024 16:50
@oleh-kravchuk
Copy link

@david-luna @trentm

I see that this MR is already at the final stage, isn't it?

Thanks for your efforts for shipping such a valuable changes.
We look forward to use native kafkajs instrumentation on our side ;-)

@david-luna david-luna requested a review from trentm March 7, 2024 20:04
@david-luna
Copy link
Member Author

@trentm I've also updated the test expectations for the latest changes in span names. Now tests are green :)

Copy link
Member Author

@david-luna david-luna left a comment

Choose a reason for hiding this comment

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

/test tav kafkajs

Copy link
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

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

Awesome. Nice work.

@trentm trentm merged commit 489fc50 into main Mar 12, 2024
18 checks passed
@trentm trentm deleted the dluna/2905-feat-kafkajs-instrumentation branch March 12, 2024 22:22
PeterEinberger pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Support for KafkaJS publishers and consumers
5 participants