-
Notifications
You must be signed in to change notification settings - Fork 2.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
[exporter/prometheusremotewrite] remote_write_queue num_consumers hard-coded at 1 #30765
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello @tredman, it looks like there were some follow up issues and changes to the one you referenced that added back in a subset of the queue retry capabilities. Relevant PRs: open-telemetry/opentelemetry-collector#2974, open-telemetry/opentelemetry-collector#3046.
I'm not familiar enough with this exporter to say whether this is an overall design flaw or a strict requirement, I'll have to defer to someone else. |
This is the relevant comment explaining the hard coded consumer size which was linked in the original issue. You can still use |
Speaking from experience, there are a few places where the PRWE could be improved to increase performance. There can be a bottleneck in the PRWE when handling large batch sizes. The PRWE translates batches from OTLP -> Prometheus format in a single threaded manner. Signs that this is happening are |
Thanks for the quick response! I see the code you pointed out where num_consumers gets passed in to set concurrency so I'll read up on that code path. It's odd that for me, adjusting num_consumers has had no effect on throughput to the remote write endpoint. I've tried ranges from 5 to 1000. I see here that the code actually takes the min value of (concurrency, len(requests)) when fanning out so it makes me think I am running into a batch size issue or something of that nature. In practice, the only knob I've been able to turn to increase throughput here and prevent the retry queue from filling is upstream, via a batch processor. With a large enough batch size (5000) I'm able to keep up with the metrics load (regardless of what i set for
Thanks, this is good info. In your experience what is a large batch size? In my case I am starting to wonder if the downstream workers are actually being starved by feeding insufficiently large batches to PRWE. That might explain why I've seen an increase in throughput by increasing the batch sizes in the batch processor. |
It's really use case dependent but like 40k+ can be quite large. The default batch processor configuration does not cap batch size, so unless you explicitly configure
Can you explain a bit more on what you mean by What kind of load is going through your collector? Do you have any metrics to help us understand the scale you are operating at? |
Sure, this is what I have set currently:
at
Yeah to give some more context here, I'm trying to determine if we can replace an existing prometheus agent with an OTEL collector. We're planning to use collectors for other use cases and it would be ideal if it could handle some existing workloads currently handled by prometheus agents and reduce the number of tools we're using. I have them in running in parallel and was working through the process of configuring the OTEL collector to scrape the same data as the prometheus, when I started seeing the OTEL collector drop data. These graphs are from Amazon Managed Prometheus metrics in CloudWatch. The green line is the data we're ingesting from the existing prometheus agent. The blue line is the OTEL collector. Rates here are per minute. I'm actually looking to hit 3x the current load to reach "parity" here. Note these are writing to separate AMP workspaces so I don't think we're hitting throughput limits on the remote endpoint itself. |
Yeah, I believe setting the batch size too low will have the inverse effect also! So there can be a sweet spot between too large or too small batches. From what I have seen the default |
Are both the prometheus agent and collector doing the same work at the moment? Or is the collector only receiving a subset of the metrics. Scrape jobs I presume? |
The collector is doing a subset of the work, that's correct. There are a few somewhat complicated scrape jobs I need to replicate but I needed to resolve these dropped metrics first.
thanks, I'll give that a try. I learned today that the default batch size is pretty high (8192) so I've been pretty conservative with my configuration so far. I'll see if I can just be more aggressive here. |
I've found the the batch processor emits some good metrics to help with this. Observing those over time along with the queue size/cpu/mem usage is very helpful. |
Going to close this since my initial report was not accurate. Thanks for the assist folks! I was able to reach parity with my prometheus implementation by just adjusting the batch size. :) Also throwing this out there in case anyone happens to stumble on this issue, if you're using the OTEL operator like we are, you can actually scale your prometheus receivers horizontally. The TargetAllocator will handle distributing jobs to the collectors. I didn't need to do this to handle the throughput here but it's a potential option if you exhaust the total throughput of a single collector. |
Awesome to hear! I didn't want to dig into your setup quite yet but I would have totally suggested the target allocator if I knew you were on k8s! |
Component(s)
exporter/prometheusremotewrite
Describe the issue you're reporting
Wasn't sure whether to file this as a bug or feature request. It seems that due to issue 2949 the ability to configure the number of consumers was deliberately removed and
num_consumers
was set to 1. I believe this is the relevant code.However, the README still describes this as configurable:
I discovered this today while trying to understand why my collector was filling its queue and then dropping metrics, while a prometheus agent I had running in parallel was processing all metrics without issue (at a rate of approximately 3300/second). Without the ability to increase the number of consumers and send more batches in parallel, the throughput using this exporter is significantly limited. It seems like what's needed here is a way to distribute samples across consumers without violating the requirement that they be in chronological order, which is probably more feature development than bug fix but I'll let folks here decide. :)
The text was updated successfully, but these errors were encountered: