yabeda-rb / yabeda

Extendable framework for collecting and exporting metrics from your Ruby application
MIT License
760 stars 25 forks source link

Export only desired metrics #21

Open surbhig213 opened 3 years ago

surbhig213 commented 3 years ago

Hey @Envek ,

Right now hitting /metrics displays all the default metrics. How can I restrict it to display only those metrics which I need?

Envek commented 3 years ago

Right now it is not possible to suppress export of some arbitrary metrics. All netrics collected in code running inside Sidekiq worker process, will be collected and exposed by yabeda-prometheus on /metrics endpoint of this process.

Can you please clarify, what are these “default” metrics you are talking about?

If you don't want to collect some of your custom metrics, you can place them inside unless ::Sidekiq.server? block.

surbhig213 commented 3 years ago

Hey @Envek , by default metrics I mean all the 'Local per-process metrics' and 'Global cluster-wide metrics' defined in the Readme file. My question is how can I export just a few of them and not all of them.

Envek commented 3 years ago

No, there is no way to do that currently. You can only disable the whole “Global cluster-wide metrics” group with collect_cluster_metrics setting.

But why do you need that? I still can't get the use case.

Envek commented 3 years ago

Transferred this issue to main yabeda repo as it's should be fixed there. Most probably we would like to support this metrics filtering in future.

surbhig213 commented 3 years ago

No, there is no way to do that currently. You can only disable the whole “Global cluster-wide metrics” group with collect_cluster_metrics setting.

But why do you need that? I still can't get the use case.

Thanks @Envek , My use case is that I have to export a limited number of metrics to wavefront as we have a limit on the number of metrics to be sent. So, I was just trying if I could limit it from here itself somehow.