Skip to content

Commit

Permalink
test(integration): only check tracing metrics if tracing is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Świątek committed Mar 24, 2023
1 parent c4e0805 commit 8fac4e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/integration/helm_ot_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/helm_otc_fips_metadata_installation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/internal/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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...)
}
Expand Down

0 comments on commit 8fac4e0

Please sign in to comment.