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
- func ExecuteCmd(cmd string) (_ string, err error)
- func ExpectMetricsWithinRange(prometheusResponse map[string]interface{}, lower, upper float64)
- func GetCollectorMetrics(metric string) map[string]interface{}
- func QueryPrometheus(host, token, query string) map[string]interface{}
- func WaitForMetricsToShow() bool
Constants ¶
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 GetCollectorMetrics ¶
func QueryPrometheus ¶
func WaitForMetricsToShow ¶
func WaitForMetricsToShow() bool
Types ¶
This section is empty.