diff --git a/x-pack/filebeat/input/azureeventhub/v1_input.go b/x-pack/filebeat/input/azureeventhub/v1_input.go index de52fc38e237..7ac2bb153aaa 100644 --- a/x-pack/filebeat/input/azureeventhub/v1_input.go +++ b/x-pack/filebeat/input/azureeventhub/v1_input.go @@ -69,12 +69,8 @@ func (in *eventHubInputV1) Run( defer in.pipelineClient.Close() // Setup input metrics - inputMetrics := newInputMetrics(inputContext.ID, nil) - if err != nil { - return fmt.Errorf("failed to create input metrics: %w", err) - } - defer inputMetrics.Close() - in.metrics = inputMetrics + in.metrics = newInputMetrics(inputContext.ID, nil) + defer in.metrics.Close() ctx := v2.GoContextFromCanceler(inputContext.Cancelation)