You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/11/07 08:56:17 UTC

[GitHub] [skywalking-java] JaredTan95 opened a new pull request #67: Support set instance properties in json format

JaredTan95 opened a new pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67


   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👇 ====
   ### Add an agent plugin to support <framework name>
   - [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking-java/blob/main/docs/en/setup/service-agent/java-agent/Plugin-test.md)
   - [ ] Add a component id in [the component-libraries.yml](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
   - [ ] Add a logo in [the UI repo](https://github.com/apache/skywalking-rocketbot-ui/tree/master/src/views/components/topology/assets)
        ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking-java/blob/main/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   ### Support set instance properties in json format: `agent.instance_properties_json`
   
   - [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes https://github.com/apache/skywalking/issues/7762.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking-java/blob/main/CHANGES.md).
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] wu-sheng commented on pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#issuecomment-962576843


   Recommend to use `INSTANCE_PROPERTIES_JSON` into e2e case, and verify this feature. I think it is easy to add now.


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] wu-sheng commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744226501



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/InstanceJsonPropertiesUtil.java
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.util;
+
+import com.google.gson.Gson;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.network.common.v3.KeyStringValuePair;
+import org.apache.skywalking.apm.util.StringUtil;
+
+public class InstanceJsonPropertiesUtil {
+    private static final Gson GSON = new Gson();
+
+    public static List<KeyStringValuePair> parseProperties() {
+        List<KeyStringValuePair> properties = new ArrayList<>();
+
+        for (String key : Config.Agent.INSTANCE_PROPERTIES.keySet()) {
+            properties.add(KeyStringValuePair.newBuilder()
+                                             .setKey(key)
+                                             .setValue(Config.Agent.INSTANCE_PROPERTIES.get(key))
+                                             .build());
+        }
+
+        if (StringUtil.isNotEmpty(Config.Agent.INSTANCE_PROPERTIES_JSON)) {
+            Map<String, Object> jsonProperties = GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, Map.class);

Review comment:
       I think it is easier to append `jsonProperties` into `Config.Agent.INSTANCE_PROPERTIES` first, and then convert to `List<KeyStringValuePair> properties`, in order to avoid `removeId` + `add`.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] wu-sheng commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744225274



##########
File path: docs/en/setup/service-agent/java-agent/configurations.md
##########
@@ -14,7 +14,8 @@ property key | Description | Default |
 `agent.is_cache_enhanced_class`|If true, SkyWalking agent will cache all instrumented classes files to memory or disk files (decided by class cache mode), allow another java agent to enhance those classes that enhanced by SkyWalking agent. To use some Java diagnostic tools (such as BTrace, Arthas) to diagnose applications or add a custom java agent to enhance classes, you need to enable this feature. |`false`|
 `agent.class_cache_mode`|The instrumented classes cache mode: `MEMORY` or `FILE`. `MEMORY`: cache class bytes to memory, if instrumented classes is too many or too large, it may take up more memory. `FILE`: cache class bytes in `/class-cache` folder, automatically clean up cached class files when the application exits.|`MEMORY`|
 `agent.instance_name` |Instance name is the identity of an instance, should be unique in the service. If empty, SkyWalking agent will generate an 32-bit uuid. Default, use `UUID`@`hostname` as the instance name. Max length is 50(UTF-8 char)|`""`|
-`agent.instance_properties[key]=value` | Add service instance custom properties. | Not set|
+`agent.instance_properties[key]=value` | Add service instance custom properties. Notice it will be overridden by `agent.instance_properties_json `, if the key duplication. | Not set|

Review comment:
       ```suggestion
   `agent.instance_properties[key]=value` | Add service instance custom properties. Notice it could be overridden by `agent.instance_properties_json `, if the key duplication. | Not set|
   ```




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] kezhenxu94 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744232819



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/InstanceJsonPropertiesUtil.java
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.util;
+
+import com.google.gson.Gson;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.network.common.v3.KeyStringValuePair;
+import org.apache.skywalking.apm.util.StringUtil;
+
+public class InstanceJsonPropertiesUtil {
+    private static final Gson GSON = new Gson();
+
+    public static List<KeyStringValuePair> parseProperties() {
+        List<KeyStringValuePair> properties = new ArrayList<>();
+
+        if (StringUtil.isNotEmpty(Config.Agent.INSTANCE_PROPERTIES_JSON)) {
+            Config.Agent.INSTANCE_PROPERTIES.putAll(GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, Map.class));
+        }
+
+        for (String key : Config.Agent.INSTANCE_PROPERTIES.keySet()) {
+            properties.add(KeyStringValuePair.newBuilder()
+                                             .setKey(key)
+                                             .setValue(Config.Agent.INSTANCE_PROPERTIES.get(key))
+                                             .build());
+        }

Review comment:
       No need to use `keySet()` and `get`, use `entrySet` + `getKey` + `getValue` or even use `forEach` instead
   
   ```suggestion
           Agent.INSTANCE_PROPERTIES.forEach((key, val) -> properties.add(KeyStringValuePair.newBuilder()
                                                                                            .setKey(key)
                                                                                            .setValue(val)
                                                                                            .build()));
   ```




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] kezhenxu94 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744232851



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/InstanceJsonPropertiesUtil.java
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.util;
+
+import com.google.gson.Gson;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.network.common.v3.KeyStringValuePair;
+import org.apache.skywalking.apm.util.StringUtil;
+
+public class InstanceJsonPropertiesUtil {
+    private static final Gson GSON = new Gson();
+
+    public static List<KeyStringValuePair> parseProperties() {
+        List<KeyStringValuePair> properties = new ArrayList<>();
+
+        if (StringUtil.isNotEmpty(Config.Agent.INSTANCE_PROPERTIES_JSON)) {
+            Config.Agent.INSTANCE_PROPERTIES.putAll(GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, Map.class));

Review comment:
       To eliminate the warning
   
   ```suggestion
                           Config.Agent.INSTANCE_PROPERTIES.putAll(GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, new TypeToken<Map<String, Object>>(){}.getType()));
   ```




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] kezhenxu94 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744232178



##########
File path: test/e2e/case/expected/service-instance.yml
##########
@@ -19,7 +19,10 @@
 - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
   name: {{ notEmpty .name }}
   attributes:
-  {{- contains .attributes }}
+    {{- contains .attributes }}
+    - name: org
+      value: apache-skywalking
+    {{- end }}

Review comment:
       ```suggestion
     {{- contains .attributes }}
     - name: org
       value: apache-skywalking
   ```




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] kezhenxu94 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744227537



##########
File path: apm-sniffer/config/agent.config
##########
@@ -20,6 +20,8 @@ agent.namespace=${SW_AGENT_NAMESPACE:}
 # The service name in UI
 agent.service_name=${SW_AGENT_NAME:Your_ApplicationName}
 
+agent.instance_properties_json=${SW_INSTANCE_PROPERTIES_JSON:}

Review comment:
       Can you please put this in the same order as the doc (move this to the next line of `agent.instance_name`)




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] kezhenxu94 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744231577



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/InstanceJsonPropertiesUtil.java
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.util;
+
+import com.google.gson.Gson;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.network.common.v3.KeyStringValuePair;
+import org.apache.skywalking.apm.util.StringUtil;
+
+public class InstanceJsonPropertiesUtil {
+    private static final Gson GSON = new Gson();
+
+    public static List<KeyStringValuePair> parseProperties() {
+        List<KeyStringValuePair> properties = new ArrayList<>();
+
+        for (String key : Config.Agent.INSTANCE_PROPERTIES.keySet()) {
+            properties.add(KeyStringValuePair.newBuilder()
+                                             .setKey(key)
+                                             .setValue(Config.Agent.INSTANCE_PROPERTIES.get(key))
+                                             .build());
+        }
+
+        if (StringUtil.isNotEmpty(Config.Agent.INSTANCE_PROPERTIES_JSON)) {
+            Map<String, Object> jsonProperties = GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, Map.class);

Review comment:
       Also consider avoid the warning by using
   
   ```suggestion
               Map<String, Object> jsonProperties = GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, new TypeToken<Map<String, Object>>(){}.getType());
   ```




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] JaredTan95 merged pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
JaredTan95 merged pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67


   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] kezhenxu94 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744232851



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/InstanceJsonPropertiesUtil.java
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.util;
+
+import com.google.gson.Gson;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.network.common.v3.KeyStringValuePair;
+import org.apache.skywalking.apm.util.StringUtil;
+
+public class InstanceJsonPropertiesUtil {
+    private static final Gson GSON = new Gson();
+
+    public static List<KeyStringValuePair> parseProperties() {
+        List<KeyStringValuePair> properties = new ArrayList<>();
+
+        if (StringUtil.isNotEmpty(Config.Agent.INSTANCE_PROPERTIES_JSON)) {
+            Config.Agent.INSTANCE_PROPERTIES.putAll(GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, Map.class));

Review comment:
       ```suggestion
                           Config.Agent.INSTANCE_PROPERTIES.putAll(GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, new TypeToken<Map<String, Object>>(){}.getType()));
   ```




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-java] JaredTan95 commented on a change in pull request #67: Support set instance properties in json format

Posted by GitBox <gi...@apache.org>.
JaredTan95 commented on a change in pull request #67:
URL: https://github.com/apache/skywalking-java/pull/67#discussion_r744227565



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/util/InstanceJsonPropertiesUtil.java
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.util;
+
+import com.google.gson.Gson;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.network.common.v3.KeyStringValuePair;
+import org.apache.skywalking.apm.util.StringUtil;
+
+public class InstanceJsonPropertiesUtil {
+    private static final Gson GSON = new Gson();
+
+    public static List<KeyStringValuePair> parseProperties() {
+        List<KeyStringValuePair> properties = new ArrayList<>();
+
+        for (String key : Config.Agent.INSTANCE_PROPERTIES.keySet()) {
+            properties.add(KeyStringValuePair.newBuilder()
+                                             .setKey(key)
+                                             .setValue(Config.Agent.INSTANCE_PROPERTIES.get(key))
+                                             .build());
+        }
+
+        if (StringUtil.isNotEmpty(Config.Agent.INSTANCE_PROPERTIES_JSON)) {
+            Map<String, Object> jsonProperties = GSON.fromJson(Config.Agent.INSTANCE_PROPERTIES_JSON, Map.class);

Review comment:
       Yes, maybe that would be more cleaner. I will update it.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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