metrics

package
v0.0.0-...-0efd123 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2020 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NAME_LABEL      = "name"
	INSTALLED_LABEL = "installed"
	NAMESPACE_LABEL = "namespace"
	CHANNEL_LABEL   = "channel"
	VERSION_LABEL   = "version"
	PHASE_LABEL     = "phase"
	REASON_LABEL    = "reason"
	PACKAGE_LABEL   = "package"
)

Variables

View Source
var (

	// exported since it's not handled by HandleMetrics
	CSVUpgradeCount = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "csv_upgrade_count",
			Help: "Monotonic count of CSV upgrades",
		},
	)

	SubscriptionSyncCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "subscription_sync_total",
			Help: "Monotonic count of subscription syncs",
		},
		[]string{NAME_LABEL, INSTALLED_LABEL, CHANNEL_LABEL, PACKAGE_LABEL},
	)
)

To add new metrics: 1. Register new metrics in Register() below. 2. Add appropriate metric updates in HandleMetrics (or elsewhere instead).

Functions

func CounterForSubscription

func CounterForSubscription(name, installedCSV, channelName, packageName string) prometheus.Counter

func RegisterCatalog

func RegisterCatalog()

func RegisterOLM

func RegisterOLM()

Types

type MetricsNil

type MetricsNil struct{}

func (*MetricsNil) HandleMetrics

func (*MetricsNil) HandleMetrics() error

type MetricsProvider

type MetricsProvider interface {
	HandleMetrics() error
}

TODO(alecmerdler): Can we use this to emit Kubernetes events?

func NewMetricsCatalogSource

func NewMetricsCatalogSource(client versioned.Interface) MetricsProvider

func NewMetricsInstallPlan

func NewMetricsInstallPlan(client versioned.Interface) MetricsProvider

func NewMetricsNil

func NewMetricsNil() MetricsProvider

func NewMetricsSubscription

func NewMetricsSubscription(client versioned.Interface) MetricsProvider

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL