You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "justinwwhuang (via GitHub)" <gi...@apache.org> on 2024/08/06 09:44:14 UTC
[PR] [INLONG-10756][Agent] Report file metrics for backend problem analysis [inlong]
justinwwhuang opened a new pull request, #10757:
URL: https://github.com/apache/inlong/pull/10757
Fixes #10756
### Motivation
Report file metrics for backend problem analysis
### Modifications
Report the read-write status to the backend after file collection is completed
### Verifying this change
*(Please pick either of the following options)*
- [ ] This change is a trivial rework/code cleanup without any test coverage.
- [ ] This change is already covered by existing tests, such as:
*(please describe tests)*
- [ ] This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Documentation
No doc needed
--
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@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-10756][Agent] Report file metrics for backend problem analysis [inlong]
Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #10757:
URL: https://github.com/apache/inlong/pull/10757#discussion_r1706307691
##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentStatusManager.java:
##########
@@ -55,22 +52,83 @@
import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_GLOBAL_READER_QUEUE_PERMIT;
import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_GLOBAL_READER_SOURCE_PERMIT;
import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_GLOBAL_WRITER_PERMIT;
-import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_ADDR;
-import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_AUTH_SECRET_ID;
-import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_AUTH_SECRET_KEY;
/**
* Collect various indicators of agent processes for backend problem analysis
*/
public class AgentStatusManager {
+ @Data
+ @AllArgsConstructor
+ @NoArgsConstructor
+ public static class AgentStatus {
+
+ private String agentIp;
+ private String tag;
+ private String cluster;
+ private String agentVersion;
+ private String agentStartTime;
+ private String cpuCore;
+ private String procCpu;
+ private String freeMem;
+ private String maxMem;
+ private String useMem;
+ private String os;
+ private String installPlatform;
+ private String usrDir;
+ private String usrName;
+ private String processId;
+ private String globalConfigMd5;
+ private String taskMd5;
+ private String taskNum;
+ private String instanceNum;
+ private String bootTime;
+ private String sendPackageCount;
+ private String sendDataLen;
+ private String sourcePermitLeft;
+ private String queuePermitLeft;
+ private String writerPermitLeft;
+ private String activeThreadCount;
+
+ public String getFieldsString() {
+ List<String> fields = Lists.newArrayList();
+ fields.add(agentIp);
+ fields.add(tag);
+ fields.add(cluster);
+ fields.add(agentVersion);
+ fields.add(agentStartTime);
+ fields.add(cpuCore);
+ fields.add(procCpu);
+ fields.add(freeMem);
+ fields.add(maxMem);
+ fields.add(useMem);
+ fields.add(os);
+ fields.add(installPlatform);
+ fields.add(usrDir);
+ fields.add(usrName);
+ fields.add(processId);
+ fields.add(globalConfigMd5);
+ fields.add(taskMd5);
+ fields.add(taskNum);
+ fields.add(instanceNum);
+ fields.add(bootTime);
+ fields.add(sendPackageCount);
+ fields.add(sendDataLen);
+ fields.add(sourcePermitLeft);
+ fields.add(queuePermitLeft);
+ fields.add(writerPermitLeft);
+ fields.add(activeThreadCount);
+ return Strings.join(fields, ',');
+ }
+ }
+
private static final Logger LOGGER = LoggerFactory.getLogger(AgentStatusManager.class);
public static final String INLONG_AGENT_SYSTEM = "inlong_agent_system";
public static final String INLONG_AGENT_STATUS = "inlong_agent_status";
private static AgentStatusManager manager = null;
private final AgentConfiguration conf;
- private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置格式
+ private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private Runtime runtime = Runtime.getRuntime();
final long GB = 1024 * 1024 * 1024;
private OperatingSystemMXBean osMxBean;
Review Comment:
remove legacy codes
--
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@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-10756][Agent] Report file metrics for backend problem analysis [inlong]
Posted by "justinwwhuang (via GitHub)" <gi...@apache.org>.
justinwwhuang merged PR #10757:
URL: https://github.com/apache/inlong/pull/10757
--
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@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-10756][Agent] Report file metrics for backend problem analysis [inlong]
Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #10757:
URL: https://github.com/apache/inlong/pull/10757#discussion_r1706307691
##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/AgentStatusManager.java:
##########
@@ -55,22 +52,83 @@
import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_GLOBAL_READER_QUEUE_PERMIT;
import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_GLOBAL_READER_SOURCE_PERMIT;
import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_GLOBAL_WRITER_PERMIT;
-import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_ADDR;
-import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_AUTH_SECRET_ID;
-import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_AUTH_SECRET_KEY;
/**
* Collect various indicators of agent processes for backend problem analysis
*/
public class AgentStatusManager {
+ @Data
+ @AllArgsConstructor
+ @NoArgsConstructor
+ public static class AgentStatus {
+
+ private String agentIp;
+ private String tag;
+ private String cluster;
+ private String agentVersion;
+ private String agentStartTime;
+ private String cpuCore;
+ private String procCpu;
+ private String freeMem;
+ private String maxMem;
+ private String useMem;
+ private String os;
+ private String installPlatform;
+ private String usrDir;
+ private String usrName;
+ private String processId;
+ private String globalConfigMd5;
+ private String taskMd5;
+ private String taskNum;
+ private String instanceNum;
+ private String bootTime;
+ private String sendPackageCount;
+ private String sendDataLen;
+ private String sourcePermitLeft;
+ private String queuePermitLeft;
+ private String writerPermitLeft;
+ private String activeThreadCount;
+
+ public String getFieldsString() {
+ List<String> fields = Lists.newArrayList();
+ fields.add(agentIp);
+ fields.add(tag);
+ fields.add(cluster);
+ fields.add(agentVersion);
+ fields.add(agentStartTime);
+ fields.add(cpuCore);
+ fields.add(procCpu);
+ fields.add(freeMem);
+ fields.add(maxMem);
+ fields.add(useMem);
+ fields.add(os);
+ fields.add(installPlatform);
+ fields.add(usrDir);
+ fields.add(usrName);
+ fields.add(processId);
+ fields.add(globalConfigMd5);
+ fields.add(taskMd5);
+ fields.add(taskNum);
+ fields.add(instanceNum);
+ fields.add(bootTime);
+ fields.add(sendPackageCount);
+ fields.add(sendDataLen);
+ fields.add(sourcePermitLeft);
+ fields.add(queuePermitLeft);
+ fields.add(writerPermitLeft);
+ fields.add(activeThreadCount);
+ return Strings.join(fields, ',');
+ }
+ }
+
private static final Logger LOGGER = LoggerFactory.getLogger(AgentStatusManager.class);
public static final String INLONG_AGENT_SYSTEM = "inlong_agent_system";
public static final String INLONG_AGENT_STATUS = "inlong_agent_status";
private static AgentStatusManager manager = null;
private final AgentConfiguration conf;
- private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置格式
+ private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private Runtime runtime = Runtime.getRuntime();
final long GB = 1024 * 1024 * 1024;
private OperatingSystemMXBean osMxBean;
Review Comment:
remove legacy codes
--
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@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-10756][Agent] Report file metrics for backend problem analysis [inlong]
Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #10757:
URL: https://github.com/apache/inlong/pull/10757#discussion_r1706301635
##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/FileStaticManager.java:
##########
@@ -0,0 +1,143 @@
+/*
+ * 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.inlong.agent.core;
+
+import org.apache.inlong.agent.conf.AgentConfiguration;
+import org.apache.inlong.agent.utils.AgentUtils;
+import org.apache.inlong.sdk.dataproxy.DefaultMessageSender;
+import org.apache.inlong.sdk.dataproxy.common.SendResult;
+
+import com.google.common.collect.Lists;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.logging.log4j.util.Strings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import static org.apache.inlong.agent.constant.AgentConstants.AGENT_CLUSTER_NAME;
+import static org.apache.inlong.agent.constant.AgentConstants.AGENT_CLUSTER_TAG;
+
+/**
+ * Collect various indicators of agent processes for backend problem analysis
+ */
+public class FileStaticManager {
+
+ @Data
+ @AllArgsConstructor
+ @NoArgsConstructor
+ public static class FileStatic {
+
+ private String agentIp;
+ private String tag;
+ private String cluster;
+ private String taskId;
+ private String retry;
+ private String contentType;
+ private String groupId;
+ private String streamId;
+ private String dataTime;
+ private String fileName;
+ private String fileLen;
+ private String readBytes;
+ private String readLines;
+ private String sendLines;
+
+ public String getFieldsString() {
+ List<String> fields = Lists.newArrayList();
+ fields.add(agentIp);
+ fields.add(tag);
+ fields.add(cluster);
+ fields.add(taskId);
+ fields.add(retry);
+ fields.add(contentType);
+ fields.add(groupId);
+ fields.add(streamId);
+ fields.add(dataTime);
+ fields.add(fileName);
+ fields.add(fileLen);
+ fields.add(readBytes);
+ fields.add(readLines);
+ fields.add(sendLines);
+ return Strings.join(fields, ',');
+ }
+ }
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(FileStaticManager.class);
+ public static final String INLONG_AGENT_SYSTEM = "inlong_agent_system";
+ public static final String INLONG_FILE_STATIC = "inlong_agent_file_static";
+ protected final Integer CACHE_QUEUE_SIZE = 10000;
+ private static FileStaticManager manager = null;
+ private final AgentConfiguration conf;
+
+ private List<String> statusFieldsPre = Lists.newArrayList();
Review Comment:
Not used
--
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@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org