-
Notifications
You must be signed in to change notification settings - Fork 113
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
Live metrics and collection rules don't work when also application also exporting Prometheus metrics #6937
Comments
Hi @jwreford99, hopefully I can help get you unblocked! What you're describing definitely does sound like it should be possible, so hopefully it's just an issue related to configuration/setup and not a bug in dotnet-monitor. For starters, I ran your sample locally, and also wasn't getting any metrics back - which was surprising, because my personal sample was working right before that with metrics/live metrics/collection rules simultaneously. I did some preliminary debugging, and I think I uncovered at least part of the problem - in your configuration for
Internally, If you can, give this a try and see if it does anything for you - if you still have more issues, let me know and we can dig further into what's going on 😄 |
@kkeirstead you absolute legend! Thanks so much, this is now working for me 😄 Potentially a thick question! |
Hi. I am using a collection rule with |
Glad to hear that worked! To answer your first question - I only knew that by debugging through |
Thanks @kkeirstead, given you have answered my question and fixed the issue for me I will close this off now, but I agree it would definitely be a nice QOL improvement for dotnet monitor to emit some logging to indicate this problem. Thanks again, your team is great and always so speedy and helpful 😄 |
Description
I have been having a real head scratcher with regards to getting basic metrics out of dotnet monitor. There is a potential this is expected behaviour, but I would love to know what I can do if this is expected behaviour, so would be very appreciative of any response 😄
I setup a simple collection rule against our application, which should have triggered when a very low memory limit was breached, however, even when the memory is much higher than the threshold for a sustained period the collection rule never fired. I then tried hitting the
livemetrics
endpoint and was getting no response (200 OK, but no content).I then tried asking for a specific meter with the request:
and started seeing the error
Another metrics collection session is already in progress for the target process
. This was the first time I saw an actual error in the logs, otherwise it was all normal log messagesI have managed to get a minimal reproduction by spinning up https://github.com/djluck/prometheus-net.DotNetRuntime. Specifically, just doing
DotNetRuntimeStatsBuilder.Customize().StartCollecting()
seems to cause bothlivemetrics
endpoint to come back empty and the collection rules not to work.The application code at it's simplest is:
example.txt
With the deployment to kubernetes looking like:
example-deployment.txt
My expectation would be:
Configuration
Dotnet monitor version 8 running on x64 in a kubernetes cluster.
Monitoring a simple application which exposes metrics as Prometheus
Regression?
I did check this against version 7 and it seems to be the same
Other information
Another metrics collection session is already in progress for the target process.\nConcurrent sessions are not supported."
Obvious workaround would be to stop reporting to Prometheus via this method but I would really like to avoid having to change that 😅 !
The text was updated successfully, but these errors were encountered: