Skip to content

support per-record observations in batch listeners #3944

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

igormq
Copy link

@igormq igormq commented Jun 4, 2025

Don't know if i am doing the right approach here, but.

  • support per-record observations in batch listeners
  • document recordObservationsInBatch container property
  • describe new option in the change history
  • add integration test for per-record observations

Related to #3872 (comment)

@igormq igormq force-pushed the codex/fix-issue-with-kafka-header-extraction branch 2 times, most recently from 351e874 to 46a21b6 Compare June 4, 2025 16:31
@sobychacko
Copy link
Contributor

@igormq Thank you for the PR. We will do a detailed review soon. But, please add your name as an author to the classes you modified. Also, make the modifications in the ref docs directly and then add a short sentence about it in the whats-new doc. The change history is only for previous versions. Thanks!

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Thank you for looking into this!
Not easy task to tackle.
Hope you'll find my review as reasonable.

@sobychacko
Copy link
Contributor

@igormq Thank you for this PR. Implementing observability with batch listeners is not trivial, and I think you laid good foundations here. Providing this as an optional feature is very important, as we don't want to impose observability by default in all batch listeners. Please take a look at some of the feedback I provided, which largely echoes what @artembilan has already reviewed. As you make further changes, we will need to add docs and other related components, but getting the implementation right is the critical step right now. Thanks again!

@igormq
Copy link
Author

igormq commented Jun 7, 2025

@igormq Thank you for this PR. Implementing observability with batch listeners is not trivial, and I think you laid good foundations here. Providing this as an optional feature is very important, as we don't want to impose observability by default in all batch listeners. Please take a look at some of the feedback I provided, which largely echoes what @artembilan has already reviewed. As you make further changes, we will need to add docs and other related components, but getting the implementation right is the critical step right now. Thanks again!

Hey @sobychacko and @artembilan thank you so much for all the feedback, really appreciate! I think that i addressed all of them. Let me know if I am missing something :)

@igormq igormq requested review from artembilan and sobychacko June 10, 2025 10:53
Copy link
Contributor

@sobychacko sobychacko left a comment

Choose a reason for hiding this comment

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

@igormq Code changes look good. Now, we need to add reference docs with instructions on enabling observability in batch mode, maybe some examples etc. Then we need to mention this new feature in the whats-new doc.

@igormq igormq force-pushed the codex/fix-issue-with-kafka-header-extraction branch 3 times, most recently from 7f45017 to e32b309 Compare June 11, 2025 11:37
@igormq
Copy link
Author

igormq commented Jun 11, 2025

Now, we need to add reference docs with instructions on enabling observability in batch mode, maybe some examples et

done that, and also fixed the check style issues

@igormq igormq requested a review from sobychacko June 11, 2025 11:37
batch, similar to a record listener.
This allows you to have visibility into the processing of each record, even within a
batch context.
No spans will be created for the batch itself, only for each record.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if you broke something with your change, but we have to revise that an observation is really created for the whole batch around that listener method call.
If that was not supported at all, then it is OK.

Signed-off-by: Igor Macedo Quintanilha <igor.quintanilha@teya.com>
@igormq igormq force-pushed the codex/fix-issue-with-kafka-header-extraction branch from a50c3c9 to a4251a9 Compare June 11, 2025 16:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants