fix bug  issue#3118 and issue#3161 (#3310)
fix bug  issue#3118 and issue#3161 (#3310)


open-telemetry/opentelemetry-collector-contrib,open-telemetry/opentelemetry-collector,open-telemetry/opentelemetry-collector,open-telemetry/opentelemetry-collector,open-telemetry/opentelemetry-collector-contrib