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 521 forks source link

Azure Functions with Seq/Zipkin Extensions #979

Open fudgeboy2000 opened 3 years ago

fudgeboy2000 commented 3 years ago

Hi there, really excited about Tye and how slick it makes local development, particularly around light orchestration of logical microservices. Improves the development experience a lot.

We have a heavy investment in Azure Functions (HTTP triggers, queues, some Durable) as opposed to asp.net REST APIs. Tye already works well with the azureFunction service type in tye.yaml, but I was wondering if anyone had any experience with use of Functions and the Seq and Zipkin extensions. The ease of adding these for local development is a killer feature for traditional REST APIs, but doesn't appear to work as automagically for functions. I haven't found a way of plugging them in at all so far via host.json, local.settings.json or in the tye.yaml file.

TIA for any information!

jkotalik commented 3 years ago

Hm, this seems like potentially a bug. I don't explicitly remember testing azureFunctions + zipkin. What errors are you seeing? Do you see it just not work in general?

This seems like a small bug where we probably forget to check for azureFunction in a place where service should be used.

fudgeboy2000 commented 3 years ago

I'm not seeing any errors at all - just no trace/log info generated once the Function is executing. I did create a small demo project around this which had a Blazor Server app calling a REST API which itself called a Function. The trace/log just stops when execution leaves the API. I did have Activity.DefaultIdFormat = ActivityIdFormat.W3C; in all three projects.

I can dig the code out if it would help?

jkotalik commented 3 years ago

Yeah that would help.

fudgeboy2000 commented 3 years ago

https://github.com/fudgeboy2000/TyeFunctions

I've pushed the demo code up to a public repo. It's just a sequence of HTTP posts, Blazor -> REST -> Function with tye.yaml in the root. tye run, go to the blazor index page, push the button. You can see the log entry coming from the Function in the logs page, but no corresponding entry in Seq and the trace ends at the REST Api.