Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDeduping Identical targets #884
Comments
This comment has been minimized.
This comment has been minimized.
|
My stance on this has always been that duplicate target configuration has to be resolved by the user. If targets are duplicate with different static labels, Prometheus cannot decide for you which one is "the right one". Could you elaborate why the very same target shows up in two distinct services for you? This doesn't seem like a desirable configuration to me. |
This comment has been minimized.
This comment has been minimized.
|
If at the end of all the SD and processing, there are completely identical duplicate targets among all jobs it seems reasonable to me to scrape only one of them. By identical I mean all labels, scheme, basic auth, interval, metrics path and anything else. Metric relabelling would be the one wrinkle to this. |
This comment has been minimized.
This comment has been minimized.
|
"seems reasonable" is not good enough given how invasive this change would be. Only with very good reasons where this problem occurs with sane SD setups. |
This comment has been minimized.
This comment has been minimized.
|
Our use case is as follows. We'd like to monitor Hadoop machines. We have a A simple Merge would fix it completely On Wed, Jul 8, 2015 at 1:28 PM, Fabian Reinartz notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
So is this about running the node exporter? If so, exporting node metrics has no direct relation to Hadoop running on them. Node exporters should probably have their own service. I assume you want to know that these nodes belong to your Hadoop cluster, which Consul tags and relabeling can solve for you. In my opinion it doesn't boil down to a "simple merge", unfortunately. But PRs are always welcome – a place to start would probably be to detach the scraping from the targets. |
This comment has been minimized.
This comment has been minimized.
|
I think this is a valid request. At SC we don't encounter this because our cookbook forces us to work around it anyway, by creating a single service discovery entry for every possible group we want to change. But I do see the need to "get the node-level statistics from all nodes of groups A and B" where A and B may or may not overlap. It is currently impossible to do this without either duplicating the intersection, or creating another entry for the overlap, which is nothing other than de-duplicating outside of Prometheus. To be clear, I think scraping the same instance from several jobs should not be merged, but if I specify dns_sd_configs:
- some_target.some_domain
- other_target.other_domainand one endpoint is listed in both SRV records, it should only be scraped and recorded once. The same goes for other SD methods. |
This comment has been minimized.
This comment has been minimized.
|
(actually, why isn't this deduplicating at the storage layer?) |
This comment has been minimized.
This comment has been minimized.
Getting two scrapes of the same target at different time offsets is going to be confusing, and can't be de-duplicated at the storage layer due to the different timestamps. |
This comment has been minimized.
This comment has been minimized.
|
But it should end up as one time series with double the sampling rate? @nikgrok could you describe how the duplication manifests for you? |
This comment has been minimized.
This comment has been minimized.
Yes. Probably interesting interactions with #394 too. |
This comment has been minimized.
This comment has been minimized.
|
Hey guys, Trying to restart this discussion. @matthiasr, Basically today if we use the consul config 2 services with a machine in both will be scraped 2 times Example: Hadoop Tasktrakcer Total scraped machines |
This comment has been minimized.
This comment has been minimized.
|
I guess the discussion ended at "but why is that so bad?". @fabxc can tell us how invasive the de-duping would be. |
This comment has been minimized.
This comment has been minimized.
|
Thanks to an in-person discussion with @matthiasr I better understand why the scenario in general is reasonable. The question indeed remains "but why is that so bad?". There is an increased sampling rate but no race or anything like that. Is the impact on the storage relevant? Scraping would essentially have to be detached from targets. This would solve the double scraping but the target would still be discovered multiple times. If the latter is the actual thing that's annoying people, there are easier ways to fix that at the UI level. @nikgrok It would be good to know which part actually causes frustration for you. |
This comment has been minimized.
This comment has been minimized.
|
I imagine multiple endpoints for storage will be created (in the case of 2 services with the 90% similarity), you are increasing the space required by 90%. Am I wrong about that? Also, it means that the collectors will be scraping 90% more and we already plan on really hammering prometheus. (Our hadoop infrastructure is 3.5k machines already) |
This comment has been minimized.
This comment has been minimized.
|
That sounds like a very legitimate use case. I'll try to get to this rather On Thu, Aug 6, 2015, 7:12 PM nikgrok notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
|
Why do you use the consul results for the tasktracker/datanode to discover node exporters? If you register a separate service for the node exporter, it would only be scraped once. Using your example, shouldn't it be:
EDIT: I understood @matthiasr's comment now. If it's about having a common label everywhere, an additional label could be applied to all three (datanode, tasktracker, node exporter) jobs? |
This comment has been minimized.
This comment has been minimized.
fabxc
added this to the v0.17.0 milestone
Sep 21, 2015
fabxc
self-assigned this
Sep 21, 2015
brian-brazil
added
the
feature-request
label
Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Fixed in 0.18.0rc1 |
fabxc
closed this
Apr 7, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
nikgrok commentedJul 8, 2015
Hey guys,
Today if you are using service discovery (consul), querying 2 services in one job will return you duplicate scrapes. If possible, can you make scrapes with the same address in the same job unique?