📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

How do you use the Aspire dashboard while developing and debugging? Explain what the resources, console logs, structured logs, traces and metrics views show, how telemetry gets there, how you'd use it to find a slow or failing request across services, and why it isn't a production monitoring tool.

The Aspire dashboard: resources and resource commands, console vs structured logs, traces and span details, metrics, how OTLP telemetry reaches it, the standalone dashboard, telemetry limits and security, and using it to debug cross-service problems.

Mid-Level Theory Intermediate aspire-dashboard cloud-native debugging distributed-tracing dotnet-aspire opentelemetry

🎯 Key points

  • Services export OTLP to the dashboard because the AppHost sets OTEL_EXPORTER_OTLP_ENDPOINT; service defaults add the exporter
  • Resources view: state, health, endpoints, environment variables, and commands such as start, stop and restart
  • Console logs are raw stdout/stderr per resource; structured logs are OpenTelemetry log records with properties, filterable and linked to trace ids
  • Traces view shows a waterfall of spans across services, including database and HTTP client spans, with errors highlighted
  • Metrics view charts instruments such as http.server.request.duration and runtime counters, with filtering by tag
  • Telemetry is held in memory with limits, so it's lost on restart: great for development, not for production retention or alerting
  • The standalone dashboard image (mcr.microsoft.com/dotnet/aspire-dashboard) can receive OTLP from any app; secure it with browser token auth and an OTLP API key
  • Workflow: find the slow or failing trace, inspect the span, jump to its structured logs, then to the resource's details

⏱ 30-second answer

The Aspire dashboard is a local observability UI that the AppHost starts automatically. Each service's OpenTelemetry exporter sends OTLP to it, because the AppHost sets OTEL_EXPORTER_OTLP_ENDPOINT.

  • Resources: state, health, endpoints, environment variables, and start/stop/restart commands.
  • Console logs (raw stdout) and structured logs (properties, linked to trace ids).
  • Traces: a span waterfall across services, database and HTTP calls.
  • Metrics: request duration histograms, runtime counters and your own meters.

To debug, I find the failing or slow trace, open the span, jump to its logs, then check the resource's configuration. Telemetry lives in memory with limits, so it's ideal for development and short-lived test environments, but not a replacement for Application Insights or Grafana in production.

🗣 Full answer (senior)

How I would answer this in an interview

"The dashboard is the part of Aspire people end up using every day. When the AppHost starts, it launches the dashboard and gives every resource an OTEL_EXPORTER_OTLP_ENDPOINT pointing at it, and service defaults add the OTLP exporter, so logs, traces and metrics flow in with no extra set-up. The resources page shows each project and container with its state, health, endpoints and the environment variables Aspire injected, which is the first place I look when something can't connect. I can also stop or restart a single resource from there to test how the others cope.

For debugging I usually start from traces. Say the checkout call is slow: I filter traces by the API resource, sort by duration, and open the slow one. The waterfall shows the API span, the HTTP client span to the pricing service, its server span, and the SQL spans under that, so it's obvious whether the time is in a query, in a retry, or in a gap where nothing is instrumented. From a span I jump to the structured logs for that trace id and see the exception with its properties. Metrics I use for patterns, like the http.server.request.duration histogram during a quick load test, or the thread-pool queue length.

The mistake I see is people treating it as production monitoring because it looks so good. It keeps telemetry in memory with limits, has no alerting and no long-term retention, so it's for development, test runs and short-lived environments. In production the same OpenTelemetry data goes to Application Insights or a Collector. I see the dashboard as a way to make the instrumentation good before production needs it."


The views

View Shows I use it for
Resources State, health, endpoints, env vars, commands, relationships graph Wiring problems, restarting one dependency
Console logs Raw stdout/stderr per resource Start-up crashes, container logs
Structured logs OpenTelemetry log records with properties, level, trace id Filtering errors by property, following one request
Traces Span waterfall across resources Latency and failure location
Metrics Instruments with tag filters and charts Load behaviour, runtime health, custom business metrics

A debugging workflow

Step Where Question it answers
1 Traces, filter by resource, errors or duration Which request failed or was slow?
2 Span details Which service and which call? Status, attributes, exception events
3 Structured logs for that trace What did the code log around it?
4 Resources, env vars Is the wiring or configuration right?
5 Metrics Is this one request or a pattern under load?

Dashboard vs production tooling

Aspire dashboard Application Insights / Grafana stack
Storage In memory, capped Durable, retention policies
Alerting None Alerts, SLOs, action groups
Multi-user, RBAC Token or OpenID Connect sign-in only Full RBAC
Cost Free Ingestion and retention costs
Best for Inner loop, test runs, short-lived environments Production

Production example

A team had a checkout endpoint taking [1.8 s] locally and blamed SQL Server. The dashboard trace showed three sequential HTTP calls to the pricing service per line item, an N+1 across services. Batching them into one call took the endpoint to [220 ms] before the change reached production.

🔍 What the interviewer is checking

Checks whether the candidate uses the dashboard effectively for real debugging and knows its limits.

Green flags

  • Explains how OTLP telemetry reaches the dashboard.
  • Describes a concrete trace-first debugging workflow.
  • Distinguishes console and structured logs.
  • Says clearly it's not production monitoring and why.

Red flags

  • Has only looked at console logs.
  • Thinks the dashboard stores telemetry durably.
  • Logs personal data without concern.

📚 Learn in depth

1. How telemetry reaches the dashboard

Service (OpenTelemetry SDK, via AddServiceDefaults)
   |  OTLP (gRPC or HTTP/protobuf)
   |  endpoint from OTEL_EXPORTER_OTLP_ENDPOINT, auth header from OTEL_EXPORTER_OTLP_HEADERS
   v
Aspire dashboard  --- in-memory stores (logs, spans, metrics) --->  Blazor UI in the browser
   ^
   | resource state, console logs, commands
AppHost (resource service over gRPC)

Telemetry and resource information arrive separately: OTLP from each service, and resource state and console output from the AppHost. That's why the standalone dashboard can show telemetry but not resources.

2. Console logs vs structured logs, and when each matters

Console logs are whatever the process writes to stdout/stderr, captured by the orchestrator, including container output from SQL Server or Redis. They are the right place to look before logging is configured: start-up crashes, missing assemblies, a container that won't start.

Structured logs are ILogger calls exported as OpenTelemetry log records. The message template ("Checked out cart {CartId}") is kept separately from its property values, along with scopes, level, category and the active trace and span id. That's what makes them useful:

  • Searchable: filter CartId = 42 or LogLevel >= Warning across every service at once.
  • Correlated: click a log to open its trace, or filter logs by the trace id of a slow request.
  • Cheap to aggregate: the same template groups thousands of events, which production backends rely on.

To make them useful you have to write them properly: message templates rather than string interpolation, stable property names, LoggerMessage source generators on hot paths, and scopes (BeginScope) for values like tenant-free context such as order id.

3. Traces

Each span carries resource name, timing, status, attributes (http.route, server.address, database spans with the operation and, if enabled, the query text) and events (exceptions). Spans from different services join into one trace because W3C traceparent headers propagate automatically through HttpClient and ASP.NET Core. Gaps in the waterfall usually mean uninstrumented work (a custom loop, a library without an ActivitySource) or broken propagation (messages, background work).

4. Metrics

The dashboard charts any instrument the service exports: ASP.NET Core (http.server.request.duration, kestrel.active_connections), HttpClient (http.client.request.duration), runtime metrics built into .NET 9 and later and therefore .NET 10 (dotnet.gc.collections, dotnet.thread_pool.queue.length, following OpenTelemetry semantic conventions) and your own Meter instruments. Exemplars can link a metric point to a trace.

5. Limits and security

  • Telemetry is capped per resource and type (configurable via the dashboard's telemetry limit settings); older data is dropped and everything is lost on restart.
  • The browser front end is protected by a login token (printed in the AppHost console link) or OpenID Connect; the OTLP endpoint can require an API key. Turning these off on a shared machine exposes logs that may contain personal information, which matters under the Privacy Act.
  • Structured logs can contain PII; keep sensitive values out of log properties regardless of the destination.

6. From the dashboard to production tools

The dashboard and production backends consume the same OTLP data with the same trace ids and attribute names, so the habits transfer directly:

Dashboard Application Insights Grafana stack
Traces view Transaction search / end-to-end transaction details Tempo
Structured logs filtered by trace id traces table in Log Analytics joined on operation_Id Loki with trace id derived field
Metrics view Metrics explorer / customMetrics Prometheus / Mimir

A useful habit: when you find a problem locally, write down the query you'd use in production to detect it (for example a KQL query on dependencies grouped by operation_Id counting calls to pricing), then add it as a dashboard tile or alert.

7. Standalone dashboard

The dashboard also ships as a container image (mcr.microsoft.com/dotnet/aspire-dashboard), with the UI on port 18888 and OTLP on 18889 (gRPC) inside the container, plus an OTLP/HTTP port for browser apps. Any OpenTelemetry-instrumented app, not just Aspire ones, can send to it. It's handy for Docker Compose set-ups, CI test runs and quick investigations. Azure Container Apps also offers an Aspire dashboard component for an environment, for short-term troubleshooting.

Try it yourself

  1. Run a starter solution, call the API with an invalid id and find the exception in both structured logs and the trace.
  2. Stop the Redis resource from the dashboard and watch health and traces change.
  3. Log with string interpolation, then with a message template, and compare how each can be filtered.
  4. Add a Meter with a counter, export it with AddMeter, and chart it.
  5. Run the standalone dashboard with Docker and point a console app's OTLP exporter at it.
  6. Run a quick load test (e.g. bombardier or k6) and watch request duration percentiles and thread-pool queue length.

💻 Code

Making your own work visible on the dashboard: a custom span, a structured log and a business metric.

// Orders.Api/Checkout/CheckoutService.cs
namespace Orders.Api.Checkout;

using System.Diagnostics;
using System.Diagnostics.Metrics;

public sealed class CheckoutService(PricingClient pricing, ILogger<CheckoutService> logger, IMeterFactory meters)
{
    public static readonly ActivitySource Source = new("Orders.Checkout");   // register with AddSource("Orders.*")
    private readonly Counter<long> _checkouts =
        meters.Create("Orders.Checkout").CreateCounter<long>("orders.checkouts", unit: "{checkout}");

    public async Task<decimal> CheckoutAsync(Cart cart, CancellationToken ct)
    {
        using var activity = Source.StartActivity("Checkout");            // null if nobody listens: cheap
        activity?.SetTag("cart.lines", cart.Lines.Count);

        // One batched call instead of one per line (the N+1 the dashboard exposed).
        var total = await pricing.PriceAsync(cart.Lines, ct);

        logger.LogInformation("Checked out cart {CartId} with {LineCount} lines for {Total}", cart.Id, cart.Lines.Count, total);
        _checkouts.Add(1, new KeyValuePair<string, object?>("payment.method", cart.PaymentMethod));
        return total;
    }
}

public sealed record Cart(Guid Id, IReadOnlyList<CartLine> Lines, string PaymentMethod);
public sealed record CartLine(int ProductId, int Quantity);
# Standalone dashboard for apps that aren't using an AppHost (e.g. Docker Compose or CI)
docker run --rm -it -p 18888:18888 -p 4317:18889 \
  --name aspire-dashboard mcr.microsoft.com/dotnet/aspire-dashboard:latest
# then in the app's environment:
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# OTEL_SERVICE_NAME=orders-api

⚠ Common mistakes

  • Mistake: Using the dashboard as production monitoring. Why it is wrong: Data is in memory, capped and lost on restart, with no alerting or retention. Instead: Send production telemetry to Application Insights, Azure Monitor or a Collector-backed stack.
  • Mistake: Creating custom spans or meters without registering them. Why it is wrong: StartActivity returns null and the meter isn't collected, so nothing appears and people assume tracing is broken. Instead: AddSource(...) and AddMeter(...) in service defaults.
  • Mistake: Relying on console logs once the service is running. Why it is wrong: Console output is fine for start-up crashes before logging is configured, but after that you lose properties, levels and trace correlation, and searching across services is slow. Instead: Use console logs for start-up and container problems, and structured logs with message templates for everything else.
  • Mistake: Logging with string interpolation ($"Order {id} failed"). Why it is wrong: The value is baked into the message, so you can't filter by property and every event has a unique template. Instead: Message templates or LoggerMessage source-generated methods.
  • Mistake: Turning off dashboard authentication on a shared or remote machine. Why it is wrong: Logs and traces can contain personal or sensitive data, exposing it to anyone on the network. Instead: Keep token or OpenID Connect sign-in and an OTLP API key.
  • Mistake: Logging request bodies or personal data so they're visible in the dashboard. Why it is wrong: The same logs reach production stores, creating Privacy Act and breach-notification risk. Instead: Log identifiers, not personal details, and use redaction (Microsoft.Extensions.Compliance.Redaction).
  • Mistake: Ignoring gaps in the trace waterfall. Why it is wrong: Gaps mean uninstrumented work or broken propagation that will hurt you during a production incident. Instead: Add spans or fix propagation while it's cheap, locally.

🏛 Senior insight: trade-offs

The dashboard's biggest value is cultural: developers see traces every day, so instrumentation quality gets fixed before production. I ask teams to check the trace for every new endpoint in the pull request, just as they'd run the tests.

Tool When it fits Cost When not to
Aspire dashboard (AppHost) Daily inner loop None Anything needing retention
Standalone dashboard container Compose set-ups, CI, quick checks A container Shared long-lived environments
Container Apps dashboard component Short-term troubleshooting in a test environment Small; security set-up Production observability
Application Insights / Grafana Production, alerting, SLOs Ingestion and retention Local development

🔗 Follow-ups the interviewer may ask

  1. When: Candidate mentions gaps or missing spans in traces Why: Checks diagnosing broken trace propagation
    How to answer

    I'd measure first: a KQL query for requests whose operation_ParentId points at a span that doesn't exist, grouped by service, tells me which hop breaks. Then I check the wire: does the caller send traceparent, and does the callee receive it? That splits the causes:

    • Header never sent: a hand-built HttpClient with propagation turned off, or an API gateway or proxy that strips or rewrites it (B3 vs W3C).
    • Sent but no span: the callee is missing instrumentation, AddSource, or exports to a different backend.
    • Orphan spans: a service uses a non-parent-based sampler, or ingestion sampling dropped the parent.
    • Lost in-process: work handed through Channel<T>, a queue or a new thread loses Activity.Current, so you pass the ActivityContext yourself.
    • Messaging: nobody injects context into Service Bus messages.

    The trade-off: fixing each hop by hand is quick; preventing it needs a shared template and a propagation test.

  2. When: Candidate says production uses a different backend Why: Checks choosing a production tracing backend
    How to answer

    All of them store and show traces; they differ in who runs them and how they price and store data.

    • Application Insights: managed by Azure, correlates traces with logs, exceptions and metrics, gives you Application Map and KQL. You pay per GB ingested and retained.
    • Jaeger v2: open source, built on the OpenTelemetry Collector, ingests OTLP natively; you run it and its storage (Elasticsearch/OpenSearch or Cassandra).
    • Grafana Tempo: stores traces in object storage, so it's cheap at high volume, and pairs with Prometheus and Loki.
    • Zipkin: older and simpler; OpenTelemetry has deprecated its Zipkin exporter, so send OTLP instead.

    From .NET you instrument once with OpenTelemetry and export OTLP, ideally through a Collector that can batch, sample and fan out. The trade-off: managed backends cost money per GB; self-hosted ones cost engineering time.

  3. When: Candidate adds a custom metric Why: Checks System.Diagnostics.Metrics usage
    How to answer

    I put a feature's metrics in one singleton class that takes IMeterFactory, creates a Meter named after the component (Shop.Orders) and creates the instruments once: a Counter<long> for events such as orders placed, a Histogram<double> in seconds for durations, and an ObservableGauge<T> for current state. Names follow OpenTelemetry semantic conventions (shop.orders.placed, unit {order}), and tags are bounded (channel, outcome), never customer or order ids.

    OpenTelemetry picks them up when I register the meter name with AddMeter inside WithMetrics, and the exporter (OTLP to a Collector, the Azure Monitor distro, or Prometheus) is a separate decision. I test with MetricCollector<T> from Microsoft.Extensions.Diagnostics.Testing, which captures measurements from a meter created by the same factory.

    The trade-off: every tag value and histogram bucket is a time series you pay for, so I add metrics for questions someone will actually ask.

🛠 Real-world problems: how you handle them

Slow checkout traced to an N+1 between services, found locally
Situation
[Retail checkout] built as an API and a pricing service on .NET 10 with an Aspire AppHost, before a [Black Friday] release. Checkout took [1.8 s] locally with a [20-line] cart.
Signals
Developers reported slow local checkouts; the team assumed a missing SQL index. A quick k6 run showed p95 above [2 s] with low CPU.
Investigation
Opened the dashboard's traces filtered to the API, sorted by duration; the waterfall showed [20] sequential HTTP client spans to the pricing service, each with its own SQL span. Checked structured logs for that trace id to confirm one call per cart line, and the metrics view for http.client.request.duration counts.
Resolution
Added a batch pricing endpoint and changed the checkout to one call per cart; added a custom `Checkout` span with a line-count tag.
Prevention
Pull request checklist: check the trace of new endpoints in the dashboard; an integration test using the Aspire testing builder asserting one pricing call per checkout; production alert on checkout p95.

How to tell it (STAR)

**S:** Before our [Black Friday] release, checkout took almost [two seconds] locally and the team was sure it was a database index. **T:** I wanted to find the real cause before we tuned the wrong thing. **A:** I opened the trace in the Aspire dashboard and saw [20] sequential calls to the pricing service, one per cart line. I added a batch endpoint, made checkout call it once, and added a span and a test to keep it that way. **R:** Checkout dropped to [about 220 ms], and we went into the sale without a database change we didn't need.

More in .NET Aspire

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me