You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2020/02/18 10:19:58 UTC

[GitHub] [cxf] shark300 opened a new pull request #642: [CXF-6738] Add Micrometer metric support for JAX-WS

shark300 opened a new pull request #642: [CXF-6738] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407231422
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.CxfProperties;
+import org.apache.cxf.spring.boot.autoconfigure.CxfProperties.Metrics.Server;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
+@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
+@ConditionalOnClass({JaxWsServerFactoryBean.class, MetricsProvider.class})
+@ConditionalOnBean({MeterRegistry.class})
+@EnableConfigurationProperties(CxfProperties.class)
+public class MicrometerMetricsAutoConfiguration {
+
+    private final CxfProperties properties;
+
+    public MicrometerMetricsAutoConfiguration(CxfProperties properties) {
+        this.properties = properties;
+    }
+
+    @Bean
+    public TimedAnnotationProvider timedAnnotationProvider() {
+        return new SpringBasedTimedAnnotationProvider();
+    }
+
+    @Bean
+    public JaxwsTags jaxwsTags() {
+        return new JaxwsTags();
+    }
+
+    @Bean
+    @ConditionalOnMissingBean(ExceptionClassProvider.class)
+    public ExceptionClassProvider exceptionClassProvider() {
 
 Review comment:
   I would suggest to remove `ExceptionClassProvider`  and `JaxwsFaultCodeProvider` altogether and replace them with something like `TagsCustomizer`. 
   ```
   interface TagsCustomizer() {
       Iterable<Tag> getAdditionalTags(Exchange ex);
   }
   ```
   
   There could many of them (fe, could be one for JAX-WS and one for JAX-RS) and `MicrometerMetricsContext` could apply the available customizers before emitting the final set of tags. 
   
   ```
   Supplier<Iterable<Tag>> tags = () -> this.tagsProvider.getTags(ex) + <all tags from customizers>
   ```
   
   What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r383065604
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
 
 Review comment:
   `@AutoConfigureAfter(MetricsAutoConfiguration.class)` should be sufficient, no?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r386028600
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/MetricsProperties.java
 ##########
 @@ -0,0 +1,86 @@
+/**
+ * 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;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties("management.metrics")
 
 Review comment:
   `management.metrics.cxf` is OK for me.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r383064529
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/pom.xml
 ##########
 @@ -74,6 +74,16 @@
             <artifactId>spring-boot-autoconfigure-processor</artifactId>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
 
 Review comment:
   I think this dependency is not need, or there are reasons to include it?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407241095
 
 

 ##########
 File path: integration/spring-boot/starter-jaxws/pom.xml
 ##########
 @@ -69,6 +74,11 @@
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
 
 Review comment:
   I've changed it to compile scope because AutoConfiguration uses that.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407233454
 
 

 ##########
 File path: rt/features/metrics/src/main/java/org/apache/cxf/metrics/micrometer/provider/jaxws/JaxwsTags.java
 ##########
 @@ -0,0 +1,140 @@
+/**
+ * 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.metrics.micrometer.provider.jaxws;
+
+import java.util.NoSuchElementException;
+import java.util.Optional;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+import io.micrometer.core.instrument.Tag;
+
+import static java.util.Optional.ofNullable;
+
+public class JaxwsTags {
 
 Review comment:
   We could split this class into 2,  `StandardTags` (under `org.apache.cxf.metrics.micrometer.provider` package) and `JaxwsTags` with JAX-WS specifics, like FaultCode, etc. Along with customizers we could rely on `StandardTags` only in the `MicrometerMetricsContext` where JAX-WS specific tags are going to be injected by customizers.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r386028407
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
 
 Review comment:
   There is a little bit magic inside the Spring Boot: https://github.com/spring-projects/spring-boot/issues/11977#issuecomment-364498154 Due to this, MicrometerMetricsAutoConfiguration should configure after SimpleMetricsExportAutoConfiguration.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] junhuhdev edited a comment on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
junhuhdev edited a comment on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-605033195
 
 
   Ok thanks looks promising. Looking forward to testing this implementation. 
   
   Btw is support JAX-RS on the roadmap? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407228099
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   This annotation helps to test meta annotations. The Spring's AnnotationCollector finds this annotations too. I didn't want to reduce feature set of original Spring implementation.
   Unfortunately, there is a special annotation in Spring (AliasFor) but I don't want to implement this kind of feature because it's Spring specific.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407231838
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   > This annotation helps to test meta annotations.
   
   So you have one in tests, it should be sufficient to test meta annotations but no need to introduce it into main codebase, correct?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r383066888
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
+@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
+@ConditionalOnClass({DispatcherServlet.class, MetricsFeature.class})
 
 Review comment:
   So we need basically 2 conditions here:
   1) The metrics module is added (`MetricsProvider.class` should be present)
   2) The JAX-WS frontend module is added (may me `JaxWsServerFactoryBean.class` should be present)
   What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407228099
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   This annotation helps to test meta annotations. The Spring's AnnotationCollector finds this annotations too. I didn't want to reduce feature set of original Spring implementation.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407231838
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   > This annotation helps to test meta annotations.
   So you have one in tests, it should be sufficient to test meta annotations but no need to introduce it into main codebase, correct?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-604977429
 
 
   > How would adding support to JAX-RS look like? Could we reuse parts of the code?
   In theoretically yes you can. But I have a lack of knowledge about JAX-RS. Due to this I don't want to add any code related to that.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r384378764
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/MetricsProperties.java
 ##########
 @@ -0,0 +1,86 @@
+/**
+ * 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;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties("management.metrics")
 
 Review comment:
   I see your pont, but as I see, all of Spring Boot related metrics are under management.metrics too. 
   https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-meter
   As a developer, I'll search it here. Otherwise, someone should update the documentation too (I don't have a write access to this one).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r385978947
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
 
 Review comment:
   May be you could just have `@ConditionalOnBean(SimpleMeterRegistry.class)` instead?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r384378792
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
 
 Review comment:
   As I see, SimpleMetricsExportAutoConfiguration provides a SimpleMeterRegistry bean, and those extends MeterRegistry and it used by MetricsProvider too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] junhuhdev commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
junhuhdev commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-605033195
 
 
   Ok thanks. Looking forward to testing this implementation. 
   
   Btw is support JAX-RS on the roadmap? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407254117
 
 

 ##########
 File path: rt/features/metrics/src/main/java/org/apache/cxf/metrics/micrometer/provider/jaxws/JaxwsTagsProvider.java
 ##########
 @@ -0,0 +1,62 @@
+/**
+ * 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.metrics.micrometer.provider.jaxws;
+
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+
+import io.micrometer.core.instrument.Tag;
+import io.micrometer.core.instrument.Tags;
+
+import static java.util.Optional.ofNullable;
+
+public class JaxwsTagsProvider implements TagsProvider {
 
 Review comment:
   If we apply the idea with customizers (to replace narrow scoped `ExceptionClassProvider` and `JaxwsFaultCodeProvider`), we could rename this class to `StandardTagsProvider` and keep it independent from JAX-WS. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407228099
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   This annotation helps to test meta annotations. The Spring's AnnotationCollector finds this annotations too. I didn't want to reduce feature set of original Spring implementation.
   Unfortunately, there is a special annotation in Spring (AliasFor) but I don't want to implement this kind of feature because it's Spring specific.
   Due to this one, there are two CustomeTimed annotation (one for Spring, and one for CXF provider tests)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 edited a comment on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 edited a comment on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-604977429
 
 
   > How would adding support to JAX-RS look like? Could we reuse parts of the code?
   
   In theoretically yes you can. But I have a lack of knowledge about JAX-RS. Due to this I don't want to add any code related to that.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r387008207
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/MetricsProperties.java
 ##########
 @@ -0,0 +1,86 @@
+/**
+ * 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;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties("management.metrics")
 
 Review comment:
   Hi @wilkinsona I overlooked this important thing, thanks. I'll moving that. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407241095
 
 

 ##########
 File path: integration/spring-boot/starter-jaxws/pom.xml
 ##########
 @@ -69,6 +74,11 @@
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
 
 Review comment:
   I've changed it to compile scope.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-605066434
 
 
   @junhuhdev certainly, https://issues.apache.org/jira/browse/CXF-8252

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407222445
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/SpringBasedTimedAnnotationProvider.java
 ##########
 @@ -0,0 +1,97 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.invoker.MethodDispatcher;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.springframework.core.annotation.MergedAnnotationCollectors;
+import org.springframework.core.annotation.MergedAnnotations;
+
+import io.micrometer.core.annotation.Timed;
+
+public class SpringBasedTimedAnnotationProvider implements TimedAnnotationProvider {
 
 Review comment:
   I think we could strip `jaxws` package, this provider does is really JAX-WS related, only depends on `cxf-core`, right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407232503
 
 

 ##########
 File path: integration/spring-boot/starter-jaxws/pom.xml
 ##########
 @@ -69,6 +74,11 @@
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
 
 Review comment:
   This should be optional dependency as well

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-604998746
 
 
   @junhuhdev The idea is to shape this PR so the foundation is ready for JAX-RS (very likely without introducing JAX-RS support directly as per discussion with @shark300 on the ticket). I should be back on it in a few days to finish up the review.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] junhuhdev commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
junhuhdev commented on issue #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#issuecomment-604946374
 
 
   How would adding support to JAX-RS look like? Could we reuse parts of the code? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407223377
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   What is the purpose of this annotation?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r385980482
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/MetricsProperties.java
 ##########
 @@ -0,0 +1,86 @@
+/**
+ * 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;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties("management.metrics")
 
 Review comment:
   Fair enough, it is better to follow the Spring's recommendation, https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#per-meter-properties, so fe we could have metrics under `management.metrics.cxf` and able to control/configure all or part of them, does it make sense?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407223933
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/SpringBasedTimedAnnotationProvider.java
 ##########
 @@ -0,0 +1,97 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.invoker.MethodDispatcher;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.springframework.core.annotation.MergedAnnotationCollectors;
+import org.springframework.core.annotation.MergedAnnotations;
+
+import io.micrometer.core.annotation.Timed;
+
+public class SpringBasedTimedAnnotationProvider implements TimedAnnotationProvider {
 
 Review comment:
   You are right, I'll move it into `org.apache.cxf.spring.boot.autoconfigure.micrometer.provider`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407241052
 
 

 ##########
 File path: integration/spring-boot/starter-jaxws/pom.xml
 ##########
 @@ -54,6 +55,10 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
 
 Review comment:
   Yes it should. I've removed that and moved it into integration test's pom.xml. It uses that. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407231422
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.CxfProperties;
+import org.apache.cxf.spring.boot.autoconfigure.CxfProperties.Metrics.Server;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
+@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
+@ConditionalOnClass({JaxWsServerFactoryBean.class, MetricsProvider.class})
+@ConditionalOnBean({MeterRegistry.class})
+@EnableConfigurationProperties(CxfProperties.class)
+public class MicrometerMetricsAutoConfiguration {
+
+    private final CxfProperties properties;
+
+    public MicrometerMetricsAutoConfiguration(CxfProperties properties) {
+        this.properties = properties;
+    }
+
+    @Bean
+    public TimedAnnotationProvider timedAnnotationProvider() {
+        return new SpringBasedTimedAnnotationProvider();
+    }
+
+    @Bean
+    public JaxwsTags jaxwsTags() {
+        return new JaxwsTags();
+    }
+
+    @Bean
+    @ConditionalOnMissingBean(ExceptionClassProvider.class)
+    public ExceptionClassProvider exceptionClassProvider() {
 
 Review comment:
   I would suggest to remove `ExceptionClassProvider`  and `JaxwsFaultCodeProvider` altogether and replace it with something like `TagsCustomizer`. 
   ```
   interface TagsCustomizer() {
       Iterable<Tag> getAdditionalTags(Exchange ex);
   }
   ```
   
   There could many of them (fe, could be one for JAX-WS and one for JAX-RS) and `MicrometerMetricsContext` could apply the available customizers before emitting the final set of tags. 
   
   ```
   Supplier<Iterable<Tag>> tags = () -> this.tagsProvider.getTags(ex) + <all tags from customizers>
   ```
   
   What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407222445
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/SpringBasedTimedAnnotationProvider.java
 ##########
 @@ -0,0 +1,97 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.invoker.MethodDispatcher;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.springframework.core.annotation.MergedAnnotationCollectors;
+import org.springframework.core.annotation.MergedAnnotations;
+
+import io.micrometer.core.annotation.Timed;
+
+public class SpringBasedTimedAnnotationProvider implements TimedAnnotationProvider {
 
 Review comment:
   I think we could strip `jaxws` package, this provider does not really JAX-WS related, only depends on `cxf-core`, right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r383066888
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
+@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
+@ConditionalOnClass({DispatcherServlet.class, MetricsFeature.class})
 
 Review comment:
   So we need basically 2 conditions here:
   1) The metrics module is added (`MetricsProvider.class` should be present)
   2) The JAX-WS frontend module is added (may me `JaxWsServerFactoryBean.class` should be present)
   
   What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] wilkinsona commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
wilkinsona commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r386969205
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/MetricsProperties.java
 ##########
 @@ -0,0 +1,86 @@
+/**
+ * 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;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties("management.metrics")
 
 Review comment:
   There are some [guidelines about this](https://docs.spring.io/spring-boot/docs/2.2.5.RELEASE/reference/htmlsingle/#boot-features-custom-starter-configuration-keys) in Spring Boot's documentation. As per those guidelines, please don't use `management.*` for third-party properties. +1 for properties that begin `cfx.`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r384378792
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
 
 Review comment:
   As I see, SimpleMetricsExportAutoConfiguration provides a SimpleMeterRegistry bean, and those extends MeterRegistry and it used by MetricsProvider too. So SimpleMetricsExportAutoConfiguration is necessary.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r383065162
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/MetricsProperties.java
 ##########
 @@ -0,0 +1,86 @@
+/**
+ * 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;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties("management.metrics")
 
 Review comment:
   We should probably better use `cxf.management.metrics` (or just `cxf.metrics`) in order to not conflict / confuse with Spring Boot Actuator bundled properties.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407232484
 
 

 ##########
 File path: integration/spring-boot/starter-jaxws/pom.xml
 ##########
 @@ -54,6 +55,10 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
 
 Review comment:
   This should be optional dependency, correct? (not everyone would need actuator)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407228099
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   This annotation helps to test meta annotations. The Spring's AnnotationCollector finds this kind of annotations too. I didn't want to reduce feature set of original Spring implementation.
   Unfortunately, there is a special annotation in Spring (AliasFor) but I don't want to implement this kind of feature because it's Spring specific.
   Due to this one, there are two CustomTimed annotation (one for Spring, and one for CXF provider tests)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407232073
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   Yes, exactly.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r407228099
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/provider/jaxws/CustomTimed.java
 ##########
 @@ -0,0 +1,40 @@
+/**
+ * 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.provider.jaxws;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.core.annotation.AliasFor;
+
+import io.micrometer.core.annotation.Timed;
+
+@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Timed
+public @interface CustomTimed {
 
 Review comment:
   This annotation helps to test meta annotations. The Spring's AnnotationCollector finds this kind of annotations too. I didn't want to reduce feature set of original Spring implementation.
   Unfortunately, there is a special annotation in Spring (AliasFor) but I don't want to implement this kind of feature because it's Spring specific.
   Due to this one, there are two CustomeTimed annotation (one for Spring, and one for CXF provider tests)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r384378737
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/pom.xml
 ##########
 @@ -74,6 +74,16 @@
             <artifactId>spring-boot-autoconfigure-processor</artifactId>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
 
 Review comment:
   I'll check it, but probably yes, good catch!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cxf] shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS

Posted by GitBox <gi...@apache.org>.
shark300 commented on a change in pull request #642: [CXF-8213] Add Micrometer metric support for JAX-WS
URL: https://github.com/apache/cxf/pull/642#discussion_r384378816
 
 

 ##########
 File path: integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerMetricsAutoConfiguration.java
 ##########
 @@ -0,0 +1,121 @@
+/**
+ * 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.metrics.MetricsFeature;
+import org.apache.cxf.metrics.MetricsProvider;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProperties;
+import org.apache.cxf.metrics.micrometer.MicrometerMetricsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TagsProvider;
+import org.apache.cxf.metrics.micrometer.provider.TimedAnnotationProvider;
+import org.apache.cxf.metrics.micrometer.provider.DefaultExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.ExceptionClassProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.DefaultJaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsFaultCodeProvider;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTags;
+import org.apache.cxf.metrics.micrometer.provider.jaxws.JaxwsTagsProvider;
+import org.apache.cxf.spring.boot.autoconfigure.MetricsProperties;
+import org.apache.cxf.spring.boot.autoconfigure.micrometer.provider.jaxws.SpringBasedTimedAnnotationProvider;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
+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.ConditionalOnWebApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.config.MeterFilter;
+
+@Configuration
+@AutoConfigureAfter({MetricsAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class})
+@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
+@ConditionalOnClass({DispatcherServlet.class, MetricsFeature.class})
 
 Review comment:
   It's ok for me. I'll try it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services