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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to