-
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
feat: introduce metrics based on system diagnostics #84
feat: introduce metrics based on system diagnostics #84
Conversation
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Thank you for the PR. Please format the code based on the project's rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. There are some changes to make.
May I ask to add:
- some test
- an example inside the directory examples with a project ?
Yup I will add tests when I get some bandwidth |
@Gsantomaggio : About the test stack you use, is there any entry point that i can read to make it work loccaly ? Or there is just the code ? Do you have consider to use things like TestContainer that reduce the burden to have a local manual setup and keep the thing under test fixture control ? |
@aygalinc, to run the tests, please refer to the following:
We use the same way to test all the clients. We have yet to consider TestContainer. Thank you |
@Gsantomaggio : i have had one test to check the test stack you use. Testing consumer is pretty cumbersome because metrics records happened after consumer is invoked and their is not mean to directly wait that the consumer register metrics before going to the assert part. I need to check the doc to be able to run this test in parallel, I think i cannot use the static factory pattern of the metrics because it impacts all the test suite so result will not be very consistent. => I work on macos and the sh script fails (but i make it work by commenting some part). |
There is some problem with the TLS test on mac. So you can skip them. Don't worry.
Feel free to add some dependency on the thank you |
27244f7
to
1ca625e
Compare
6f82dc7
to
bb4e334
Compare
@Gsantomaggio : i have add some tests for publisher and consumer metrics. |
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@aygalinc CI is finally green. :) Thank you! I will do some tests. |
@Gsantomaggio : I want to add the MetricsReporter available in the public API for dotnet 8 in order to have one impleme that impelment OTEL guidelines and so a MetricReporter that throw not implemented exception for lower version or that extend the NoOp implem. |
It is ok with me. |
@aygalinc I am working to resolve the conflicts. |
@aygalinc Ok, done. The branch is merged with Notes:
Request:
Thank you for your effort on this PR. |
@lukebakken thx. I have add an issue yesterday in sem conv repo to have an explanation on this : open-telemetry/semantic-conventions#1575 |
Yep, I plan on using the same metrics and naming as the Java client (https://github.com/rabbitmq/rabbitmq-amqp-java-client/blob/main/src/main/java/com/rabbitmq/client/amqp/metrics/MicrometerMetricsCollector.java) |
The only issue with the design in npgsql is the fact that all is static in the MetricReporter so poorly testable. I think this is due to the fact that they release it in .net version 7 where IMeterFactory was not available. |
OK I'll take that into consideration. I don't expect users of this library to have to configure an IMeterFactory implementation, however. |
@aygalinc thank you for the sample application - it makes configuring all of this much more obvious. Would it be possible to add a metrics summary output? If you'd like to point me in the right direction, that would be great. UPDATE - I will try this tomorrow: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics-collection#view-metrics-with-dotnet-counters |
@lukebakken Where do you want have the summary ? |
Interesting, how did you get that summary? I was thinking of having that information (or similar) printed out at the end of the demo program's run. I haven't had time yet to try out the |
Ah! I just didn't let it run long enough 🤦 |
* Fix metrics tests
For reference: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/ @aygalinc I'm not exactly sure if OTel attributes should be added in this PR, or in a similar manner to what the AMQP 0.9.1 .NET client does (https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1717/files, https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/projects/RabbitMQ.Client/Impl/RabbitMQActivitySource.cs). I think I'll wrap up this PR without any tags or OTel attributes, and we can add those in another PR. How about that? |
Seems more than reasonable |
@lukebakken I think it is the usage in your histogram to use seconds instead of ms. Do you want to stay on ms for histogram ? |
Thanks for pointing that out. Seems like you'd want to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aygalinc thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @aygalinc @lukebakken!
Thanks a lot for your effort @aygalinc in this PR
Hello !
Here is the start of a PR for : #58
Here is the try to implement the metrics reporting scope on message publishing counter to see if it cope to the thing you have planned.
I have base the impl of system diagnostic metric reporter on the one available on Npgsql : https://github.com/npgsql/npgsql/blob/main/src/Npgsql/MetricsReporter.cs
I m not sure on why you need the NoOpImplem and where the reporter should be instanciated.