metrics

package
v1.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricsPath is the endpoint to collect application metrics
	MetricsPath = "/metrics"
	// EnvVarLegacyControllerMetrics is a env var to re-enable deprecated prometheus metrics
	EnvVarLegacyControllerMetrics = "ARGOCD_LEGACY_CONTROLLER_METRICS"
)

Variables

This section is empty.

Functions

func AddMetricsTransportWrapper added in v1.0.0

func AddMetricsTransportWrapper(server *MetricsServer, app *v1alpha1.Application, config *rest.Config) *rest.Config

AddMetricsTransportWrapper adds a transport wrapper which increments 'argocd_app_k8s_request_total' counter on each kubernetes request

func NewAppCollector

func NewAppCollector(appLister applister.ApplicationLister) prometheus.Collector

NewAppCollector returns a prometheus collector for application metrics

func NewAppRegistry

func NewAppRegistry(appLister applister.ApplicationLister) *prometheus.Registry

NewAppRegistry creates a new prometheus registry that collects applications

Types

type ClusterInfo added in v1.4.0

type ClusterInfo struct {
	Server            string
	K8SVersion        string
	ResourcesCount    int
	APIsCount         int
	LastCacheSyncTime *time.Time
}

type HasClustersInfo added in v1.4.0

type HasClustersInfo interface {
	GetClustersInfo() []ClusterInfo
}

type MetricsServer

type MetricsServer struct {
	*http.Server
	// contains filtered or unexported fields
}

func NewMetricsServer

func NewMetricsServer(addr string, appLister applister.ApplicationLister, healthCheck func() error) *MetricsServer

NewMetricsServer returns a new prometheus server which collects application metrics

func (*MetricsServer) DecKubectlExecPending added in v1.2.1

func (m *MetricsServer) DecKubectlExecPending(command string)

func (*MetricsServer) IncClusterEventsCount added in v1.4.0

func (m *MetricsServer) IncClusterEventsCount(server, group, kind string)

IncClusterEventsCount increments the number of cluster events

func (*MetricsServer) IncKubectlExec added in v1.2.1

func (m *MetricsServer) IncKubectlExec(command string)

func (*MetricsServer) IncKubectlExecPending added in v1.2.1

func (m *MetricsServer) IncKubectlExecPending(command string)

func (*MetricsServer) IncKubernetesRequest added in v1.0.0

func (m *MetricsServer) IncKubernetesRequest(app *argoappv1.Application, server, statusCode, verb, resourceKind, resourceNamespace string)

IncKubernetesRequest increments the kubernetes requests counter for an application

func (*MetricsServer) IncReconcile

func (m *MetricsServer) IncReconcile(app *argoappv1.Application, duration time.Duration)

IncReconcile increments the reconcile counter for an application

func (*MetricsServer) IncSync

func (m *MetricsServer) IncSync(app *argoappv1.Application, state *argoappv1.OperationState)

IncSync increments the sync counter for an application

func (*MetricsServer) RegisterClustersInfoSource added in v1.4.0

func (m *MetricsServer) RegisterClustersInfoSource(ctx context.Context, source HasClustersInfo)

Jump to

Keyboard shortcuts

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