Skip to content

Configure dashboard OTLP service name - #20600

Merged
James Newton-King (JamesNK) merged 5 commits into
mainfrom
fix-dashboard-otlp-service-name
Oct 3, 2026
Merged

James Newton-King (JamesNK) merged 5 commits into
mainfrom
fix-dashboard-otlp-service-name

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Dashboard traces exported through OTLP now use aspire-dashboard as the default service.name, making dashboard telemetry identifiable instead of inheriting the OpenTelemetry SDK's generic default. Deployments can continue to override the name with OTEL_SERVICE_NAME.

The dashboard configures its OpenTelemetry resource only when the OTLP exporter is enabled and disables automatic service instance ID generation to keep the resource stable. Integration coverage verifies both the default and configured service names.

User-facing usage

Set OTEL_EXPORTER_OTLP_ENDPOINT to enable dashboard trace export. Optionally set OTEL_SERVICE_NAME to replace the default aspire-dashboard service name:

OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
OTEL_SERVICE_NAME=custom-dashboard

Validation:

dotnet test --project tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-launch-profile -- --filter-method "*.OtlpExporterConfigured_ConfiguresServiceName" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
Passed: 2, Failed: 0, Skipped: 0

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20600

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20600"

@github-actions

This comment has been minimized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new fallback overrides service.name configured through OTEL_RESOURCE_ATTRIBUTES.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Configures exported dashboard traces with an identifiable default service name.

Changes:

  • Defaults OTLP service.name to aspire-dashboard.
  • Supports OTEL_SERVICE_NAME overrides and adds integration coverage.
File Description
src/​Aspire.Dashboard/​DashboardWebApplication.cs Configures the OpenTelemetry resource service name.
tests/​Aspire.Dashboard.Tests/​Integration/​HealthTests.cs Tests default and explicitly configured names.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Aspire.Dashboard/DashboardWebApplication.cs Outdated
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Automatic service instance ID generation remains enabled and the test incorrectly enforces that unstable behavior.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)

Comment thread src/Aspire.Dashboard/DashboardWebApplication.cs Outdated
Comment thread tests/Aspire.Dashboard.Tests/Integration/HealthTests.cs Outdated

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider the Copilot PR feedback, otherwise looks good.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The scoped change has focused integration coverage; the remaining validation-description nit is non-blocking.

Review effort: Balanced
Findings: None

Resolved since last review (3)

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The change is narrowly scoped, preserves environment overrides, and has focused regression coverage with no unresolved findings.

Review effort: Balanced
Findings: None

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one confirmed configuration-compatibility regression (P2); reproduced both service-name configuration paths. No code changes made.

Comment thread src/Aspire.Dashboard/DashboardWebApplication.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The configured SDK supports application configuration overrides, and the focused implementation has no blocking findings.

Review effort: Balanced
Findings: None

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Tests selector

13 / 98 PR test projects · 2 PR jobs, from 2 changed files.

Selected PR test projects (13 / 98)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 11 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/DashboardWebApplication.cs.

🔧 src/Aspire.Dashboard/DashboardWebApplication.cs (changed source)
→ 11 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/HealthTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/DashboardWebApplication.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit f919290.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@JamesNK
James Newton-King (JamesNK) merged commit 1ce8ac6 into main Oct 3, 2026
300 of 303 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 3, 2026
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Oct 3, 2026
Documents the aspire-dashboard default service.name and OTEL_SERVICE_NAME
override behavior for dashboard self-telemetry export, from
microsoft/aspire#20600.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1821

Generated by PR Documentation Check · copilot · auto · 98 AIC · ⌖ 12.5 AIC · ⊞ 20.3K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1821 targeting release/17.0.

Step 5: docs_optional→no, actually recommendation was docs_required (triggered signals: pr_body_has_cli_flag_mention, pr_body_has_user_facing_section — evidence: PR body's "User-facing usage" section documenting OTEL_EXPORTER_OTLP_ENDPOINT/OTEL_SERVICE_NAME and a test-command snippet). Drafted docs PR adds a "Dashboard self-telemetry" subsection to dashboard/configuration.mdx under ## OTLP, documenting: the dashboard exports its own traces only when OTEL_EXPORTER_OTLP_ENDPOINT is set; the default service.name is aspire-dashboard; override via OTEL_SERVICE_NAME or service.name in OTEL_RESOURCE_ATTRIBUTES (with OTEL_SERVICE_NAME precedence); and that service.instance.id is preserved from OTEL_RESOURCE_ATTRIBUTES but not auto-generated — matching DashboardWebApplication.cs's DefaultOtlpServiceName/autoGenerateServiceInstanceId: false and the PR's README.md update.

Note

This draft PR needs human review before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants