fullstackhero / dotnet-starter-kit

Production Grade Cloud-Ready .NET 8 Starter Kit (Web API + Blazor Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
https://fullstackhero.net/dotnet-webapi-boilerplate/
MIT License
5.18k stars 1.56k forks source link

[BUG] [V2] Open Telemetry doesn't work in Containers #964

Closed iammukeshm closed 2 months ago

iammukeshm commented 3 months ago

Describe the bug OTEL Works fine when the .NET API is running directly on host, and the OTEL related instances (grafana, prometheus, node exporter, otel) are on docker containers. But when I run the .NET API also in Docker containers, no metrics are exported.

To Reproduce Steps to reproduce the behavior:

  1. Go to './compose/'
  2. Run docker compose up -d
  3. Metrics are not exported
maxiar commented 2 months ago

Hi! @iammukeshm I'm working on this bug. I've a beta version, added aspnet dashboards, node exporter, jaeger, loki, etc to the current OTPL implementation.. When I finish, I will make a PR from this fork: https://github.com/maxiar/dotnet-starter-kit/tree/open_telemetric_and_docker_fixes

Now, It's working fine:

image image

But... I see that in the current implementaion, only the prometheous metrics are working... no logs or traces are exposed using OTPL exporter. I checking the otel-collector logs and no erros was found.. It seems like the webapi does not publish traces or logs, even though it is enabled by setting the environment variable: OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317 I browse the source code, and all appears fine. Also I check the Aspire Dashboard algo but no log or traces.

Any Idea? Did you see logs and traces?

UPDATED 07/08/24: Forgot it, I already fixed in the PR. Some fixes was added.

Thanks!

maxiar commented 2 months ago

this bug can be closed :)