dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.28k stars 520 forks source link

Use executable results in EventPipe error #173

Open flcdrg opened 4 years ago

flcdrg commented 4 years ago

Describe the bug

If I use executable instead of project then a debug error is logged that the event pipe session start failed. If I use project pointing at the same project (instead of the exe) then it runs without the debug error

To Reproduce

  1. Edit the single-project tye.yaml file to contain the following
    
    # tye application configuration file
    # read all about it at https://github.com/dotnet/tye
    name: single-project
    services:
C:\dev\github\tye\artifacts\bin\tye\Debug\netcoreapp3.1\tye.exe run
[15:01:49 INF] Executing application from C:\dev\github\tye\samples\single-project\tye.yaml
[15:01:49 INF] Dashboard running on http://127.0.0.1:8000
[15:01:49 INF] Launching service test-project2_c55a79e8-7: test-project/bin/Debug/netcoreapp3.1/test-project.exe
[15:01:49 INF] test-project2_c55a79e8-7 running on process id 22788 bound to http://localhost:50796
[15:01:50 INF] Listening for event pipe events for test-project2_c55a79e8-7 on process id 22788
[15:01:50 DBG] Failed to start the event pipe session
Microsoft.Diagnostics.NETCore.Client.ServerErrorException: EventPipe session start failed (HRESULT: 0x80131384)
   at Microsoft.Diagnostics.NETCore.Client.EventPipeSession..ctor(Int32 processId, IEnumerable`1 providers, Boolean requ
estRundown, Int32 circularBufferMB)
   at Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient.StartEventPipeSession(IEnumerable`1 providers, Boolean requ
estRundown, Int32 circularBufferMB)
   at Microsoft.Tye.Hosting.Diagnostics.DiagnosticsCollector.ProcessEvents(String applicationName, String serviceName, I
nt32 processId, String replicaName, IDictionary`2 metrics, CancellationToken cancellationToken) in C:\dev\github\tye\src
\Microsoft.Tye.Hosting.Diagnostics\DiagnosticsCollector.cs:line 198
[15:01:50 INF] Event pipe collection completed for test-project2_c55a79e8-7 on process id 22788

Further technical details

0.1.0-dev Windows

rynowak commented 4 years ago

Here's a question - do you want to be able to collect eventpipe/metrics for arbitrary .NET executables?

We should definitely fix this error. The question is relevant, because eventpipe is available in any .NET process >= 3.0. So presumably if there are random executables you want to run, and they are .NET - then we can also collect their metrics.

flcdrg commented 4 years ago

I think I would