-
Notifications
You must be signed in to change notification settings - Fork 239
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
Add livedebugging support for discovery components #2309
base: main
Are you sure you want to change the base?
Conversation
@@ -112,6 +112,36 @@ Supported components: | |||
* `prometheus.relabel` | |||
{{< /admonition >}} | |||
* `discovery.relabel` |
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.
We can probably abbreviate this to discovery.*
unless there's discovery components not added by this PR.
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.
Abbreviating would follow the pattern for other component groups.
// New creates a discovery component given arguments and a concrete Discovery implementation function. | ||
func New(o component.Options, args component.Arguments, creator Creator) (*Component, error) { | ||
debugDataPublisher, err := o.GetServiceData(livedebugging.ServiceName) | ||
if err != nil { |
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.
If there is an error in connecting with livedebugging I would not expect that to cause the component to fail to instantiate.
Just looked, and this is clearly the established pattern so I'll bring that up in a separate channel, this is fine for now.
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.
yeah I agree that it is a bit weird that a missing debugging functionality would prevent the components from starting. But because this is not something that can happen (all services are always created at start), we decided to always expect the service to be there. We could revisit it by adding nil pointers check instead of falling + some way to log once that the live debugging functionality is not available
@@ -257,3 +273,5 @@ func (c *Component) runDiscovery(ctx context.Context, d DiscovererWithMetrics) { | |||
} | |||
} | |||
} | |||
|
|||
func (c *Component) LiveDebugging(_ int) {} |
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.
My understanding is that this function is triggered on a change of livedebug consumers. Should the function Publish the cached targets data if the number of consumers > 0 as discovery may not update rapidly otherwise? CC @wildum
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 don't think so because the concept of live debugging is to show what's happening now. If I have live debugging open and I see targets I expect that the targets were just sent. The user can see the last sent targets in the exports area of the component page in the UI.
We can revisit this concept if that's something users really want to see on the live graph/live debugging feed but we could simply just use the export values
* `discovery.nomad` | ||
* `discovery.openstack` | ||
* `discovery.ovhcloud` | ||
* `discovery.process` |
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.
discovery process is not using the common discovery component. Can you add livedebugging to it too please?
PR Description
Which issue(s) this PR fixes
Fixes #1034
Notes to the Reviewer
PR Checklist