* Ref to {@link WriterFactory#getLogWriter()} */ diff --git a/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java b/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java index 4323cc0f..b71ed425 100644 --- a/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java +++ b/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java @@ -42,9 +42,9 @@ import static cn.hippo4j.agent.core.conf.Constants.SERVICE_NAME_PART_CONNECTOR; public class SnifferConfigInitializer { private static ILog LOGGER = LogManager.getLogger(SnifferConfigInitializer.class); - private static final String SPECIFIED_CONFIG_PATH = "skywalking_config"; + private static final String SPECIFIED_CONFIG_PATH = "hippo4j_config"; private static final String DEFAULT_CONFIG_FILE_NAME = "/config/agent.config"; - private static final String ENV_KEY_PREFIX = "skywalking."; + private static final String ENV_KEY_PREFIX = "hippo4j."; private static Properties AGENT_SETTINGS; private static boolean IS_INIT_COMPLETED = false; @@ -54,7 +54,7 @@ public class SnifferConfigInitializer { * /config directory of agent package. *
* Also try to override the config by system.properties. All the keys in this place should start with {@link - * #ENV_KEY_PREFIX}. e.g. in env `skywalking.agent.service_name=yourAppName` to override `agent.service_name` in + * #ENV_KEY_PREFIX}. e.g. in env `hippo4j.agent.service_name=yourAppName` to override `agent.service_name` in * config file. *
* At the end, `agent.service_name` and `collector.servers` must not be blank. @@ -69,7 +69,7 @@ public class SnifferConfigInitializer { } } catch (Exception e) { - LOGGER.error(e, "Failed to read the config file, skywalking is going to run in default config."); + LOGGER.error(e, "Failed to read the config file, hippo4j is going to run in default config."); } try { @@ -180,10 +180,10 @@ public class SnifferConfigInitializer { } /** - * Override the config by system properties. The property key must start with `skywalking`, the result should be as + * Override the config by system properties. The property key must start with `hippo4j`, the result should be as * same as in `agent.config` *
- * such as: Property key of `agent.service_name` should be `skywalking.agent.service_name`
+ * such as: Property key of `agent.service_name` should be `hippo4j.agent.service_name`
*/
private static void overrideConfigBySystemProp() {
Properties systemProperties = System.getProperties();
diff --git a/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/jvm/LoadedLibraryCollector.java b/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/jvm/LoadedLibraryCollector.java
new file mode 100644
index 00000000..053567b9
--- /dev/null
+++ b/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/jvm/LoadedLibraryCollector.java
@@ -0,0 +1,126 @@
+/*
+ * 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 cn.hippo4j.agent.core.jvm;
+
+import cn.hippo4j.agent.core.logging.api.ILog;
+import cn.hippo4j.agent.core.logging.api.LogManager;
+import cn.hippo4j.agent.core.util.CollectionUtil;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.io.File;
+import java.lang.management.ManagementFactory;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public class LoadedLibraryCollector {
+
+ private static final ILog LOGGER = LogManager.getLogger(LoadedLibraryCollector.class);
+ private static final String JAR_SEPARATOR = "!";
+ private static Set
* So I build this protective shield by a nested matcher. When the origin matcher(s) can't resolve the type, the
- * SkyWalking agent ignores this types.
+ * Hippo4j agent ignores this types.
*
* Notice: this ignore mechanism may miss some instrumentations, but at most cases, it's same. If missing happens,
* please pay attention to the WARNING logs.
diff --git a/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java b/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java
index ee19f5b0..26637d8d 100644
--- a/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java
+++ b/hippo4j-agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java
@@ -23,7 +23,7 @@ import net.bytebuddy.matcher.ElementMatcher;
import net.bytebuddy.matcher.NegatingMatcher;
/**
- * Util class to help to construct logical operations on {@link org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch}s
+ * Util class to help to construct logical operations on {@link cn.hippo4j.agent.core.plugin.match.ClassMatch}s
*/
public class LogicalMatchOperation {
diff --git a/hippo4j-agent/hippo4j-sdk-plugin/pom.xml b/hippo4j-agent/hippo4j-agent-plugin/pom.xml
similarity index 91%
rename from hippo4j-agent/hippo4j-sdk-plugin/pom.xml
rename to hippo4j-agent/hippo4j-agent-plugin/pom.xml
index 7df2b687..a7663a2a 100644
--- a/hippo4j-agent/hippo4j-sdk-plugin/pom.xml
+++ b/hippo4j-agent/hippo4j-agent-plugin/pom.xml
@@ -9,7 +9,7 @@