You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flag OTLP-configured resources that have sent no telemetry in describe and MCP list_resources - #22579
JavaScript hosting methods (AddNodeApp, AddViteApp, AddJavaScriptApp, …) call WithOtlpExporter(), so the app gets OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME, and the rest. A Node app without an OpenTelemetry SDK ignores them and exports nothing. Its trace list in aspire otel traces or the MCP server is then empty, and an agent reads that as "nothing happened" instead of "this resource can't send telemetry". In the benchmark behind #22509, none of 2,338 trials that listed traces saw the frontend.
This PR implements options 1 (CLI/MCP only) and 3 (docs) from the issue. Dashboard card and aspire-skills changes are out of scope.
User-facing behavior
aspire describe --format json (snapshot, not --follow) adds telemetryReceived to each resource whose AppHost configured OTLP export (OTEL_EXPORTER_OTLP_ENDPOINT set) when the dashboard telemetry API could be read. false means the dashboard has received no traces, logs, or metrics from it.
aspire describe (table) prints a note after the table that names the running resources with telemetryReceived: false:
ℹ️ OpenTelemetry export is configured, but no telemetry has been received from: frontend
The OTEL_* settings only take effect when the app registers an OpenTelemetry SDK. For Node.js apps, install @opentelemetry/auto-instrumentations-node and start the app with --require @opentelemetry/auto-instrumentations-node/register. An idle app may also have nothing to report yet.
MCP list_resources adds telemetry_received with the same meaning. When a resource on the page reports false, the response preamble adds one line that explains it. Otherwise the preamble is unchanged, so normal responses cost no extra tokens.
When OTLP isn't configured, or the dashboard API is unavailable, unreachable, or slower than 5 seconds, the field is omitted and the listing still succeeds.
The XML docs on AddNodeApp, AddBunApp, AddJavaScriptApp, AddViteApp, and AddNextJsApp, plus the Aspire.Hosting.JavaScript README, now say that the OTLP variables only take effect when the app has an SDK. They show the minimal Node.js registration:
ResourceTelemetryStatus (CLI) checks each snapshot's environment for OTEL_EXPORTER_OTLP_ENDPOINT. It reads the dashboard's /api/telemetry/resources list through the existing TelemetryCommandHelpers and matches entries by composite name ({service.name}-{service.instance.id} equals the runtime resource name), the same mapping the dashboard uses. If an entry has no instance ID, it falls back to matching the display name. It makes no request when no resource has OTLP configured. docs/specs/cli-output-formats.md and docs/specs/cli-mcp.md document the new fields.
Validation
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.DescribeCommandTests" --filter-class "*.ListResourcesToolTests" --filter-class "*.ExcludeFromMcpTests" --filter-class "*.AgentMcpCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": passed (204/204). New tests cover the JSON field (including replica and no-instance-ID matching), the table note (running only), the MCP field and conditional preamble, and dashboard API failure in both paths.
aspire describe (table and JSON snapshot) and the MCP list_resources tool
now report whether the dashboard has received telemetry from resources
whose AppHost configured OTLP export. A JavaScript app without an
OpenTelemetry SDK receives the OTEL_* variables but exports nothing; this
makes that state visible instead of looking like an idle resource. The
status degrades to absent when the dashboard telemetry API is unavailable.
Document on the JavaScript hosting APIs and README that the OTLP settings
need an SDK in the app, with the minimal Node.js registration.
Fixes#22509
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Telemetry matching can falsely warn for persistent resources and custom identities, while resource-specific describe queries unnecessarily fetch unrelated telemetry and may incur a five-second delay.
This PR helps users and agents distinguish missing telemetry from an absence of application activity, addressing the CLI, MCP, and documentation portions of #22509.
Changes:
Adds optional telemetry-received status to describe snapshots and MCP resource listings, with guidance when no telemetry has arrived.
Uses a bounded dashboard lookup that leaves resource listings available when telemetry status cannot be determined.
Documents JavaScript SDK registration and adds tests for status output and dashboard failures.
Use the resolved OTEL_SERVICE_NAME and service.instance.id from the
resource environment so persistent resources and apps with custom
identities are not reported as silent. Query the dashboard only for the
resources describe actually renders (the requested resource, and only
running ones for the table note), and collapse the lookup's error handling.
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Mocked tests leave runtime identity mapping and authenticated dashboard lookup unverified, so end-to-end coverage is needed to catch missing or incorrect telemetryReceived values and resource-table notes.
Run a starter app with an SDK-less Node app and assert describe's
telemetryReceived values and table note through the real dashboard API.
Drop a one-caller factory from ResourceTelemetryStatus.
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The null-token guard omits telemetry status and warnings from describe and MCP when anonymous dashboard access is enabled without an API key, despite the telemetry API being readable.
With ASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true and no configured API key, the dashboard exposes a readable telemetry API but returns a null token. This guard therefore omits telemetry status and warnings from both describe and MCP in that configuration. Allow requests without an authentication header when the token is absent; the existing exception handler can still handle genuine API failures.
The snapshot environment is DCP's effective environment: executables inherit
the AppHost process environment (for example the endpoint aspire run profiling
sets) and containers include ENV from their image. Count only spec entries so
resources the AppHost never configured for OTLP aren't flagged as silent, and
skip the per-resource assignment in describe JSON when the status is unknown.
PR:#22579, Flag OTLP-configured resources that have sent no telemetry in describe and MCP list_resources
Head:88395f5b058ac5e1b45a735a16853c00ffeb89fe
Tested: 2026-11-24 UTC, Linux arm64 isolated container
Artifact: dogfood CLI 17.1.0-pr.22579.g88395f5b; version matches the PR head, rechecked after the run.
Changes analyzed
CLI describe JSON and table, MCP list_resources, dashboard telemetry lookup, and related localization and JSON model.
JavaScript hosting XML documentation and README; CLI/MCP output specifications.
CLI unit and end-to-end tests. No dashboard UI, extension, or CI infrastructure changes.
Executed scenarios
Real applications: JSON and table
Passed. Created a fresh aspire-starter with the PR template hive and non-interactive options. Added Aspire.Hosting.JavaScript, a Node app without an SDK (silent), a Node app using NODE_OPTIONS=--require @opentelemetry/auto-instrumentations-node/register (instrumented), and a plain executable without AppHost-configured OTLP (plain). Started the AppHost and waited for the resources.
aspire describe --format json reported telemetryReceived: false for silent, true for the instrumented Node app and starter API, and no telemetry status for plain. The table's no-telemetry note included silent and excluded instrumented and plain. A starter service sometimes appeared in the note before sending its first telemetry; this is consistent with the guidance that an idle or newly started app may not yet have exported anything.
MCP list_resources
Passed. Called aspire agent mcp over stdio with a real MCP initialize and tools/call request while the AppHost was running. list_resources returned telemetry_received: false for silent, true for instrumented, and no field for plain; the response included the SDK guidance.
Unavailable dashboard telemetry API
Passed. Paused the isolated dashboard process while keeping the AppHost running. aspire describe --format json and MCP list_resources both returned resources successfully with telemetry status omitted for silent and instrumented, rather than falsely reporting no telemetry or failing. Resumed the dashboard and stopped the AppHost.
Missing resource
Passed.aspire describe does-not-exist --apphost <apphost> --format json --non-interactive returned a nonzero exit code and Resource 'does-not-exist' not found.
Supporting evidence
Scenario commands and assertions: scenario.sh; captured output: scenario.log.
JSON status: describe.json; table: table.txt; MCP exchange: mcp.jsonl and mcp-response.txt.
Dashboard-unavailable output: describe-dashboard-stopped.json and mcp-dashboard-stopped.jsonl.
Negative case: missing.out and missing.err; startup and stop: start.log, stop.log.
Evidence files are in the isolated test workspace. Startup logs may contain a temporary dashboard login token and should not be published verbatim.
The PR-head CLI end-to-end job also passed. A prior targeted CLI test run passed 205 tests; these support, but do not replace, the dogfood scenarios above.
No screenshot was captured: this change does not modify dashboard UI.
Overall result
Passed. The PR artifact exhibited the expected positive, negative, and unavailable-dashboard behavior. The AppHost was stopped after testing.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request due to rate limiting. Please try again later. See Usage limits for GitHub Copilot for details.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
JavaScript hosting methods (
AddNodeApp,AddViteApp,AddJavaScriptApp, …) callWithOtlpExporter(), so the app getsOTEL_EXPORTER_OTLP_ENDPOINT,OTEL_SERVICE_NAME, and the rest. A Node app without an OpenTelemetry SDK ignores them and exports nothing. Its trace list inaspire otel tracesor the MCP server is then empty, and an agent reads that as "nothing happened" instead of "this resource can't send telemetry". In the benchmark behind #22509, none of 2,338 trials that listed traces saw the frontend.This PR implements options 1 (CLI/MCP only) and 3 (docs) from the issue. Dashboard card and aspire-skills changes are out of scope.
User-facing behavior
aspire describe --format json(snapshot, not--follow) addstelemetryReceivedto each resource whose AppHost configured OTLP export (OTEL_EXPORTER_OTLP_ENDPOINTset) when the dashboard telemetry API could be read.falsemeans the dashboard has received no traces, logs, or metrics from it.aspire describe(table) prints a note after the table that names the running resources withtelemetryReceived: false:MCP
list_resourcesaddstelemetry_receivedwith the same meaning. When a resource on the page reportsfalse, the response preamble adds one line that explains it. Otherwise the preamble is unchanged, so normal responses cost no extra tokens.When OTLP isn't configured, or the dashboard API is unavailable, unreachable, or slower than 5 seconds, the field is omitted and the listing still succeeds.
The XML docs on
AddNodeApp,AddBunApp,AddJavaScriptApp,AddViteApp, andAddNextJsApp, plus theAspire.Hosting.JavaScriptREADME, now say that the OTLP variables only take effect when the app has an SDK. They show the minimal Node.js registration:C#
TypeScript
Implementation
ResourceTelemetryStatus(CLI) checks each snapshot's environment forOTEL_EXPORTER_OTLP_ENDPOINT. It reads the dashboard's/api/telemetry/resourceslist through the existingTelemetryCommandHelpersand matches entries by composite name ({service.name}-{service.instance.id}equals the runtime resource name), the same mapping the dashboard uses. If an entry has no instance ID, it falls back to matching the display name. It makes no request when no resource has OTLP configured.docs/specs/cli-output-formats.mdanddocs/specs/cli-mcp.mddocument the new fields.Validation
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.DescribeCommandTests" --filter-class "*.ListResourcesToolTests" --filter-class "*.ExcludeFromMcpTests" --filter-class "*.AgentMcpCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": passed (204/204). New tests cover the JSON field (including replica and no-instance-ID matching), the table note (running only), the MCP field and conditional preamble, and dashboard API failure in both paths.dotnet build src/Aspire.Hosting.JavaScript/Aspire.Hosting.JavaScript.csproj: 0 warnings.Part of epic #22511.
Fixes #22509
Checklist
<remarks />and<code />elements on your triple slash comments?