marcingrzejszczak commented on code in PR #1346: URL: https://github.com/apache/cxf/pull/1346#discussion_r1289966094
########## integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerObservationAutoConfiguration.java: ########## @@ -0,0 +1,58 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.spring.boot.autoconfigure.micrometer; + +import org.apache.cxf.tracing.micrometer.MessageInObservationConvention; +import org.apache.cxf.tracing.micrometer.MessageOutObservationConvention; +import org.apache.cxf.tracing.micrometer.ObservationClientFeature; +import org.apache.cxf.tracing.micrometer.ObservationFeature; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import io.micrometer.observation.ObservationRegistry; + +@Configuration +@AutoConfigureAfter(ObservationAutoConfiguration.class) +@ConditionalOnClass({ ObservationRegistry.class, ObservationFeature.class }) +@ConditionalOnProperty(name = "cxf.observation.enabled", matchIfMissing = true) +@ConditionalOnBean(ObservationRegistry.class) +public class MicrometerObservationAutoConfiguration { Review Comment: OK I gave it another thought and I don't see any difference between `MicrometerMetricsProvider` which is defined as a Spring bean and `ObservationProvider` or `ObservationClientProvider`. Trying to change the existing code to allow construction injection is not enough for all test to pass. I would leave the current auto-configuration cause that prepares the providers the way they should be set up given that the ObservationRegistry is on the classpath. From my perspective this PR is ready. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@cxf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org