-
Notifications
You must be signed in to change notification settings - Fork 251
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
Live debugging service with prometheus.relabel #797
Conversation
da55944
to
47650ee
Compare
Looks reasonable, tested both wide 1,000 streams and deep 1 stream with 1m metrics. Long term some changes around when to flush and the channel would be nice. But performance is totally reasonable. |
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.
Good start! some comments around readability and naming.
…void expensive string computation
@ptodev @thampiotr thanks for your feedback! |
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.
Thank you, LGTM!
} | ||
|
||
// Buffer of 1000 entries to handle load spikes and prevent this functionality from eating up too much memory. | ||
// TODO: in the future we may want to make this value configurable to handle heavy load |
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.
Perhaps we should track these TODOs somewhere in a GitHub issue, cause after we're done reviewing these partial PRs, we may miss them when merging to main.
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.
Good point, I created this issue to track the todos: #974
Not sure if we do the optimizations before we merge it to main. It might be better to have more components that supports the feature to identify and solve the pain points
* create xray service to manage the debug streams * add xray support to the prometheus.relabel component * add xray endpoint to the api * rename handler to manager * defer cleanup func * rework to add multi-streams support * more tests * additional multi delete test * add todo comment for buffer size * add error checks * improve naming and readability, split interfaces and add a check to avoid expensive string computation * move register and isregistered to a new debugRegistry interface
* Live debugging service with prometheus.relabel (#797) * create xray service to manage the debug streams * add xray support to the prometheus.relabel component * add xray endpoint to the api * rename handler to manager * defer cleanup func * rework to add multi-streams support * more tests * additional multi delete test * add todo comment for buffer size * add error checks * improve naming and readability, split interfaces and add a check to avoid expensive string computation * move register and isregistered to a new debugRegistry interface * Live debugging front (#977) * add live debugging page in UI * change button size * move icon in front of text in buttons * add warning if the number of incoming lines is greater than the buffer size * Live debugging doc (#987) * add live debugging doc * Update docs/sources/tasks/debug.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/tasks/debug.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/tasks/debug.md Co-authored-by: Clayton Cornell <[email protected]> * improve doc * Update docs/sources/tasks/debug.md Co-authored-by: Clayton Cornell <[email protected]> --------- Co-authored-by: Clayton Cornell <[email protected]> * changelog * add list of supported components in debug.md * switch to pull based registration * switch stability to GA * update changelog * use monospace font for log lines * copy to clipboard now copies the filtered data * disable livedebugging by default and add a config block to enable it. The stability is also updated to experimental * Update docs/sources/reference/config-blocks/livedebugging.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/reference/config-blocks/livedebugging.md Co-authored-by: Clayton Cornell <[email protected]> * replace debugging data by live debugging data in the doc * update screenshots * Update docs/sources/reference/config-blocks/livedebugging.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/reference/config-blocks/livedebugging.md Co-authored-by: Clayton Cornell <[email protected]> * small doc fix --------- Co-authored-by: Clayton Cornell <[email protected]>
THIS PR WILL BE MERGED TO A FEATURE BRANCH WHICH WILL RECEIVE A FEW OTHER PRs BEFORE BEING READY TO BE MERGED ON MAIN
This PR is the first part of the live debugging functionality.
It creates live debugging as a service and connects the prometheus.relabel component to it (an easy first candidate).
A stream to a component can be opened via
http://localhost:12345/api/v0/web/debug/ + componentID
.This adds a callback to the x-ray service that the component can retrieve and use to pass data as a string which will be directly flushed to the HTTP client.
It supports components that are inside modules.
Fixes #790