github.com/cozy/cozy-stack@v0.0.0-20240603063001-31110fa4cae1/pkg/metrics/http.go (about)

     1  package metrics
     2  
     3  import "github.com/prometheus/client_golang/prometheus"
     4  
     5  // HTTPTotalDurations is a summary metric of the durations of http requests,
     6  // labelled by method and status code
     7  var HTTPTotalDurations = prometheus.NewSummaryVec(
     8  	prometheus.SummaryOpts{
     9  		Namespace: "http",
    10  		Subsystem: "all",
    11  		Name:      "total_duration",
    12  
    13  		Help: "Durations of http requests, labelled by method and status code",
    14  
    15  		Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
    16  	},
    17  	[]string{"method", "code"},
    18  )
    19  
    20  func init() {
    21  	prometheus.MustRegister(HTTPTotalDurations)
    22  }