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

Network wal pr #1717

Merged
merged 9 commits into from
Oct 3, 2024
Merged

Network wal pr #1717

merged 9 commits into from
Oct 3, 2024

Conversation

mattdurham
Copy link
Collaborator

These are the network items for the new wal. There are some similarities with the old wal, buildWriteRequest and queuing by hash. I have e2e tests that arent shown here, will see if I can distill them to more specific tests but figure we can go ahead and get started looking at the code.

@mattdurham mattdurham marked this pull request as draft September 19, 2024 17:32
@mattdurham mattdurham changed the title Network items Network wal pr Sep 20, 2024
@mattdurham mattdurham marked this pull request as ready for review September 20, 2024 13:48
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.

Thanks for all this work, I did a first pass but couldn't review everything yet, I will continue the next day


// By default each sample only has a histogram, float histogram or sample.
if cap(ts.Histograms) == 0 {
ts.Histograms = make([]prompb.Histogram, 1)
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
ts.Histograms = make([]prompb.Histogram, 1)
ts.Histograms = make([]prompb.Histogram, 0, 1)

setting the capacity to 1 but the length to 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think functionally this is less ideal, since I would need to use append semantics. There will only ever be 0 or 1 record here.

if tsBuf.Histograms.FloatHistogram != nil {
ts.Histograms = ts.Histograms[:1]
ts.Histograms[0] = tsBuf.Histograms.FloatHistogram.ToPromFloatHistogram()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

could both cases above simply be appends and the if below could be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me think on this.

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.

First pass, didn't go through everything yet.

Makefile Outdated Show resolved Hide resolved
internal/component/prometheus/remote/queue/network/loop.go Outdated Show resolved Hide resolved
internal/component/prometheus/remote/queue/network/loop.go Outdated Show resolved Hide resolved
internal/component/prometheus/remote/queue/network/loop.go Outdated Show resolved Hide resolved
internal/component/prometheus/remote/queue/network/loop.go Outdated Show resolved Hide resolved
@mattdurham
Copy link
Collaborator Author

Going to merge this and move on to the next PR.

@mattdurham mattdurham merged commit 20c1a83 into dev.new-wal Oct 3, 2024
15 checks passed
@mattdurham mattdurham deleted the wal_network branch October 3, 2024 17:45
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.

3 participants