Open benoittgt opened 5 months ago
Add marking and sweeping time as GC stats. It was introduced in https://bugs.ruby-lang.org/issues/19437
I think we should also add GC.latest_gc_info[:major_by]. I can do it in another PR.
GC.latest_gc_info[:major_by]
--- a/lib/prometheus_exporter/instrumentation/process.rb +++ b/lib/prometheus_exporter/instrumentation/process.rb @@ -65,6 +65,7 @@ module PrometheusExporter::Instrumentation metric[:allocated_objects_total] = stat[:total_allocated_objects] metric[:marking_time] = stat[:marking_time] metric[:sweeping_time] = stat[:sweeping_time] + metric[:last_major_by] = GC.latest_gc_info[:major_by]
We could store it as a last state like kube-state-metrics does for pod last state. It's a fast method. At the moment it's not possible because gauge are only numeric in prometheus_exporter.
cc @mtparet @byroot
should we only add the matrics on Ruby versions that have it?
@SamSaffron Yes it's a good idea. I made the change. Do we want to test this?
Add marking and sweeping time as GC stats. It was introduced in https://bugs.ruby-lang.org/issues/19437
I think we should also add
GC.latest_gc_info[:major_by]
. I can do it in another PR.We could store it as a last state like kube-state-metrics does for pod last state. It's a fast method. At the moment it's not possible because gauge are only numeric in prometheus_exporter.
cc @mtparet @byroot