Skip to content
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

Open
wants to merge 11 commits into
base: xray
Choose a base branch
from
Open

Conversation

wildum
Copy link
Contributor

@wildum wildum commented May 8, 2024

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

@wildum wildum changed the title Xray service with prometheus.relabel Live debugging service with prometheus.relabel May 8, 2024
@wildum wildum force-pushed the xray-service branch 2 times, most recently from da55944 to 47650ee Compare May 8, 2024 14:55
internal/web/api/api.go Outdated Show resolved Hide resolved
@mattdurham
Copy link
Collaborator

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.

@rfratto rfratto added the backport-to-agent:no PR should NOT be backported to the agent repo. label May 14, 2024
Copy link
Contributor

@thampiotr thampiotr left a 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.

internal/alloy/componenttest/componenttest.go Outdated Show resolved Hide resolved
internal/alloycli/cmd_run.go Show resolved Hide resolved
internal/component/prometheus/relabel/relabel.go Outdated Show resolved Hide resolved
internal/component/prometheus/relabel/relabel.go Outdated Show resolved Hide resolved
internal/component/prometheus/relabel/relabel.go Outdated Show resolved Hide resolved
internal/service/ui/ui.go Outdated Show resolved Hide resolved
internal/web/api/api.go Outdated Show resolved Hide resolved
internal/service/livedebugging/debug_stream_manager.go Outdated Show resolved Hide resolved
internal/service/livedebugging/debug_stream_manager.go Outdated Show resolved Hide resolved
internal/service/livedebugging/debug_stream_manager.go Outdated Show resolved Hide resolved
@wildum
Copy link
Contributor Author

wildum commented May 24, 2024

@ptodev @thampiotr thanks for your feedback!
I made some changes to try to improve naming and readability. I also split the interface in two: DebugCallbackRegistry and DebugDataPublisher.
I'm now using two interfaces to clearly separate the roles between the debug data publishers (the components) and the API that sets the callbacks. I'm not sure where these interfaces should be defined so I left them in the livedebugging package.
Please have another look at it when you have time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-agent:no PR should NOT be backported to the agent repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants