You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "mxsm (via GitHub)" <gi...@apache.org> on 2024/04/14 15:43:35 UTC
[PR] [ISSUE #3430]Refactor eventmesh-metrics-prometheus module (eventmesh)
mxsm opened a new pull request, #4840:
URL: https://github.com/apache/eventmesh/pull/4840
<!--
### Contribution Checklist
- Name the pull request in the form "[ISSUE #XXXX] Title of the pull request",
where *XXXX* should be replaced by the actual issue number.
Skip *[ISSUE #XXXX]* if there is no associated github issue for this pull request.
- Fill out the template below to describe the changes contributed by the pull request.
That will give reviewers the context they need to do the review.
- Each pull request should address only one issue.
Please do not mix up code from multiple issues.
- Each commit in the pull request should have a meaningful commit message.
- Once all items of the checklist are addressed, remove the above text and this checklist,
leaving only the filled out template below.
(The sections below can be removed for hotfixes of typos)
-->
<!--
(If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Closes #<XXX>`.)
-->
Fixes #3430
### Motivation
1. **The current project is using a lower version of OpenTelemetry components, version 1.3.0, while the latest version is 1.24.0. The related versions need to be upgraded.**
2. **The version upgrade brings new specifications and features, requiring code refactoring.**
3. **The instrumentation of metrics needs to be adjusted accordingly based on the related semantic conversion specifications of OpenTelemetry. (https://opentelemetry.io/docs/reference/specification/metrics/semantic_conventions/)**
4. **Optimize and refactor the related code logic to make the code clearer.**
### Modifications
*Refactor eventmesh-metrics-prometheus module*

### Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566031574
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
I meant to move files location without making changes to the class. The directory structure may like this:
```
model/
counters/
CounterImplA
CounterImplB
xxx/
xxxImplA
xxxImplB
CounterInterface
xxxInterface
xxxAbstractClassA
xxxAbstractClassB
```
It may be easier to find out how many interfaces and abstract classes are under this package and locate them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1568933506
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
The `model` package is mainly used to store metrics. Personally, I don't think it's necessary to further classify the types of metrics. They can be uniformly placed in this package. Similarly, this package basically includes metrics that adhere to the existing OpenTelemetry specification. Being too granular makes the code look bloated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1565028771
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Pair.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common;
+
+public class Pair<Left, Right> {
+
+ private Left left;
+
+ private Right right;
Review Comment:
> We have two `Pair` classes in our project:
>
> * org.apache.eventmesh.common.Pair
> * org.apache.eventmesh.runtime.common.Pair
>
> The usages of the latter one can be unified to the former one.
I will remove org.apache.eventmesh.runtime.common.Pair. I think should use org.apache.eventmesh.common.Pair
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566010829
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
There's no need to put this in a subclass; this covers all implementations. Using an abstract class makes it easier for future extensions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566036903
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/MetricsConstants.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * 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.eventmesh.common;
+
+
+public abstract class MetricsConstants {
+
+ private MetricsConstants() {
+
+ }
Review Comment:
Fixed in https://github.com/apache/eventmesh/pull/4840/commits/1508e4c24c9d2d78b696b50e93f5bbf3b7dd1446
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566036903
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/MetricsConstants.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * 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.eventmesh.common;
+
+
+public abstract class MetricsConstants {
+
+ private MetricsConstants() {
+
+ }
Review Comment:
Fixed in https://github.com/apache/eventmesh/pull/4840/files/8936c98ed32c8c7a43c1448a77320f102f90ff25..1508e4c24c9d2d78b696b50e93f5bbf3b7dd1446
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1568929035
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricInstrumentUnit.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+public abstract class MetricInstrumentUnit {
+
+ private MetricInstrumentUnit() {
+
+ }
Review Comment:
This mainly consists of units for observability metrics. In my view, it's more appropriate to place them in a separate class, removing the `abstract` keyword from the class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1564796002
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
The classes under `org.apache.eventmesh.metrics.api.model` are too many and their inheritance relationship seems a little messy.
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricInstrumentUnit.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+public abstract class MetricInstrumentUnit {
+
+ private MetricInstrumentUnit() {
+
+ }
Review Comment:
We can put this constant class into `constant` package together with `MonitorMetricConstants`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1564796002
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
The classes under `org.apache.eventmesh.metrics.api.model` are too many and their inheritance relationship seems a little messy.
>This comment is a copy of https://github.com/apache/eventmesh/pull/3446#discussion_r1450994036
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
Would it be better to extract implementation classes to a sub-package?
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricInstrumentUnit.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+public abstract class MetricInstrumentUnit {
+
+ private MetricInstrumentUnit() {
+
+ }
Review Comment:
We can put this constant class into `constant` package together with `MonitorMetricConstants`.
>This comment is a copy of https://github.com/apache/eventmesh/pull/3446#discussion_r1451026815
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricsManager.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+import org.apache.eventmesh.metrics.api.model.Metric;
+
+import java.util.List;
+
+/**
+ * metric manager interface
+ */
+
+/**
+ * MetricsManager is an interface for managing metrics.
+ */
+public interface MetricsManager {
Review Comment:
duplicate javadoc
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Pair.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common;
+
+public class Pair<Left, Right> {
+
+ private Left left;
+
+ private Right right;
Review Comment:
We have two `Pair` classes in our project:
- org.apache.eventmesh.common.Pair
- org.apache.eventmesh.runtime.common.Pair
The usages of the latter one can be unified to the former one.
>This comment is a copy of https://github.com/apache/eventmesh/pull/3446#discussion_r1450992783
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/GeneralMetricsManager.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+import org.apache.eventmesh.metrics.api.MetricsRegistry;
+
+import org.apache.commons.collections4.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+import io.opentelemetry.api.common.Attributes;
+import io.opentelemetry.api.common.AttributesBuilder;
+
+import lombok.experimental.UtilityClass;
+
+/**
+ * Managing general metrics.
+ */
+@UtilityClass
+public class GeneralMetricsManager {
Review Comment:
The naming of `GeneralMetricsManager` is a little confusing comparing with `MetricsManager`, and made me think that It's an implementation of `MetricsManager`.
Will putting them in different packages or renaming it to a more suitable name be better?
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/MetricsConstants.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * 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.eventmesh.common;
+
+
+public abstract class MetricsConstants {
+
+ private MetricsConstants() {
+
+ }
Review Comment:
Maybe decorating this constant with `class` is enough, instead of `abstract class`.
The usages of this constant are all in metrics-plugin module, so perhaps placing this class in metrics-plugin module will be better.
>This comment is a copy of https://github.com/apache/eventmesh/pull/3446#discussion_r1450991643
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/EventMeshServer.java:
##########
@@ -134,6 +150,29 @@ public void init() throws Exception {
}
}
+ if (Objects.nonNull(eventMeshTCPServer)) {
+ MetricsManager metricsManager = eventMeshTCPServer.getEventMeshTcpMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
+
+ if (Objects.nonNull(eventMeshGrpcServer)) {
+ MetricsManager metricsManager = eventMeshGrpcServer.getEventMeshGrpcMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
+
+ if (Objects.nonNull(eventMeshHTTPServer)) {
+ MetricsManager metricsManager = eventMeshHTTPServer.getEventMeshHttpMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
Review Comment:
The same `addMetricManager` and `addMetrics` methods are repeated three times, and can be extracted outside of the if condition is not that strict; of course, if the if condition is very strict, it can be left as is.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1564794934
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/MetricsConstants.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * 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.eventmesh.common;
+
+
+public abstract class MetricsConstants {
+
+ private MetricsConstants() {
+
+ }
Review Comment:
Maybe decorating this constant with `class` is enough, instead of `abstract class`.
The usages of this constant are all in metrics-plugin module, so perhaps placing this class in metrics-plugin module will be better.
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Pair.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common;
+
+public class Pair<Left, Right> {
+
+ private Left left;
+
+ private Right right;
Review Comment:
We have two `Pair` classes in our project:
- org.apache.eventmesh.common.Pair
- org.apache.eventmesh.runtime.common.Pair
The usages of the latter one can be unified to the former 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.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566042223
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricInstrumentUnit.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+public abstract class MetricInstrumentUnit {
+
+ private MetricInstrumentUnit() {
+
+ }
Review Comment:
>Using an abstract class makes it easier for future extensions.
Did you originally mean to post this sentence in this conversation?
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricInstrumentUnit.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+public abstract class MetricInstrumentUnit {
+
+ private MetricInstrumentUnit() {
+
+ }
Review Comment:
>Using an abstract class makes it easier for future extensions.
Did you originally mean to post this sentence under this conversation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566039544
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/GeneralMetricsManager.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+
+import org.apache.eventmesh.metrics.api.MetricsRegistry;
+
+import org.apache.commons.collections4.MapUtils;
+
+import java.util.List;
+import java.util.Map;
+
+import io.opentelemetry.api.common.Attributes;
+import io.opentelemetry.api.common.AttributesBuilder;
+
+import lombok.experimental.UtilityClass;
+
+/**
+ * Managing general metrics.
+ */
+@UtilityClass
+public class GeneralMetricsManager {
Review Comment:
Fixed in https://github.com/apache/eventmesh/pull/4840/commits/1508e4c24c9d2d78b696b50e93f5bbf3b7dd1446
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566031574
##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/AbstractMetric.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.eventmesh.metrics.api.model;
+
+public abstract class AbstractMetric implements Metric {
+
+ private InstrumentFurther further;
Review Comment:
I meant to move files location without making changes to the class. The directory structure may like this:
```
model/
counters/
CounterA (Impl)
CounterB (Impl)
xxx/
xxxA (Impl)
xxxB (Impl)
Counter (Interface)
xxx (Interface)
xxxX (AbstractClass)
xxxY (AbstractClass)
```
It may be easier to find out how many interfaces and abstract classes are under this package and locate them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566037818
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Pair.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.eventmesh.common;
+
+public class Pair<Left, Right> {
+
+ private Left left;
+
+ private Right right;
Review Comment:
Fixed in https://github.com/apache/eventmesh/pull/4840/commits/1508e4c24c9d2d78b696b50e93f5bbf3b7dd1446
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566038742
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/metrics/MetricsManager.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.eventmesh.runtime.metrics;
+
+import org.apache.eventmesh.metrics.api.model.Metric;
+
+import java.util.List;
+
+/**
+ * metric manager interface
+ */
+
+/**
+ * MetricsManager is an interface for managing metrics.
+ */
+public interface MetricsManager {
Review Comment:
Fixed in https://github.com/apache/eventmesh/pull/4840/commits/1508e4c24c9d2d78b696b50e93f5bbf3b7dd1446
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "Pil0tXia (via GitHub)" <gi...@apache.org>.
Pil0tXia commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1566040395
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/EventMeshServer.java:
##########
@@ -134,6 +150,29 @@ public void init() throws Exception {
}
}
+ if (Objects.nonNull(eventMeshTCPServer)) {
+ MetricsManager metricsManager = eventMeshTCPServer.getEventMeshTcpMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
+
+ if (Objects.nonNull(eventMeshGrpcServer)) {
+ MetricsManager metricsManager = eventMeshGrpcServer.getEventMeshGrpcMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
+
+ if (Objects.nonNull(eventMeshHTTPServer)) {
+ MetricsManager metricsManager = eventMeshHTTPServer.getEventMeshHttpMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
Review Comment:
Fixed in https://github.com/apache/eventmesh/pull/4840/commits/1508e4c24c9d2d78b696b50e93f5bbf3b7dd1446
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840#discussion_r1565029643
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/EventMeshServer.java:
##########
@@ -134,6 +150,29 @@ public void init() throws Exception {
}
}
+ if (Objects.nonNull(eventMeshTCPServer)) {
+ MetricsManager metricsManager = eventMeshTCPServer.getEventMeshTcpMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
+
+ if (Objects.nonNull(eventMeshGrpcServer)) {
+ MetricsManager metricsManager = eventMeshGrpcServer.getEventMeshGrpcMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
+
+ if (Objects.nonNull(eventMeshHTTPServer)) {
+ MetricsManager metricsManager = eventMeshHTTPServer.getEventMeshHttpMetricsManager();
+ this.eventMeshMetricsManager.addMetricManager(metricsManager);
+ this.eventMeshMetricsManager.addMetrics(metricsManager.getMetrics());
+ }
Review Comment:
> The same `addMetricManager` and `addMetrics` methods are repeated three times, and can be extracted outside of the if condition is not that strict; of course, if the if condition is very strict, it can be left as is.
oh! I will fix 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.
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org
Re: [PR] [ISSUE #3430] Refactor eventmesh-metrics-prometheus module (eventmesh)
Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 merged PR #4840:
URL: https://github.com/apache/eventmesh/pull/4840
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org