github.com/grafana/pyroscope@v1.18.0/pkg/segmentwriter/client/distributor/placement/adaptiveplacement/placement_agent_metrics.go (about)

     1  package adaptiveplacement
     2  
     3  import (
     4  	"github.com/prometheus/client_golang/prometheus"
     5  )
     6  
     7  type agentMetrics struct {
     8  	lag prometheus.Gauge
     9  }
    10  
    11  func newAgentMetrics(reg prometheus.Registerer) *agentMetrics {
    12  	m := &agentMetrics{
    13  		lag: prometheus.NewGauge(prometheus.GaugeOpts{
    14  			Name: "pyroscope_adaptive_sharding_rules_update_lag_seconds",
    15  			Help: "Delay in seconds since the last update of the placement rules.",
    16  		}),
    17  	}
    18  	if reg != nil {
    19  		reg.MustRegister(m.lag)
    20  	}
    21  	return m
    22  }