-
Notifications
You must be signed in to change notification settings - Fork 2
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
Marking private classes as public would provide an easier time creating custom Probe types #162
Comments
what kind of custom probe do you want to write? I think just opening up the types wouldn't be enough to ensure proper integration they would also need to be added the the
btw. the primary intention was for metrics reporting implementations to be able to depend properly on the feature to ensure the correct startup order. |
You're correct. I did have to create a new ProbeContext object to accommodate my custom one. I want a custom probe containing the duration and message body. |
have you tried to implement this using a custom behavior instead? This might be a much simpler way of implementing something like this, as access to the message body is easily possible too. |
I did try a custom behavior, but it wasn't what I wanted. I wanted the ability to fire and forget the event to the probe listener without incurring any further message processing time. |
Thanks for sharing some more details on your usage scenario. I'm not sure the package was designed to be extensible in such ways but I'll forward this as a feature request to our internal backlog for further prioritization. |
Issue
In the current version of NServiceBus.Metrics the Metrics feature, Probe class, and ProbePropertiesAttribute are closed off from public consumption. In a previous PR the Metrics feature was opened up allowing for public consumption and allowing other features to depend on its availability. However, the Probe and ProbePropertiesAttribute classes are still closed off.
Solution
What would be great is having the Probe class and ProbePropertiesAttribute class marked public as well. This would enable custom probe types to be registered in a feature which depends on the MetricsFeature.
I've had to essentially rebuild this package in my own project because I wanted to be able to register a probe that would contain the processing time and the LogicalMessage object. Was able to reuse the IProbe interface and inherit from ProbeContext to manage a small amount of compatibility. Had to rewrite everything else. Opening up the Probe class would allow me to inherit from it and same idea for the ProbePropertiesAttribute class. The implementation of OpenProbeProperties in the example below is exactly the same as ProbeProperties along with a custom Probe class I named OpenProbe.
Example of some code I have using the (once published) Metrics Feature:
The text was updated successfully, but these errors were encountered: