in confgenerator/config.go [1041:1092]
func (uc *UnifiedConfig) loggingPipelines(ctx context.Context) ([]pipelineInstance, error) {
l := uc.Logging
if l == nil {
return nil, nil
}
receivers, err := uc.LoggingReceivers(ctx)
if err != nil {
return nil, err
}
exp_otlp := experimentsFromContext(ctx)["otlp_logging"]
exp_otel := l.Service.OTelLogging
var out []pipelineInstance
for _, pID := range sortedKeys(l.Service.Pipelines) {
p := l.Service.Pipelines[pID]
for _, rID := range p.ReceiverIDs {
receiver, ok := receivers[rID]
if !ok {
return nil, fmt.Errorf("logging receiver %q not found", rID)
}
var processors []struct {
id string
Component
}
for _, prID := range p.ProcessorIDs {
processor, ok := l.Processors[prID]
if !ok {
processor, ok = LegacyBuiltinProcessors[prID]
}
if !ok {
return nil, fmt.Errorf("processor %q not found", prID)
}
processors = append(processors, struct {
id string
Component
}{prID, processor})
}
instance := pipelineInstance{
pipelineType: "logs",
backend: backendFluentBit,
pID: pID,
rID: rID,
receiver: receiver,
processors: processors,
}
if exp_otel || (receiver.Type() == "otlp" && exp_otlp) {
instance.backend = backendOTel
}
out = append(out, instance)
}
}
return out, nil
}