prom3theu5 / aspirational-manifests

Handle deployments of .NET Aspire AppHost Projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dashboard does not work with docker compose

davidfowl opened this issue Β· comments

πŸ”₯ Bug Description

When using the docker compose output, the dashboard is using the wrong port and applications are uncle to send telemetry to it.

πŸ” Steps to Reproduce the Bug

AppHost:

var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Projects.WebApplication1>("api")
       .WithExternalHttpEndpoints();

builder.Build().Run();

This produces the following compose file:

version: "3.8"
services:
  aspire-dashboard:
    container_name: "aspire-dashboard"
    image: "mcr.microsoft.com/dotnet/nightly/aspire-dashboard:8.0.0-preview.5"
    environment:
      DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS: "true"
    ports:
    - target: 18888
      published: 18888
    - target: 18889
      published: 4317
    restart: unless-stopped
  api:
    container_name: "api"
    image: "api:latest"
    environment:
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
      OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
      ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
      OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:4317"
    ports:
    - target: 8080
      published: 10000
    - target: 8443
      published: 10001
    restart: unless-stopped

🧯 Possible Solution

OTEL_EXPORTER_OTLP_ENDPOINT should be "http://aspire-dashboard:18889".

Thanks @davidfowl
Fix publishing now in v0.6.9-preview

I've also removed exposing port 18889 on the host, no need to as communication will work fine on the internal docker net.