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

feat(discovery): Add a remote_relabel component #1368

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simonswine
Copy link
Contributor

@simonswine simonswine commented Jul 26, 2024

This allows to receive discovery relabelling rules from a remote server using a websocket connection.

We plan this for an experimental way to control profile collection with Grafana Cloud Profiles very dynamically. Currently the only backend available is the settings server for Pyroscope (grafana/pyroscope#3416)

@simonswine simonswine force-pushed the 20240722_add-discovery.remote_relabel branch 2 times, most recently from 58bd6d1 to 2d2f80f Compare August 16, 2024 14:22
This allows to receive discovery relabeling rules from a remote server
using a websocket connection. We plan this for an experimental way to
control profile collection with Grafana Cloud Profiles.
@simonswine simonswine force-pushed the 20240722_add-discovery.remote_relabel branch from 2d2f80f to 5e4ee53 Compare August 21, 2024 13:21
@simonswine simonswine marked this pull request as ready for review August 21, 2024 13:23
@simonswine simonswine changed the title WIP: feat(discovery): Add a remote_relabel component feat(discovery): Add a remote_relabel component Aug 21, 2024
var _ component.Component = (*Component)(nil)

func defaultInstance() string {
// TODO: This should come from Alloy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be addressed before merging PR?

Copy link
Contributor

@korniltsev korniltsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, nice and simple.

Remember to update changelog, docs and API depdendency once it is tagged

Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor non-blocking doc suggestions


| Name | Type | Description | Default | Required |
| --------- | ------------------- | ------------------ | ------- | -------- |
| `targets` | `list(map(string))` | Targets to relabel | | yes |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `targets` | `list(map(string))` | Targets to relabel | | yes |
| `targets` | `list(map(string))` | Targets to relabel. | | yes |


| Name | Type | Description | Default | Required |
| --------------------- | ---------- | ------------------------------------------------------------------ | --------- | -------- |
| `url` | `string` | Full URL to the websocket server. Needs to start with ws:// wss:// | | yes |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `url` | `string` | Full URL to the websocket server. Needs to start with ws:// wss:// | | yes |
| `url` | `string` | Full URL to the websocket server. Must start with `ws://` or `wss://`. | | yes |

@wildum
Copy link
Contributor

wildum commented Aug 28, 2024

Hey, thanks for opening a PR, that's an interesting idea :) Adding such a component is a big deal, it would have been better to discuss it over a proposal (it's not too late to create one now and use this PR as a POC).
I would like to know a bit more about the problem it is trying to solve and whether modules or remotecfg could be a solution.

@wildum wildum self-requested a review August 28, 2024 11:01
Copy link
Contributor

@wildum wildum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ blocking the PR for now till above's comment is clarified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants