Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Dec 22, 2025

Description

Adds import button:

image

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
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings December 22, 2025 02:24
@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13682

Or

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

@JamesNK
Copy link
Member Author

JamesNK commented Dec 22, 2025

I think we need to a config to control what features are enabled here for a dashboard. I'm guessing hosted dashboards wouldn't want to allow people to import external telemetry.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds telemetry import functionality to the Aspire Dashboard, allowing users to import telemetry data (logs, traces, and metrics) from JSON and ZIP files through a new import button in the settings dialog.

Key Changes

  • Import Service: New TelemetryImportService for handling file imports with support for JSON and ZIP formats
  • Unified Data Model: Consolidated separate OTLP JSON data types (OtlpLogsDataJson, OtlpTracesDataJson, OtlpMetricsDataJson) into a single OtlpTelemetryDataJson class
  • UI Enhancement: Added import button with file upload capability to the Settings dialog

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Aspire.Dashboard/Model/TelemetryImportService.cs New service implementing telemetry import from JSON/ZIP files with validation and error handling
tests/Aspire.Dashboard.Tests/Model/TelemetryImportServiceTests.cs Comprehensive test suite covering import scenarios including edge cases and round-trip validation
src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpCommonJson.cs Added unified OtlpTelemetryDataJson class supporting logs, traces, and metrics in a single structure
src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpLogsJson.cs Removed redundant OtlpLogsDataJson class (replaced by unified model)
src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpTraceJson.cs Removed redundant OtlpTracesDataJson class (replaced by unified model)
src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpMetricsJson.cs Removed redundant OtlpMetricsDataJson class (replaced by unified model)
src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpJsonSerializerContext.cs Updated serializer context to reference new unified data type
src/Aspire.Dashboard/Model/TelemetryExportService.cs Updated to return OtlpTelemetryDataJson instead of separate type-specific classes
src/Aspire.Dashboard/Components/Dialogs/SettingsDialog.razor Added FluentInputFile component and import button to UI
src/Aspire.Dashboard/Components/Dialogs/SettingsDialog.razor.cs Implemented file upload handlers with progress and completion callbacks
src/Aspire.Dashboard/DashboardWebApplication.cs Registered TelemetryImportService as a scoped service
src/Aspire.Dashboard/Resources/Dialogs.resx Added "SettingsImportButtonText" localization key
src/Aspire.Dashboard/Resources/Dialogs.Designer.cs Generated designer code for new localization resource
src/Aspire.Dashboard/Resources/xlf/* Added localization entries for import button text across all supported languages
Files not reviewed (1)
  • src/Aspire.Dashboard/Resources/Dialogs.Designer.cs: Language not supported

@davidfowl
Copy link
Member

I think we need to start thinking about the dashboard as an API as well. We want to make sure we can collect data on the CI after a run. We need to think about what it means for the dashboard to be disabled in this context (but still available as an API).

/// <returns>A task representing the async operation.</returns>
public async Task ImportAsync(string fileName, Stream stream, CancellationToken cancellationToken)
{
await ImportCoreAsync(fileName, stream, allowZipFile: true, cancellationToken).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

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

Is this externally configurable? Seems like you've allow for turning it off but I can't see where you set it other than this hardcoded value.

Copy link
Member Author

Choose a reason for hiding this comment

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

allowZipFile? It's true here and false in ImportZipAsync. I didn't want to allow recursive zip files.

@JamesNK JamesNK force-pushed the jamesnk/telemetry-import branch from 60599d5 to a778b76 Compare January 8, 2026 09:16
@JamesNK
Copy link
Member Author

JamesNK commented Jan 9, 2026

@eerhardt The AppService integration can automatically add the dashboard. Should imports be disable? It would just be a matter of adding an env var: "DASHBOARD__UI__DISABLEIMPORT": "true"

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.

4 participants