-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for custom resource logging #2508
Conversation
- Resources can call WithResourceLogger to add an annotation that allows them to publish logs to a live stream. These will flow through the resource server to any consumer (including the dashboard). - Share circular buffer between otlp log storage and aspire.hosting. - Added tests
playground/CustomResources/CustomResources.AppHost/TestResource.cs
Outdated
Show resolved
Hide resolved
if (annotation._backlog.Count > 0) | ||
{ | ||
// REVIEW: Performance makes me very sad, but we can optimize this later. | ||
yield return annotation._backlog.ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think console logs need the concept of paging. Returning all the data and displaying all the data is a performance problem, especially showing 1000s of lines in the browser.
Virtualization means only a subset of the data is needed.
I noticed this earlier when I created #2507
Co-authored-by: James Newton-King <james@newtonking.com>
Two thoughts on this:
|
Tentatively approving pending the fix on the test failure and responses to those questions above. They can be follow up PRs if needs be. |
- Support completing the log stream - Added tests
I don't think so, at least not by default. We'll need something more durable eventually though. I'm not a fan of opening a temp file bug it might be required for longer log streams.
Nope, see #2396 |
Fixes #2498
custom-resource-logs.mp4
Microsoft Reviewers: Open in CodeFlow