kubernetes: github.com/bboreham/kubernetes/pkg/client/metrics Index | Files

package metrics

import "github.com/bboreham/kubernetes/pkg/client/metrics"

Package metrics provides utilities for registering client metrics to Prometheus.

Index

Package Files

metrics.go

Variables

var (
    // RequestLatency is a Prometheus Summary metric type partitioned by
    // "verb" and "url" labels. It is used for the rest client latency metrics.
    RequestLatency = prometheus.NewSummaryVec(
        prometheus.SummaryOpts{
            Subsystem: restClientSubsystem,
            Name:      "request_latency_microseconds",
            Help:      "Request latency in microseconds. Broken down by verb and URL",
            MaxAge:    time.Hour,
        },
        []string{"verb", "url"},
    )

    RequestResult = prometheus.NewCounterVec(
        prometheus.CounterOpts{
            Subsystem: restClientSubsystem,
            Name:      "request_status_codes",
            Help:      "Number of http requests, partitioned by metadata",
        },
        []string{"code", "method", "host"},
    )
)

func Register Uses

func Register()

Register registers all metrics to Prometheus with respect to the RequestLatency.

func SinceInMicroseconds Uses

func SinceInMicroseconds(start time.Time) float64

Calculates the time since the specified start in microseconds.

Package metrics imports 3 packages (graph). Updated 2017-08-28. Refresh now. Tools for package owners. This is a quick bug-fix fork (has fewer than three commits, and only during the week it was created).