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

Implement stream connection for remote write #6580

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexqyle
Copy link
Contributor

@alexqyle alexqyle commented Feb 7, 2025

What this PR does:

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Alex Le <[email protected]>
return nil
case job := <-c.streamPushChan:
err = stream.Send(job.req)
if err == io.EOF {
Copy link
Contributor

@anna-tran anna-tran Feb 7, 2025

Choose a reason for hiding this comment

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

when does the error become EOF? when the stream is closed but we try to send the job anyways?

could we extract this comparison to a well-named helper method to make it more explicit about what EOF means in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. I checked how stream connection got handled elsewhere. Just handled this in similar way.

@@ -137,7 +138,7 @@ type Config struct {
IgnoreSeriesLimitForMetricNames string `yaml:"ignore_series_limit_for_metric_names"`

// For testing, you can override the address and ID of this ingester.
ingesterClientFactory func(addr string, cfg client.Config) (client.HealthAndIngesterClient, error)
ingesterClientFactory func(addr string, cfg client.Config, useStreamConnection bool) (client.HealthAndIngesterClient, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we put this in the client.Config instead of adding an extra boolean parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now, I put this flag as distributor config and I try to use only one config. If put this in ingester client config, I would need to add extra attribute for distributor to know if it is using stream connection.

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

Successfully merging this pull request may close these issues.

2 participants