-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[receiver] Create helper for server-like receivers to replace memory_limiter processor #8632
Comments
Hey @dmitryax and @mx-psi ,we are helping out with the http use cases and want to confirm a few things: the suggestion was to build a receiver helper method to wrap the log consumption with memory limiter. But this means the memory limiting is handled post HTTP connections creation and receiving the data on the server. This still poses problem on too many resources used. Instead, there should be some kinds of http interceptor(similar to authInterceptor) with memory limiter baked in. So users can just plug it in when they spawn the http server. Is my understanding correct? |
An interceptor sounds like a good approach. We should keep the requirements in mind (I wrote a list on the original post, we can discuss them if they are too stringent but they seem like a reasonable list for starting to think about this) |
@mx-psi I am not sure if this is the right approach, here are some use-cases that would be good the new design (if any) should cover:
I personally think we should actually adopt the grpc status (which is actually inside Google called Task::Status because they are generic enough for almost all use-cases including disk operations, RPCs, etc.) and return a error like Status from our Consumer funcs. Then we the receiver can read these "canonical" codes and do what is appropriate for them. I know that in some scenarios, we may be able for example for memory to reduce the pressure earlier (e.g. if it is a http.Handler may reject the request before parsing/uncompressing etc.), but I see this as an optimization of the more generic problem we have right now, which is that we don't have a set of canonical codes/errors that we return from the pipeline components to better understand/react upstream. |
To clarify the reported issue, right now, the I like the idea of standardizing on the gRPC codes in the collector, as @bogdandrutu suggested. However, I think this probably can be scoped as a separate effort. If we define that using I think the problem that this issue should solve is that the |
…orylimiter processor (#8964) **Description:** Following #8632, this change introduces memory limiter as an extension. This allows us to place the component to reject incoming connections due to limited memory, providing better protection from running out of memory. missing feature: receiver fairness. issue where a receiver hogs all the resource can happen. **Link to tracking Issue:** <Issue number if applicable> #8632 --------- Co-authored-by: Dmitry Anoshin <[email protected]>
I am going to remove this from the Collector 1.0 project. This is an useful enhancement but I feel is not in scope because it's an enhancement and can be done without breaking changes and we already have (more limited) way of handling this |
The
memory_limiter
processor allows end-users to drop telemetry data when a memory limit is reached. It is up to receivers to apply backpressure and handle retrying of errors.A large class of receivers spin up one or more servers that listen for telemetry in a particular format, map to pdata and send it along to the next consumer. For protocols like HTTP and gRPC there are standard ways (429, RESOURCE_EXHAUSTED) to report the memory has been exhausted and apply backpressure to clients.
We should build a server receiver helper that handles this. In particular it should:
Having this helper available and tackling this for scraper helpers may remove the need of a
memory_limiter
processor.The text was updated successfully, but these errors were encountered: