[GitHub] [skywalking] wu-sheng commented on a change in pull request #4847: [WIP]Provide kafka as collector/reporter

2020-07-09 Thread GitBox


wu-sheng commented on a change in pull request #4847:
URL: https://github.com/apache/skywalking/pull/4847#discussion_r452061487



##
File path: 
oap-server/server-receiver-plugin/skywalking-kafka-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/kafka/KafkaReceiveHandlerRegister.java
##
@@ -0,0 +1,111 @@
+/*
+ * 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.skywalking.oap.server.receiver.kafka;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import io.netty.util.concurrent.DefaultThreadFactory;
+import java.time.Duration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Executors;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.kafka.clients.consumer.ConsumerConfig;
+import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.apache.kafka.clients.consumer.ConsumerRecords;
+import org.apache.kafka.clients.consumer.KafkaConsumer;
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.common.serialization.BytesDeserializer;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.utils.Bytes;
+import org.apache.skywalking.oap.server.library.module.Service;
+import 
org.apache.skywalking.oap.server.receiver.kafka.module.KafkaReceiverConfig;
+import 
org.apache.skywalking.oap.server.receiver.kafka.provider.handler.KafkaConsumerHandler;
+
+/**
+ *
+ */
+@Slf4j
+public class KafkaReceiveHandlerRegister implements Service, Runnable {

Review comment:
   This should not be a service, as no one will use this out of this module





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:
us...@infra.apache.org




[GitHub] [skywalking] wu-sheng commented on a change in pull request #4847: [WIP]Provide kafka as collector/reporter

2020-06-22 Thread GitBox


wu-sheng commented on a change in pull request #4847:
URL: https://github.com/apache/skywalking/pull/4847#discussion_r443915063



##
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/JVMServiceSenderImpl.java
##
@@ -0,0 +1,109 @@
+/*
+ * 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.skywalking.apm.agent.core.jvm;
+
+import io.grpc.Channel;
+import java.util.LinkedList;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import org.apache.skywalking.apm.agent.core.boot.DefaultImplementor;
+import org.apache.skywalking.apm.agent.core.boot.ServiceManager;
+import org.apache.skywalking.apm.agent.core.commands.CommandService;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelListener;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelManager;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelStatus;
+import org.apache.skywalking.apm.network.common.v3.Commands;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetric;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetricCollection;
+import 
org.apache.skywalking.apm.network.language.agent.v3.JVMMetricReportServiceGrpc;
+
+import static 
org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UPSTREAM_TIMEOUT;
+
+@DefaultImplementor
+public class JVMServiceSenderImpl implements JVMServiceSender, 
GRPCChannelListener {

Review comment:
   I think this should be `JVMServiceGrpcSender`

##
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
##
@@ -140,6 +140,25 @@
  * Get profile task list interval
  */
 public static int GET_PROFILE_TASK_INTERVAL = 20;
+
+public static class Kafka {
+
+public static String BOOTSTRAP_SERVERS;
+
+public static int BATCH_SIZE = 1000;
+
+public static String ACKS = "1";
+
+public static String TOPIC_METRICS = "skywalking-metrics";
+
+public static String TOPIC_PROFILING = "skywalking-profiling";
+
+public static String TOPIC_SEGMENT = "skywalking-segment";
+
+public static String TOPIC_MANAGEMENT = "skywalking-management";

Review comment:
   How are these topic(s) created?

##
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/JVMServiceSender.java
##
@@ -0,0 +1,28 @@
+/*
+ * 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.skywalking.apm.agent.core.jvm;
+
+import org.apache.skywalking.apm.agent.core.boot.BootService;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetric;
+
+public interface JVMServiceSender extends BootService, Runnable {

Review comment:
   Comments are required.

##
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/TracingContext.java
##
@@ -116,7 +116,7 @@
 /**
  * Initialize all fields with default value.
  */
-TracingContext(String firstOPName) {
+public TracingContext(String firstOPName) {

Review comment:
   Why change this? Who will create new 

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4847: [WIP]Provide kafka as collector/reporter

2020-05-31 Thread GitBox


wu-sheng commented on a change in pull request #4847:
URL: https://github.com/apache/skywalking/pull/4847#discussion_r433023087



##
File path: apm-sniffer/config/agent.config
##
@@ -78,3 +78,6 @@ logging.level=${SW_LOGGING_LEVEL:INFO}
 
 # mysql plugin configuration
 # plugin.mysql.trace_sql_parameters=${SW_MYSQL_TRACE_SQL_PARAMETERS:false}
+
+# Kafka producer configuration
+# 
collector.kafka.bootstrap_servers=${SW_KAFKA_BOOTSTRAP_SERVERS:localhost:9092}

Review comment:
   I think we should share the backend service, and the kafka sender could 
be activated automatically through the same agent plugin activation way(copy).

##
File path: apm-sniffer/pom.xml
##
@@ -32,10 +32,8 @@
 apm-agent
 apm-agent-core
 apm-sdk-plugin
-apm-toolkit-activation

Review comment:
   Why remove toolkit?

##
File path: 
oap-server/server-receiver-plugin/skywalking-mq-receiver-plugins/kafka-receiver-plugin/pom.xml
##
@@ -0,0 +1,48 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+
+skywalking-mq-receiver-plugins
+org.apache.skywalking
+8.0.0-SNAPSHOT
+
+4.0.0
+
+kafka-receiver-plugin
+
+
+
+org.apache.kafka
+kafka-clients
+2.4.1

Review comment:
   Kafka version should be managed in the oap level pom.xml

##
File path: apm-sniffer/optional-producer-plugins/kafka-producer-plugin/pom.xml
##
@@ -0,0 +1,58 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+
+optional-producer-plugins
+org.apache.skywalking
+8.0.0-SNAPSHOT
+
+4.0.0
+
+kafka-producer-plugin
+jar
+
+
+
+org.apache.skywalking
+apm-agent-core
+${project.version}
+provided
+
+
+org.apache.skywalking
+apm-util
+${project.version}
+provided
+
+
+org.apache.skywalking
+apm-test-tools
+${project.version}
+test
+
+
+org.apache.kafka
+kafka-clients
+2.3.1
+provided

Review comment:
   Why this is `provided`? If this is provided, you wouldn't have the 
Kafka-clients at the runtime, as the agent core doesn't include those.

##
File path: apm-sniffer/config/agent.config
##
@@ -78,3 +78,6 @@ logging.level=${SW_LOGGING_LEVEL:INFO}
 
 # mysql plugin configuration
 # plugin.mysql.trace_sql_parameters=${SW_MYSQL_TRACE_SQL_PARAMETERS:false}
+
+# Kafka producer configuration
+# 
collector.kafka.bootstrap_servers=${SW_KAFKA_BOOTSTRAP_SERVERS:localhost:9092}

Review comment:
   From the Config, you have implemented the JVM, trace and profile, so, I 
think when this plugin activated, there is no need to have grpc endpoint, right?

##
File path: apm-sniffer/optional-producer-plugins/pom.xml
##
@@ -0,0 +1,144 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+
+apm-sniffer
+org.apache.skywalking
+8.0.0-SNAPSHOT
+
+4.0.0
+
+optional-producer-plugins
+pom
+
+
+kafka-producer-plugin
+
+
+
+net.bytebuddy
+
${shade.package}.${shade.net.bytebuddy.source}
+UTF-8
+
+
+
${project.build.directory}${sdk.plugin.related.dir}/../../../../skywalking-agent
+
+
${agent.package.dest.dir}/mq-reporter-plugins
+
+1.0b3
+1.8.1
+
+
+
+
+org.apache.skywalking
+apm-agent-core
+${project.version}
+provided
+
+
+org.apache.skywalking
+apm-util
+${project.version}
+provided
+
+
+org.apache.skywalking
+apm-test-tools
+${project.version}
+test
+
+
+
+
+
+
+maven-shade-plugin

Review comment:
   Why shade the bytebuddy?





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:
us...@infra.apache.org