Skip to content

Support displaying different resource properties - #5526

Merged
James Newton-King (JamesNK) merged 2 commits into
mainfrom
jamesnk/applicationview
Sep 10, 2024
Merged

James Newton-King (JamesNK) merged 2 commits into
mainfrom
jamesnk/applicationview

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Sep 3, 2024 •

Copy link
Copy Markdown
Member

Description

Telemetry is sent with a resource and a resource has attributes. The first time the dashboard sees a resource it caches it using the name and instance id as the key.

Usually, the attributes on a resource are static. However, it is possible for telemetry to be sent with a resource with the same key but different attributes. When the telemetry is viewed in the UI we want those resource attributes to be displayed, not the initial cached attributes.

This PR:

  • Adds OtlpApplicationView. It has a collection of properties
  • Caches OtlpApplicationView on OtlpApplication. The key is the properties. This allows views to be shared by telemetry.
  • Changes telemetry to refer to the app view instead of app, allowing for the correct properties to be displayed in the UI.
  • Tests

Fixes #5126

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?
    • Yes
      • Link to aspire-docs issue:
    • No
Microsoft Reviewers: Open in CodeFlow

@JamesNK

Copy link
Copy Markdown
Member Author

cc Sam Spencer (@samsp-msft)

@JamesNK

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@JamesNK

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/Aspire.Dashboard/Otlp/Model/OtlpApplicationView.cs Outdated
Comment thread src/Aspire.Dashboard/Otlp/Model/OtlpApplicationView.cs Outdated
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aspire-dashboard Structured logs -> Log entry details -> Resource attributes not always correct/seem cached

2 participants