Limit which instances are collected #867
-
We have a use case where we are collecting file lock statistics for a specific vserver. I have built the following template to collect lock stats: name: Locks collect_only_labels: true counters: export_options: The above template collects all the locks in the cluster, and there may be hundreds of thousands of them. Is there any way to limit which instances are collected, to reduce load on cluster? For example, limit collection to only a specific vserver or volume? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
hi @luddite516 that's a great question. ZAPIs have the ability to filter results that way, but Harvest doesn't currently expose that kind of filtering via our template language. We'll take a look at adding that. The best workaround at the moment, would be to create a new collector that adds the appropriate |
Beta Was this translation helpful? Give feedback.
-
Thanks @cgrinds . I follow what you are saying- basically copy the zapi collector to a local custom collector, and tweak the code a workaround. This (the ability to add ZAPI constraints to queries) feels a little bit like feature-creep. It would provide limited value and would likely make the templates more complex. But let's see if anyone else has a need for this. |
Beta Was this translation helpful? Give feedback.
-
hi @luddite516 try increasing the I think this is what you outlined above, but to make sure I understood, you can also more narrowly target this by creating a Prometheus exporter (with the increased |
Beta Was this translation helpful? Give feedback.
hi @luddite516 that's a great question. ZAPIs have the ability to filter results that way, but Harvest doesn't currently expose that kind of filtering via our template language. We'll take a look at adding that.
The best workaround at the moment, would be to create a new collector that adds the appropriate
query
to the ZAPI request. If you're interested in trying that, we can point you in the right direction to make the changes while we pickup the template-level changes.