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

Component #1823

Merged
merged 48 commits into from
Oct 15, 2024
Merged

Component #1823

merged 48 commits into from
Oct 15, 2024

Conversation

mattdurham
Copy link
Collaborator

@mattdurham mattdurham commented Oct 3, 2024

This is the last PR, aside from the merge to main. This ties everything together and exposes the component. Most of this are very expansive tests. I am likely to change the metrics in subsequent PRs so dont get to in detail about them.

Things to do that I will do after this large merge and create tickets for each.

  • Add support for TLS
  • Rethink the metrics and the approach.
  • Add metadata support, this requires exposing additional properties on the scrape itself.
  • Add hook to not use labelstore if not running any remote_write components.

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.

First high level pass of the docs. I'll go through again once the ToDos are added

@mattdurham mattdurham marked this pull request as draft October 4, 2024 03:10
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.

Approving for docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to add a bit more info on how prometheus.remote.queue is different from prometheus.remote_write, and when to use what component.

internal/component/prometheus/remote/queue/component.go Outdated Show resolved Hide resolved
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.

I focused on the user-facing API as this will be harder to change without breaking things.

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`max_signals_to_batch` | `uint` | The maximum number of signals before they are batched to disk. | `10,000` | no
`batch_frequency` | `duration` | How often to batch signals to disk if `max_signals_to_batch` is not reached. | no
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we use signals as a name? maybe it should be samples? or is this to encompass histograms samples too? I'm not sure if that's a right name. In current remote_write we call this 'metrics' which makes sense although it's not very precise: https://grafana.com/docs/alloy/next/reference/components/prometheus/prometheus.remote_write/#wal-block

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Subsequent PR will enable metadata storage, so I wanted it to not be just metrics. Sample is to narrow, open to better names here.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe 'entries'? that would be a generic name for things inside a queue.

Comment on lines +99 to +111
if len(s.endpoints) > 0 {
for _, ep := range s.endpoints {
ep.Stop()
}
s.endpoints = map[string]*endpoint{}
}
err := s.createEndpoints()
if err != nil {
return err
}
for _, ep := range s.endpoints {
ep.Start()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, maybe Update can signal via channel to Run that will manage everything in one thread. I found this to be a decent pattern in other components.

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

Most of the feedback has been responded so merging.

@mattdurham mattdurham merged commit 079c3a9 into dev.new-wal Oct 15, 2024
16 of 17 checks passed
@mattdurham mattdurham deleted the wal_component branch October 15, 2024 13:36
mattdurham added a commit that referenced this pull request Oct 16, 2024
* readme

* fix readme

* Add filequeue functionality (#1601)

* Checkin for file queue

* add comment

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* naming and error handling feedback from PR

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/filequeue/filequeue.go

Co-authored-by: Piotr <[email protected]>

* drop benchmark

* rename get to pop

---------

Co-authored-by: Piotr <[email protected]>

* Adding the serialization features. (#1666)

* Adding the serialization features.

* Dont test this with race condition since we access vars directly.

* Fix test.

* Fix typo in file name and return early in DeserializeToSeriesGroup.

* Update internal/component/prometheus/remote/queue/serialization/appender.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/serialization/serializer.go

Co-authored-by: Piotr <[email protected]>

* Rename to indicate that TimeSeries are Put/Get from a pool.

* Remove func that was about the same number of lines as inlining.

* Update internal/component/prometheus/remote/queue/types/serialization.go

Co-authored-by: Piotr <[email protected]>

* Update internal/component/prometheus/remote/queue/serialization/serializer.go

Co-authored-by: Piotr <[email protected]>

* Change benchmark to be more specific.

---------

Co-authored-by: Piotr <[email protected]>

* Network wal pr (#1717)

* Checkin the networking items.

* Fix for config updating and tests.

* Update internal/component/prometheus/remote/queue/network/loop.go

Co-authored-by: William Dumont <[email protected]>

* Update internal/component/prometheus/remote/queue/network/loop.go

Co-authored-by: Piotr <[email protected]>

* pr feedback

* pr feedback

* simplify stats

* PR feedback

---------

Co-authored-by: William Dumont <[email protected]>
Co-authored-by: Piotr <[email protected]>

* Component (#1823)

* Checkin the networking items.

* Fix for config updating and tests.

* Update internal/component/prometheus/remote/queue/network/loop.go

Co-authored-by: William Dumont <[email protected]>

* Update internal/component/prometheus/remote/queue/network/loop.go

Co-authored-by: Piotr <[email protected]>

* pr feedback

* pr feedback

* simplify stats

* simplify stats

* Initial push.

* docs and some renaming

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Changes and testing.

* Update docs.

* Update docs.

* Fix race conditions in unit tests.

* Tweaking unit tests.

* lower threshold more.

* lower threshold more.

* Fix deadlock in manager tests.

* rollback to previous

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Clayton Cornell <[email protected]>

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Paulin Todev <[email protected]>

* Docs PR feedback

* Update docs/sources/reference/components/prometheus/prometheus.remote.queue.md

Co-authored-by: Piotr <[email protected]>

* PR feedback

* PR feedback

* PR feedback

* PR feedback

* Fix typo

* Fix typo

* Fix bug.

* Fix docs

---------

Co-authored-by: William Dumont <[email protected]>
Co-authored-by: Piotr <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Paulin Todev <[email protected]>

* Change name to write instead of remote.

* Fix issue.

* Fix issue.

* Dont depend on random sync.pool behavior.

* small clarification on changelog.

* PR feedback

---------

Co-authored-by: Piotr <[email protected]>
Co-authored-by: William Dumont <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Paulin Todev <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants