Open Kralizek opened 4 years ago
Hi @Kralizek Thanks for providing details of the issue and the steps to reproduce it. We will prioritize to investigate this shortly.
Hey @Kralizek
What I see from the tye.yaml
and the attached log, is that you're setting the env var AWS_XRAY_DAEMON_ADDRESS to the string xray-daemon:2000
whereas you should set it to the actual address of the daemon like 0.0.0.0:2000
as you have it in your dockerfile.
Could you try this and let me know if it works?
Thanks!
I'll try it straight away.
Wow! That was fast! :D
@srprash It didn't work :(
[webapi_d466b2cb-f]:C:\Users\Renato\Development\Tests\ToDoList\src\entrypoints\WebAPI\bin\Debug\net5.0\WebAPI.exe
[webapi_d466b2cb-f]: RuntimePipelineCustomizerRegistry 1|2020-11-12T22:33:25.108Z|INFO|Registering runtime pipeline customizer X-Ray Registration Customization
[webapi_d466b2cb-f]: info: Microsoft.Hosting.Lifetime[0]
[webapi_d466b2cb-f]: Now listening on: https://localhost:54654
[webapi_d466b2cb-f]: info: Microsoft.Hosting.Lifetime[0]
[webapi_d466b2cb-f]: Application started. Press Ctrl+C to shut down.
[webapi_d466b2cb-f]: info: Microsoft.Hosting.Lifetime[0]
[webapi_d466b2cb-f]: Hosting environment: Development
[webapi_d466b2cb-f]: info: Microsoft.Hosting.Lifetime[0]
[webapi_d466b2cb-f]: Content root path: C:\Users\Renato\Development\Tests\ToDoList\src\entrypoints\WebAPI
[webapi_d466b2cb-f]: info: WebAPI.Controllers.ToDoController[0]
[webapi_d466b2cb-f]: Fetching all items
[webapi_d466b2cb-f]: info: System.Net.Http.HttpClient.ToDoClient.LogicalHandler[100]
[webapi_d466b2cb-f]: Start processing HTTP request POST https://localhost:23123/toDo.ToDo/List
[webapi_d466b2cb-f]: info: System.Net.Http.HttpClient.ToDoClient.ClientHandler[100]
[webapi_d466b2cb-f]: Sending HTTP request POST https://localhost:23123/toDo.ToDo/List
[webapi_d466b2cb-f]: info: System.Net.Http.HttpClient.ToDoClient.ClientHandler[101]
[webapi_d466b2cb-f]: Received HTTP response headers after 249.5895ms - 200
[webapi_d466b2cb-f]: info: System.Net.Http.HttpClient.ToDoClient.LogicalHandler[101]
[webapi_d466b2cb-f]: End processing HTTP request after 262.3015ms - 200
[webapi_d466b2cb-f]: UdpSegmentEmitter 2|2020-11-12T22:33:51.122Z|DEBUG|UDP Segment emitter endpoint: 0.0.0.0:2000.
[webapi_d466b2cb-f]: UdpSegmentEmitter 3|2020-11-12T22:33:51.123Z|ERROR|Failed to send package through socket. --> System.Net.Sockets.SocketException (10049): The requested address is not valid in its context.
[webapi_d466b2cb-f]: at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
[webapi_d466b2cb-f]: at System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)
[webapi_d466b2cb-f]: at System.Net.Sockets.UdpClient.Send(Byte[] dgram, Int32 bytes, IPEndPoint endPoint)
[webapi_d466b2cb-f]: at Amazon.XRay.Recorder.Core.Internal.Emitters.UdpSegmentEmitter.Send(Entity segment)
Sorry. I think I misunderstood it since I don't really know how exactly dotnet tye deploys application to containers. But what you really need to do is, set the AWS_XRAY_DAEMON_ADDRESS to the container host address of the xray daemon container and port to 2000 since that's what daemon listens on.
I'll read more about dotnet tye and give this a try.
@srprash Allow me this shameless plug to the blog post I just posted about it!
https://renatogolia.com/2020/11/12/developing-distributed-applications-with-tye/
@Kralizek Thanks for sharing the blog. It's a good learning for me.
FWIU from this section, in order to let your services discover the xray-daemon
, you'd need to do some bindings to expose the daemon address. Then within your application you can programmatically build the AWSXRayRecorder
with this address by doing something like this:
var recorder = new AWSXRayRecorderBuilder().WithDaemonAddress(xrayDaemonAddressString).Build();
AWSXRayRecorder.InitializeInstance(configuration, recorder);
Hi @srprash My intention was to use the default port 2000 for the daemon, but I'll try using a custom port to see if it solves the issue.
I am unable to reach the daemon hosted in a contain from another container.
If I set AWS_XRAY_DAEMON_ADDRESS to xray-daemon:2000, I get this:
I thought of a problem of networking, so I got into one of the application containers and pinged the
xray-daemon
hostname, but it works as expected:You can see the whole application here: https://github.com/Kralizek/ToDoList
Steps to reproduce:
tye.yml
line 56 to point to correct.aws
foldertodo
to fetch AWS credentialsdotnet tool restore
dotnet tye run
localhost:8080
(web application)localhost:8000
(Tye dashboard)