pulsar
pulsar copied to clipboard
[improve] [pip] PIP-363: Add callback parameters to the method: org.apache.pulsar.client.impl.SendCallback.sendComplete.
Motivation
As introduced in PIP-264, Pulsar has been fully integrated into the OpenTelemetry system, which defines some metric specifications for messaging systems.
In the current Pulsar client code, it is not possible to obtain the number of messages sent in batches(as well as some other sending data), making it impossible to implement messaging.publish.messages metric.
In the opentelemetry-java-instrumentation code, the org.apache.pulsar.client.impl.SendCallback interface is used to instrument data points. For specific implementation details, we can refer to this.
In the current situation, org.apache.pulsar.client.impl.ProducerImpl does not provide a public method to obtain the numMessagesInBatch.
So, we can add some of org.apache.pulsar.client.impl.ProducerImpl.OpSendMsg's key data into the org.apache.pulsar.client.impl.SendCallback.sendComplete method.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Matching PR in forked repository
PR in forked repository:
+1
@lhotari Do you have any suggestions?
@lhotari @Technoboy- Could you please vote here? Thank you.
The vote has passed with 3 binding +1s. https://lists.apache.org/thread/t0olt3722j17gjtdxqqsl3cpy104ogpr
@RobertIndie @BewareMyPower Could you please approve and merge this PR?