-
Notifications
You must be signed in to change notification settings - Fork 193
Description
Right now the only supported output type is Elasticsearch:
OtelSupportedOutputTypes = []string{"elasticsearch"} |
Components are however split between the sub-process and otel runtime based solely on the feature flag state right now:
elastic-agent/internal/pkg/agent/application/coordinator/coordinator.go
Lines 1683 to 1687 in 889c6d3
switch comp.RuntimeManager { | |
case component.OtelRuntimeManager: | |
otelComponents = append(otelComponents, comp) | |
case component.ProcessRuntimeManager: | |
runtimeComponents = append(runtimeComponents, comp) |
When an unsupported output is used with Beats receivers, it is sent to the OTel configuration manager which will detect it can't correctly translate configurations with the unsupported output type and simply not run it. This will break users using non-Elasticsearch outputs (Kafka, Logstash) today when we default agent monitoring to use beats receivers by default.
elastic-agent/internal/pkg/otel/manager/manager.go
Lines 305 to 312 in 889c6d3
if len(cfgUpdate.components) > 0 { | |
model := &component.Model{Components: cfgUpdate.components} | |
var err error | |
componentOtelCfg, err = translate.GetOtelConfig(model, agentInfo, monitoringConfigGetter) | |
if err != nil { | |
return nil, fmt.Errorf("failed to generate otel config: %w", err) | |
} | |
} |
elastic-agent/internal/pkg/otel/translate/otelconfig.go
Lines 87 to 95 in 889c6d3
// getSupportedComponents returns components from the given model that can be run in an Otel Collector. | |
func getSupportedComponents(model *component.Model) []*component.Component { | |
var supportedComponents []*component.Component | |
for _, comp := range model.Components { | |
if IsComponentOtelSupported(&comp) { | |
supportedComponents = append(supportedComponents, &comp) | |
} | |
} |
elastic-agent/internal/pkg/otel/translate/otelconfig.go
Lines 81 to 86 in 889c6d3
// IsComponentOtelSupported checks if the given component can be run in an Otel Collector. | |
func IsComponentOtelSupported(comp *component.Component) bool { | |
return slices.Contains(OtelSupportedOutputTypes, comp.OutputType) && | |
slices.Contains(OtelSupportedInputTypes, comp.InputType) | |
} | |
Acceptance Criteria
- A test exists proving that a configuration using either of the unsupported Logstash or Kafka outputs as the monitoring output when
agent.monitoring._runtime_experimental: otel
is set continues to run the monitoring beats as sub-processes.- A log line and the agent diagnostics clearly indicate the monitoring beats continue to be run as sub-processes even though it was requested to run them as receivers.