Documentation ¶
Index ¶
- Constants
- func AddMetricsTransportWrapper(server *MetricsServer, app *v1alpha1.Application, config *rest.Config) *rest.Config
- func NewAppCollector(appLister applister.ApplicationLister, appFilter func(obj interface{}) bool) prometheus.Collector
- func NewAppRegistry(appLister applister.ApplicationLister, appFilter func(obj interface{}) bool) *prometheus.Registry
- type HasClustersInfo
- type MetricsServer
- func (m *MetricsServer) DecKubectlExecPending(command string)
- func (m *MetricsServer) HasExpiration() bool
- func (m *MetricsServer) IncClusterEventsCount(server, group, kind string)
- func (m *MetricsServer) IncKubectlExec(command string)
- func (m *MetricsServer) IncKubectlExecPending(command string)
- func (m *MetricsServer) IncKubernetesRequest(app *argoappv1.Application, ...)
- func (m *MetricsServer) IncReconcile(app *argoappv1.Application, duration time.Duration)
- func (m *MetricsServer) IncRedisRequest(failed bool)
- func (m *MetricsServer) IncSync(app *argoappv1.Application, state *argoappv1.OperationState)
- func (m *MetricsServer) ObserveRedisRequestDuration(duration time.Duration)
- func (m *MetricsServer) RegisterClustersInfoSource(ctx context.Context, source HasClustersInfo)
- func (m *MetricsServer) SetExpiration(cacheExpiration time.Duration) error
Constants ¶
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 ¶
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, appFilter func(obj interface{}) bool) prometheus.Collector
NewAppCollector returns a prometheus collector for application metrics
func NewAppRegistry ¶
func NewAppRegistry(appLister applister.ApplicationLister, appFilter func(obj interface{}) bool) *prometheus.Registry
NewAppRegistry creates a new prometheus registry that collects applications
Types ¶
type HasClustersInfo ¶
type HasClustersInfo interface {
GetClustersInfo() []cache.ClusterInfo
}
type MetricsServer ¶
func NewMetricsServer ¶
func NewMetricsServer(addr string, appLister applister.ApplicationLister, appFilter func(obj interface{}) bool, healthCheck func(r *http.Request) error) (*MetricsServer, error)
NewMetricsServer returns a new prometheus server which collects application metrics
func (*MetricsServer) DecKubectlExecPending ¶
func (m *MetricsServer) DecKubectlExecPending(command string)
func (*MetricsServer) HasExpiration ¶
func (m *MetricsServer) HasExpiration() bool
HasExpiration return true if expiration is set
func (*MetricsServer) IncClusterEventsCount ¶
func (m *MetricsServer) IncClusterEventsCount(server, group, kind string)
IncClusterEventsCount increments the number of cluster events
func (*MetricsServer) IncKubectlExec ¶
func (m *MetricsServer) IncKubectlExec(command string)
func (*MetricsServer) IncKubectlExecPending ¶
func (m *MetricsServer) IncKubectlExecPending(command string)
func (*MetricsServer) IncKubernetesRequest ¶
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) IncRedisRequest ¶
func (m *MetricsServer) IncRedisRequest(failed bool)
func (*MetricsServer) IncSync ¶
func (m *MetricsServer) IncSync(app *argoappv1.Application, state *argoappv1.OperationState)
IncSync increments the sync counter for an application
func (*MetricsServer) ObserveRedisRequestDuration ¶
func (m *MetricsServer) ObserveRedisRequestDuration(duration time.Duration)
ObserveRedisRequestDuration observes redis request duration
func (*MetricsServer) RegisterClustersInfoSource ¶
func (m *MetricsServer) RegisterClustersInfoSource(ctx context.Context, source HasClustersInfo)
func (*MetricsServer) SetExpiration ¶
func (m *MetricsServer) SetExpiration(cacheExpiration time.Duration) error
SetExpiration reset Prometheus metrics based on time duration interval