metrics

package
v1.17.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 33 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnabledMetrics []api.NamedHandler
	Registry       = prometheus.NewPedanticRegistry()
)
View Source
var (
	RequestsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: api.DefaultPrometheusNamespace,
		Name:      "metrics_http_handler_requests_total",
		Help:      "A counter for requests to Hubble metrics handler.",
	}, []string{"code"})
	RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: api.DefaultPrometheusNamespace,
		Name:      "metrics_http_handler_request_duration_seconds",
		Help:      "A histogram of latencies of Hubble metrics handler.",
	}, []string{"code"})
)

Metrics related to Hubble metrics HTTP requests handling

View Source
var (
	LostEvents = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: api.DefaultPrometheusNamespace,
		Name:      "lost_events_total",
		Help:      "Number of lost events",
	}, []string{labelSource})
)

Additional metrics - they're not counting flows, so are not served via Hubble metrics API, but belong to the same Prometheus namespace.

Functions

func InitHubbleInternalMetrics

func InitHubbleInternalMetrics(reg *prometheus.Registry, grpcMetrics *grpc_prometheus.ServerMetrics) error

func InitMetricHandlers

func InitMetricHandlers(reg *prometheus.Registry, enabled *api.Config) (*[]api.NamedHandler, error)

func InitMetrics

func InitMetrics(reg *prometheus.Registry, enabled *api.Config, grpcMetrics *grpc_prometheus.ServerMetrics) error

InitMetrics initializes the metrics system

func InitMetricsServerHandler

func InitMetricsServerHandler(srv *http.Server, reg *prometheus.Registry, enableOpenMetrics bool)

func NewMetricConfigWatcher

func NewMetricConfigWatcher(
	configFilePath string,
	callback func(ctx context.Context, hash uint64, config api.Config),
) *metricConfigWatcher

NewmetricConfigWatcher creates a config watcher instance. Config watcher notifies DynamicFlowProcessor when config file changes and dynamic metric config should be reconciled.

func ProcessCiliumEndpointDeletion added in v1.15.7

func ProcessCiliumEndpointDeletion(pod *types.CiliumEndpoint) error

func StartMetricsServer

func StartMetricsServer(srv *http.Server, log logrus.FieldLogger, metricsTLSConfig *certloader.WatchedServerConfig, grpcMetrics *grpc_prometheus.ServerMetrics) error

Types

type CiliumEndpointDeletionHandler added in v1.15.7

type CiliumEndpointDeletionHandler struct {
	// contains filtered or unexported fields
}

type DynamicFlowProcessor

type DynamicFlowProcessor struct {
	Metrics []api.NamedHandler
	// contains filtered or unexported fields
}

DynamicFlowProcessor represents instance of hubble exporter with dynamic configuration reload.

func NewDynamicFlowProcessor

func NewDynamicFlowProcessor(reg *prometheus.Registry, logger logrus.FieldLogger, configFilePath string) *DynamicFlowProcessor

NewDynamicFlowProcessor creates instance of dynamic hubble flow exporter.

func (*DynamicFlowProcessor) OnDecodedFlow

func (d *DynamicFlowProcessor) OnDecodedFlow(ctx context.Context, flow *flowpb.Flow) (bool, error)

OnDecodedEvent distributes events across all managed exporters.

func (*DynamicFlowProcessor) Stop

func (d *DynamicFlowProcessor) Stop() error

Stop stops configuration watcher and all deinitializes all metric handlers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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