From 84f5d11da4ce703a22db5acc36e3617e1a9f798c Mon Sep 17 00:00:00 2001 From: William Dumont Date: Thu, 31 Oct 2024 19:12:00 +0100 Subject: [PATCH] fix convert to debug component --- .../staticconvert/internal/build/builder_traces.go | 8 ++++---- .../internal/staticconvert/testdata/traces.alloy | 8 ++++++-- .../internal/staticconvert/testdata/unsupported.alloy | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/internal/converter/internal/staticconvert/internal/build/builder_traces.go b/internal/converter/internal/staticconvert/internal/build/builder_traces.go index da402f5fd..7377a8905 100644 --- a/internal/converter/internal/staticconvert/internal/build/builder_traces.go +++ b/internal/converter/internal/staticconvert/internal/build/builder_traces.go @@ -69,12 +69,12 @@ func (b *ConfigBuilder) translateAutomaticLogging(otelCfg *otelcol.Config, cfg t "A best effort translation can be made which only outputs to stdout and not directly to loki by bypassing errors.") } - // Add the logging exporter to the otel config with default values - otelCfg.Exporters[otel_component.NewID(otel_component.MustNewType("logging"))] = debugexporter.NewFactory().CreateDefaultConfig() + // Add the debug exporter to the otel config with default values + otelCfg.Exporters[otel_component.NewID(otel_component.MustNewType("debug"))] = debugexporter.NewFactory().CreateDefaultConfig() - // Add the logging exporter to all pipelines + // Add the debug exporter to all pipelines for _, pipeline := range otelCfg.Service.Pipelines { - pipeline.Exporters = append(pipeline.Exporters, otel_component.NewID(otel_component.MustNewType("logging"))) + pipeline.Exporters = append(pipeline.Exporters, otel_component.NewID(otel_component.MustNewType("debug"))) } // Remove the custom automatic_logging processor diff --git a/internal/converter/internal/staticconvert/testdata/traces.alloy b/internal/converter/internal/staticconvert/testdata/traces.alloy index 9a77939a5..5bfde72da 100644 --- a/internal/converter/internal/staticconvert/testdata/traces.alloy +++ b/internal/converter/internal/staticconvert/testdata/traces.alloy @@ -142,7 +142,9 @@ otelcol.exporter.loadbalancing "_0_default" { } } -otelcol.exporter.debug "_0_default" { } +otelcol.exporter.debug "_0_default" { + verbosity = "Basic" +} otelcol.connector.spanmetrics "_0_default" { histogram { @@ -220,7 +222,9 @@ otelcol.exporter.otlp "_1_0" { } } -otelcol.exporter.debug "_1_default" { } +otelcol.exporter.debug "_1_default" { + verbosity = "Basic" +} otelcol.connector.spanmetrics "_1_default" { histogram { diff --git a/internal/converter/internal/staticconvert/testdata/unsupported.alloy b/internal/converter/internal/staticconvert/testdata/unsupported.alloy index 499953b2d..b4da0fac4 100644 --- a/internal/converter/internal/staticconvert/testdata/unsupported.alloy +++ b/internal/converter/internal/staticconvert/testdata/unsupported.alloy @@ -76,4 +76,6 @@ otelcol.exporter.otlp "default_0" { } } -otelcol.exporter.debug "default" { } +otelcol.exporter.debug "default" { + verbosity = "Basic" +}