-
Notifications
You must be signed in to change notification settings - Fork 78
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
Metric support #333
Comments
hello, So I was thinking about adding these at some point via the OTEL. See #149. Happy to accept a PR if you want to help. For now one could add a generic consumer interceptor that would measure the consumer processing time and log using your favorite telemetry platform. Also some of the underlying client libraries each transport use have their own (but yes, better if SMB abstracts it all under one unified model). Let me know your thoughts. |
I have done that via the generic interceptor, but the issue is that by the time it hits the interceptor, some processing has already occurred. I.e, its already been desterilized which means that time wont be included. I will take a look at #149 :) |
Just copying this question over to this ticket: Is there any way to see/monitor the count of messages on the in memory bus? (might be another example of a good metric to log) We have a process that reads a lot of data and places it onto an in memory bus to be processed. It would be nice to be able to see/monitor that in memory bus |
Yes, that's another good metric that should be logged. For now you could either turn on more verbose logging and then count the lifecycle log events that are indicative of counts (not great, but possible). Add an generic interceptor as explained above and increment the counter for your metric platform, but you have that already. Either way, we need to capture metrics (new feature). I belive we could use OTEL as the abstraction. |
We are using a Hybrid bus, so both in memory and external. I understand for the in memory bus the messages don't go via serialization, but they do for the external buses. OTEL would work for us, but I am wondering, just from a design point of via, could it somehow be abstracted like what you have done for the transports and serialization. For example, and don't get caught up on the names or signatures I use here, they are just used to illustrate the point.
That way you can added in OTELMetric or extend it to support whatever platform is required |
Yes, that's what I was thinking too. OTEL isn't a clean abstraction (we have to drag in libraries into the SlimMessageBus.Host) in itself a clean interface would address my concern. However, OTEL has become a standard that many platforms use nowadays, and I believe users of SMB would expect to just connect it to Prometheus/Grafana/Azure App Insights and it simply working.
Yes, maybe the path would be SMB > SMBs abstraction (the interface above as suggested) > OTEL plugin (optional). I will think about it. Again, please voice your needs and opinions. Feedback is much appreciated. |
Reading some more about metrics instrumentation it seems that nowadays the best and modern way to add metrics to .net apps is via System.Diagnostics.DiagnosticSource. It is a good and performant abstraction with OTEL in mind and tools like Prometheus and Grafana can collect the metrics. I will give it a try. |
If it helps, this is what i was playing around with using the interceptor:
.Net abstraction does come with an OTEL Exporter. We might need to use EMF instead though. I am just investigation on whether we can export the .net abstraction to EMF |
Looking though the code, I wonder if an Then Metrics likes could be captured early on on the process. It would also mean that observability support (regardless of the protocol) would just be plugged in via interceptors. |
Thanks for sharing. The interceptor example you've provided was one of the ways I was looking to implement this, however, exploring if adding this internally (outside of the interceptors pipeline) to make this more efficient. Couple of questions, so let me know your thoughts here:
|
Hey,
|
Are their any plans to introduce metrics, for example the duration of a consumer? I can write an interceptor to do this currently, but I don't thinks its an accurate value as the message has already had consumption logic performed on it, i,e desterilized at this point.
So I think either a hook in point to when the message is first received is required, or build the metrics into SMB
The text was updated successfully, but these errors were encountered: