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

[Feature Request] Buffer Fill Percentage #1817

Closed
cmanning09 opened this issue Sep 27, 2022 · 4 comments · Fixed by #1882
Closed

[Feature Request] Buffer Fill Percentage #1817

cmanning09 opened this issue Sep 27, 2022 · 4 comments · Fixed by #1882
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cmanning09
Copy link
Contributor

cmanning09 commented Sep 27, 2022

Is your feature request related to a problem? Please describe.
Buffer fill percentage is the primary indicator for horizontal scaling for data prepper. However, the metrics reported by micrometer are with a gauge and with no concept of upper bounds as defined in the pipeline configuration. Determining when to scale and reviewing metrics in a dashboards requires knowledge of the blockingBuffer pipeline configuration buffer size values in relation to the current blockingBuffer.recordsInBuffer metric value.

Describe the solution you'd like
A new metrics for blockingBuffer.bufferUsage` which tracks the utilization rate of the buffer based on the number of records in the buffer and the buffer size.

Describe alternatives you've considered (Optional)

  • publishing the buffer size would be an alternative. Users could then perform calculations on their dashboards.
@dlvenable dlvenable added this to the v2.0 milestone Sep 28, 2022
@dlvenable dlvenable added enhancement New feature or request and removed untriaged labels Sep 28, 2022
@dlvenable
Copy link
Member

I think this is a useful approach and it follows other metrics such as CPU usage. I take it that this going to be a per-buffer metric. Do you think there is value for supporting a more aggregate metric in the future? Perhaps maximum bufferUsage?

@cmanning09
Copy link
Contributor Author

I was initially thinking per buffer is sufficient enough for now. There may be value in a buffer usage across pipelines however we would need to create a standard metric name across the service. Ideally if we support a more persistent buffer solution we may be able to generalize the buffer across pipelines. Again all for the future though.

@cmanning09
Copy link
Contributor Author

cmanning09 commented Sep 28, 2022

Should all buffer plugins support this metric? This would require standardizing buffer plugins to have max buffer size or capacity attribute (bufferCapacity). This attribute would allow the AbstractBuffer to calculate the usage percentage based on the recordsInBuffer and bufferCapacity. I am thinking about extending the buffer interface to include a public Integer getBufferCapacity() method. For Example:

private final AtomicLong bufferUsage;
...

     public void write(T record, int timeoutInMillis) throws TimeoutException {

            ...
            final long currentRecords = recordsInBuffer.incrementAndGet();
            bufferUsage.set(currentRecords / this.getBufferCapacity());
            ...

Alternatively I could create this metric just for the blockingBuffer and we can decide if want to standardize later.

@dlvenable
Copy link
Member

I think we should start with blockingBuffer for now. If we do extend this behavior, it could be part of AbstractBuffer, but I'd be hesitant to add a buffer capacity to any Buffer. Some buffers might be so large as to have no specific capacity if they used an external system.

@cmanning09 cmanning09 added this to Untriaged in (deprecated) Tracking Board via automation Oct 5, 2022
@cmanning09 cmanning09 self-assigned this Oct 5, 2022
@cmanning09 cmanning09 moved this from Untriaged to In review in (deprecated) Tracking Board Oct 5, 2022
(deprecated) Tracking Board automation moved this from In review to Done Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants