From 8fac4e07daaf7f8d263262154b112fde2060f34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Tue, 21 Mar 2023 16:27:01 +0100 Subject: [PATCH] test(integration): only check tracing metrics if tracing is enabled --- tests/integration/helm_ot_default_test.go | 3 +++ .../integration/helm_otc_fips_metadata_installation_test.go | 2 ++ tests/integration/internal/constants.go | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/integration/helm_ot_default_test.go b/tests/integration/helm_ot_default_test.go index 280598d279..83db71a9ad 100644 --- a/tests/integration/helm_ot_default_test.go +++ b/tests/integration/helm_ot_default_test.go @@ -9,6 +9,9 @@ import ( func Test_Helm_Default_OT(t *testing.T) { expectedMetrics := internal.DefaultExpectedMetrics + // we have tracing enabled, so check tracing-specific metrics + expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) + installChecks := []featureCheck{ CheckSumologicSecret(11), CheckOtelcolMetadataLogsInstall, diff --git a/tests/integration/helm_otc_fips_metadata_installation_test.go b/tests/integration/helm_otc_fips_metadata_installation_test.go index e6ac490e02..be4db0f48f 100644 --- a/tests/integration/helm_otc_fips_metadata_installation_test.go +++ b/tests/integration/helm_otc_fips_metadata_installation_test.go @@ -9,6 +9,8 @@ import ( func Test_Helm_Default_OT_FIPS_Metadata(t *testing.T) { expectedMetrics := internal.DefaultExpectedMetrics + // we have tracing enabled, so check tracing-specific metrics + expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) installChecks := []featureCheck{ CheckSumologicSecret(11), diff --git a/tests/integration/internal/constants.go b/tests/integration/internal/constants.go index e218142682..6a41a6a776 100644 --- a/tests/integration/internal/constants.go +++ b/tests/integration/internal/constants.go @@ -161,7 +161,7 @@ var ( "node_load15", "node_cpu_seconds_total", } - OtelcolMetrics = []string{ + DefaultOtelcolMetrics = []string{ "otelcol_exporter_enqueue_failed_log_records", "otelcol_exporter_enqueue_failed_metric_points", "otelcol_exporter_enqueue_failed_spans", @@ -172,6 +172,8 @@ var ( "otelcol_process_runtime_total_alloc_bytes", "otelcol_process_runtime_total_sys_memory_bytes", "otelcol_process_uptime", + } + TracingOtelcolMetrics = []string{ "otelcol_loadbalancer_num_backend_updates", "otelcol_loadbalancer_num_backends", "otelcol_loadbalancer_num_resolutions", @@ -226,7 +228,7 @@ func InitializeConstants() error { } DefaultExpectedMetrics = []string{} - metricsGroupsWithOtelcol := append(DefaultExpectedMetricsGroups, OtelcolMetrics) + metricsGroupsWithOtelcol := append(DefaultExpectedMetricsGroups, DefaultOtelcolMetrics) for _, metrics := range metricsGroupsWithOtelcol { DefaultExpectedMetrics = append(DefaultExpectedMetrics, metrics...) }