-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Add diagnostics to batching #1
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
@lmolkova I need your help 😊
The issue I'm running into is how |
@SeanFeldman diagnosticsource stamps ids for correlaiton on all messages, so that any consumer that will receive any message can correlate telemtery to the producer. So it has to operate on all messages and the same messages should be sent i.e. it should not modify the copy which never leaves process. There is another option we are considering to better support batching scenarios, which is to stamp the message when it's created, not when it is sent. We've been planning to work on this in late Ti, but have not finalized dates yet. Could we follow this approach:
|
Not quite. The problem at hand is different though. When batch is constructed, we don't know what messages are going to make it into batch and which will not. Messages that make it are converted into AMQP messages and cannot be modified anymore. Here's a pseudo code to elaborate. var batch = messageSender.CreateBatch();
// message added as batch size is less than allowed maximum batch size; returns true
batch.TryAdd(message1);
// message added; returns true
batch.TryAdd(message2);
// message not added as it would cause batch to exceed max size; returns false
batch.TryAdd(message3); To determine if a batch has reached its maximum or not, Service Bus behind the scenes what happens is:
therefore once a ServiceBus
Sounds like that approach would work as it won't require to have all messages in order to stamp those as a group. That is assuming the scenario described above would work. |
3987a55
to
d3dbe9b
Compare
@SeanFeldman so batching is a NEW API, right? Does anything changes for users which use current If it's a new API, I think it's reasonable to have this API first without automagical propagation. I'll discuss it offline with the team and we'll try to prioritize work on batching diagnostics support. We'll also try to provide some guidance on steps users should take to enable correlation manually. |
@lmolkova correct. This is a brand new API proposed here.
👍
That would be fantastic. |
I guess this is a good approach. |
@nemakam good question. It seems that adding a message is not a real activity - it does not have a duration and result. What we actually need is to assign a unique Id that will be propagated along with the message and make sure it has proper tracing context (for correlation with other related telemetry). Perhaps if TryAdd to back was not successful, we should not even generate such id and stamp it on the message. We'll need to figure it out once we start working on the batching. |
Sure. Just something to keep in mind. |
Adding extra info to identify why the test is failing on full framework
d3dbe9b
to
c1d69c4
Compare
5a67d61
to
323d7cd
Compare
6881442
to
e65d444
Compare
Adding diagnostics to batching branch to see how this would work.