You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "complone (via GitHub)" <gi...@apache.org> on 2023/07/05 03:48:14 UTC

[GitHub] [rocketmq-eventbridge] complone opened a new pull request, #132: feat: support opentelemry collector and Define indicators

complone opened a new pull request, #132:
URL: https://github.com/apache/rocketmq-eventbridge/pull/132

   Currently rocketmq-eventbridge needs some indicators to complete the process statistics, such as the backlog of different blockingqueues during runtime execution, the tps of consumers, and some delay information in the system. We will divide it into three stages
   
   related to https://github.com/apache/rocketmq-eventbridge/issues/104


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-eventbridge] 2011shenlin commented on a diff in pull request #132: feat: support opentelemry collector and Define indicators

Posted by "2011shenlin (via GitHub)" <gi...@apache.org>.
2011shenlin commented on code in PR #132:
URL: https://github.com/apache/rocketmq-eventbridge/pull/132#discussion_r1285194639


##########
start/src/main/resources/application.properties:
##########
@@ -29,11 +29,11 @@ rocketmq.namesrvAddr=localhost:9876
 
 rocketmq.cluster.name=DefaultCluster
 ## runtime
-runtime.config.mode=DB
+runtime.config.mode=FILE
 runtime.storage.mode=ROCKETMQ
 rumtime.name=eventbridge-runtimer
-runtime.pluginpath=~/eventbridge/plugin
-
+runtime.pluginpath=E:\\rocketmq_files\\plugins

Review Comment:
   the plugin path should not be changed.



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-eventbridge] kaori-seansons commented on a diff in pull request #132: feat: support opentelemry collector and Define indicators

Posted by "kaori-seansons (via GitHub)" <gi...@apache.org>.
kaori-seansons commented on code in PR #132:
URL: https://github.com/apache/rocketmq-eventbridge/pull/132#discussion_r1257468326


##########
common/src/main/java/org/apache/rocketmq/eventbridge/metrics/NopLongUpDownCounter.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.rocketmq.eventbridge.metrics;
+
+import io.opentelemetry.api.common.Attributes;
+import io.opentelemetry.api.metrics.LongUpDownCounter;
+import io.opentelemetry.context.Context;
+
+
+public class NopLongUpDownCounter implements LongUpDownCounter {
+    @Override public void add(long l) {
+
+    }
+
+    @Override public void add(long l, Attributes attributes) {
+

Review Comment:
   For NPE exceptions, an empty implementation of the indicator type is given. The default indicator type is the private level, and the newly created class here is the public level



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-eventbridge] 2011shenlin commented on a diff in pull request #132: feat: support opentelemry collector and Define indicators

Posted by "2011shenlin (via GitHub)" <gi...@apache.org>.
2011shenlin commented on code in PR #132:
URL: https://github.com/apache/rocketmq-eventbridge/pull/132#discussion_r1257428115


##########
metrics/src/main/java/org/apache/rocketmq/eventbridge/BridgeMetricsConstant.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.rocketmq.eventbridge;
+
+public class BridgeMetricsConstant {
+    public static final String OPEN_TELEMETRY_METER_NAME = "bridge-meter";
+
+    public static final String GAUGE_PROCESSOR_GAUGE = "target_queue_gauge";

Review Comment:
   Here the meaning of the indicator cannot be clearly known from the name



##########
adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/runtimer/RocketMQEventSubscriber.java:
##########
@@ -185,11 +196,19 @@ private void initMqProperties() {
             String socks5Password = properties.getProperty("rocketmq.consumer.socks5Password");
             String socks5Endpoint = properties.getProperty("rocketmq.consumer.socks5Endpoint");
 
+            String metricsPromExporterHost = properties.getProperty("metrics.endpoint.host");
+            String metricsPromExporterPort =  properties.getProperty("metrics.endpoint.port");
+            String metricsCollectorMode = properties.getProperty("metrics.collector.mode");
             clientConfig.setNameSrvAddr(namesrvAddr);
             clientConfig.setAccessChannel(AccessChannel.CLOUD.name().equals(accessChannel) ?
                     AccessChannel.CLOUD : AccessChannel.LOCAL);
             clientConfig.setNamespace(namespace);
+            BridgeConfig bridgeConfig = new BridgeConfig();
+            bridgeConfig.setMetricsPromExporterHost(metricsPromExporterHost);
+            bridgeConfig.setMetricsPromExporterPort(Integer.parseInt(metricsPromExporterPort));

Review Comment:
   Why the configuration of metrics exporter is configured in RocketMQEventSubscriber instead of EventMetricsManager?



##########
start/src/main/resources/application.properties:
##########
@@ -29,11 +29,11 @@ rocketmq.namesrvAddr=localhost:9876
 
 rocketmq.cluster.name=DefaultCluster
 ## runtime
-runtime.config.mode=DB
+runtime.config.mode=FILE
 runtime.storage.mode=ROCKETMQ
 rumtime.name=eventbridge-runtimer
-runtime.pluginpath=~/eventbridge/plugin
-
+runtime.pluginpath=E:\\rocketmq_files\\plugins
+runtime.storePathRootDir=E:\\rocketmq_files\\storeRoot
 

Review Comment:
   Does the configuration of the metrics exporter need to be configured here?



##########
common/src/main/java/org/apache/rocketmq/eventbridge/metrics/NopLongUpDownCounter.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.rocketmq.eventbridge.metrics;
+
+import io.opentelemetry.api.common.Attributes;
+import io.opentelemetry.api.metrics.LongUpDownCounter;
+import io.opentelemetry.context.Context;
+
+
+public class NopLongUpDownCounter implements LongUpDownCounter {
+    @Override public void add(long l) {
+
+    }
+
+    @Override public void add(long l, Attributes attributes) {
+

Review Comment:
   What is the purpose of defining an empty implementation here?



##########
metrics/src/main/java/org/apache/rocketmq/eventbridge/BridgeMetricsConstant.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.rocketmq.eventbridge;
+
+public class BridgeMetricsConstant {
+    public static final String OPEN_TELEMETRY_METER_NAME = "bridge-meter";
+
+    public static final String GAUGE_PROCESSOR_GAUGE = "target_queue_gauge";
+    public static final String RULE_QUEUE_GAUGE = "rule_queue_gauge";
+
+    public static final String COUNTER_MESSAGES_IN_TOTAL = "eventbridge_messages_in_total";
+    public static final String COUNTER_MESSAGES_OUT_TOTAL = "eventbridge_messages_out_total";
+    public static final String COUNTER_THROUGHPUT_IN_TOTAL = "eventbridge_throughput_in_total";
+    public static final String COUNTER_THROUGHPUT_OUT_TOTAL = "eventbridge_throughput_out_total";

Review Comment:
   The definition of the indicator here is different from that of the design. What are the considerations here?



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-eventbridge] 2011shenlin commented on a diff in pull request #132: feat: support opentelemry collector and Define indicators

Posted by "2011shenlin (via GitHub)" <gi...@apache.org>.
2011shenlin commented on code in PR #132:
URL: https://github.com/apache/rocketmq-eventbridge/pull/132#discussion_r1285194728


##########
start/src/main/resources/application.properties:
##########
@@ -29,11 +29,11 @@ rocketmq.namesrvAddr=localhost:9876
 
 rocketmq.cluster.name=DefaultCluster
 ## runtime
-runtime.config.mode=DB

Review Comment:
   runtime.config.mode's default value should not be changed.



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org