flowcontrol

package
v0.0.0-...-0339415 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

End-to-End Tests for Log Flow Control LOG-1043: Log Flow Control API Enhancement

In all the tests, we create logstressor pods which generate logs at a certain rate. We define ClusterLogging and ClusterLoggingForwarder Spec with defined policies. We expect the rate of logs flowing through the pipeline to be equal to the threshold set in the CLF Spec policies. To get stable metrics, we take average rate of metrics over a time window of 2 minutes. So, we wait for 30s after vector metrics first starts showing up on Prometheus Dashboard.

The following cases have been covered for the respective components in E2E Tests: - Rate limit application logs (selected by namespace) by applying policy at the group level - Rate limit application logs (selected by namespace) by applying policy at the container level - Rate limit logs sent to loki - Rate limits applied to all application logs (group level) and Loki

Index

Constants

View Source
const (
	SecretName = `oc get secret -n openshift-monitoring -o name | grep  prometheus-k8s-token* | head -n 1 | grep -o prometheus-k8s.*` //nolint:gosec
	Token      = `oc get secret %s -n openshift-monitoring -o jsonpath={.data.token} | base64 -d`                                     //nolint:gosec
	ThanosHost = `oc get route thanos-querier -n openshift-monitoring -o jsonpath={.spec.host}`

	VectorCompSentEvents = `rate(vector_component_sent_events_total{component_name="%s"}[30s])`
	VectorUpTotal        = `vector_started_total`
)

Variables

This section is empty.

Functions

func ExecuteCmd

func ExecuteCmd(cmd string) (_ string, err error)

func ExpectMetricsWithinRange

func ExpectMetricsWithinRange(prometheusResponse map[string]interface{}, lower, upper float64)

func GetCollectorMetrics

func GetCollectorMetrics(metric string) map[string]interface{}

func QueryPrometheus

func QueryPrometheus(host, token, query string) map[string]interface{}

func WaitForMetricsToShow

func WaitForMetricsToShow() bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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