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 upRFE: PromQL primitives for sampling #4172
Comments
This comment has been minimized.
This comment has been minimized.
|
I don't see how this would work sanely semantically, nor how it would be a real performance improvement as we'd still need to pull in all the data. |
This comment has been minimized.
This comment has been minimized.
|
I think there are two things to consider here:
InfluxDB's implementation uses reservoir sampling to achieve O(n) performance for their |
This comment has been minimized.
This comment has been minimized.
|
Even if you could figure out how to do it sanely from a stats standpoint, there's no point in random sampling performance wise as you could do any aggregation you want for the same (or more likely less) resources. Is there a particular use case you have in mind?
If you want to do that you can do it on top of our existing APIs. |
brian-brazil
added
priority/Pmaybe
component/promql
labels
Jun 13, 2018
This comment has been minimized.
This comment has been minimized.
|
If you can explain your exact use case we can see if it makes sense, but I'm going to close for now as I can't think of one. |
brian-brazil
closed this
Jun 13, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
xginn8 commentedMay 17, 2018
Proposal
When collecting data from large populations, it is often useful to sample from the population rather than aggregating into a single metric. This operation is more resource-friendly, as well as often more descriptive of the actual population distribution (as the data can be full-fidelity without much performance impact).
Popular TSDBs provide a similar function:
InfluxDB: https://docs.influxdata.com/influxdb/v1.5/query_language/functions/#sample
CrateDB: https://crate.io/docs/crate/reference/en/latest/general/builtins/scalar.html#random
If the maintainers are amenable to this query function, I'm happy to take a stab at implementing it.