Skip to content

Commit

Permalink
fix convert to debug component
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Oct 31, 2024
1 parent 687acd9 commit 84f5d11
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ otelcol.exporter.otlp "default_0" {
}
}

otelcol.exporter.debug "default" { }
otelcol.exporter.debug "default" {
verbosity = "Basic"
}

0 comments on commit 84f5d11

Please sign in to comment.