-
Notifications
You must be signed in to change notification settings - Fork 604
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
Add remote profile example based on httpclient #344
base: main
Are you sure you want to change the base?
Conversation
Hey @NickCraver did you had a chance to have a look at this? |
Hey @ilmax! Sorry a few crazy days here pouring concrete and prepping a big blog post. I did a cursory glance - setup looks good but I'd change how we match up the 2 ends to be much simpler. For example a |
Hey @NickCraver, no problem :) Looking forward to the post! |
For example, instead of: MiniProfiler.Current.Step($"RemoteStep:{request.RequestUri.GetLeftPart(UriPartial.Authority)}:{s.Single()}") You can... var step = MiniProfiler.Current.Step("RemoteStep: " + request.RequestUri.GetLeftPart(UriPartial.Authority))
step.Id = Guid.Parse(s.Single()); ...then in the matching, we're not doing any string parsing :) |
@NickCraver I've changed it to follow your guideline, I've left the remote host in the step name, because it might be useful when you do remote calls to multiple hosts. Let me know if this looks good to you! |
Alrighty, finally got a chance to load this up tonight. I think we can simplify here greatly, and trim the example way down. In short: though we want to call a remote API, for the purposes of the example there need not be 2 apps...one app can call itself (at a different relative path). It also simplified the fetch of the code because it can be from the same store as intended. In production this would be Redis or SQL or whatever, but here it's in-memory and the example holds (we can just add comments there). The single app example also makes it much easier for people to see in action, e.g. F5 launches from Visual Studio work. I'm happy to make the simplifications here, but also don't want to step on toes - what do you think? |
Hey @NickCraver, I think going to single application approach it's a good idea! You can take over this or I can do it after the weekend. Whatever you like! |
Add a complete end to end sample to demonstrate how to integrate a remote profiling session in MiniProfiler.
This sample uses httpclient to make a remote call and, in the remote service EF Core to query a dB, so the goal is to be able to get the all the remote profiling information and include them in the profiler tree
/cc @NickCraver