You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "GuiSong01 (via GitHub)" <gi...@apache.org> on 2023/05/25 16:14:26 UTC
[GitHub] [skywalking-java] GuiSong01 opened a new pull request, #535: Support to config custom decryption methods for kafka configurations and fix bug `kafka-reporter-plugin-8.15.0 throw exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
GuiSong01 opened a new pull request, #535:
URL: https://github.com/apache/skywalking-java/pull/535
[Bug] fix bug `kafka-reporter-plugin-8.15.0 throw exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
<!--
⚠️ 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]`
-->
### Fix <https://github.com/apache/skywalking/issues/10848>
- [ ] Add a unit test to verify that the fix works.
- [ ] Explain briefly why the bug exists and how to fix it.
### [skywalking-java support to decrypt password of kafka with SASL_SSL enabled](https://github.com/apache/skywalking/issues/10815)
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
- [x] Update the documentation to include this new feature.
- [x] Tests(including UT, IT, E2E) are added to verify the new feature.
- [ ] If it's UI related, attach the screenshots below.
- [x] Closes #<10848>.
- [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] GuiSong01 closed pull request #535: Support to config custom decryption methods for kafka configurations and fix bug kafka-reporter-plugin exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "GuiSong01 (via GitHub)" <gi...@apache.org>.
GuiSong01 closed pull request #535: Support to config custom decryption methods for kafka configurations and fix bug kafka-reporter-plugin exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
URL: https://github.com/apache/skywalking-java/pull/535
--
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 diff in pull request #535: Support to config custom decryption methods for kafka configurations and fix bug `kafka-reporter-plugin-8.15.0 throw exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #535:
URL: https://github.com/apache/skywalking-java/pull/535#discussion_r1205759454
##########
CHANGES.md:
##########
@@ -17,7 +17,7 @@ Release Notes.
* Change the classloader to locate the agent path in AgentPackagePath, from `SystemClassLoader` to AgentPackagePath's loader.
* Support Grizzly Trace
* Fix possible IllegalStateException when using Micrometer.
-
+* Support to config custom decryption methods for kafka configurations and fix bug `kafka-reporter-plugin-8.15.0 throw exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Review Comment:
This should be two features, rather than one.
--
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] GuiSong01 commented on pull request #535: Support to config custom decryption methods for kafka configurations and fix bug kafka-reporter-plugin exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "GuiSong01 (via GitHub)" <gi...@apache.org>.
GuiSong01 commented on PR #535:
URL: https://github.com/apache/skywalking-java/pull/535#issuecomment-1564571904
> > Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.2.1:check (validate) on project kafka-reporter-plugin: You have 2 Checkstyle violations. -> [Help 1]
>
> You should do code style check.
--
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 #535: Support to config custom decryption methods for kafka configurations and fix bug kafka-reporter-plugin exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #535:
URL: https://github.com/apache/skywalking-java/pull/535#issuecomment-1564169173
As this PR is not updated, GSON part is being fixed by https://github.com/apache/skywalking-java/pull/538 as well.
--
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 diff in pull request #535: Support to config custom decryption methods for kafka configurations and fix bug kafka-reporter-plugin exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #535:
URL: https://github.com/apache/skywalking-java/pull/535#discussion_r1205765439
##########
apm-sniffer/optional-reporter-plugins/kafka-reporter-plugin/src/main/java/org/apache/skywalking/apm/agent/core/kafka/KafkaProducerManager.java:
##########
@@ -153,6 +145,18 @@ private void notifyListeners(KafkaConnectionStatus status) {
}
}
+ private Map<String, String> decrypt(Map<String, String> config) {
+ try {
+ Class<?> decryptClazz = Class.forName(Kafka.DECRYPT_CLASS);
+ Method decryptMethod = decryptClazz.getMethod(Kafka.DECRYPT_METHOD, Map.class);
+ return (Map<String, String>) decryptMethod.invoke(decryptClazz.newInstance(), config);
+ } catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
+ // ignore
+ LOGGER.warn("The decrypt class {} is not exist, exception:{}.", Kafka.DECRYPT_CLASS, e);
+ return config;
Review Comment:
If you want to do in this way, please indicate in the docs, what method should be written.
--
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 #535: Support to config custom decryption methods for kafka configurations and fix bug kafka-reporter-plugin exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #535:
URL: https://github.com/apache/skywalking-java/pull/535#issuecomment-1563198614
> Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.2.1:check (validate) on project kafka-reporter-plugin: You have 2 Checkstyle violations. -> [Help 1]
You should do code style check.
--
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 diff in pull request #535: Support to config custom decryption methods for kafka configurations and fix bug `kafka-reporter-plugin-8.15.0 throw exception "java.lang.NoClassDefFoundError: com/google/gson/Gson"`
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #535:
URL: https://github.com/apache/skywalking-java/pull/535#discussion_r1205762539
##########
docs/en/setup/service-agent/java-agent/configurations.md:
##########
@@ -103,6 +103,8 @@ This is the properties list supported in `agent/config/agent.config`.
| `plugin.kafka.topic_management` | Specify which Kafka topic name for the register or heartbeat data of Service Instance to report to. | SW_PLUGIN_KAFKA_TOPIC_MANAGEMENT | `skywalking-managements`
|
| `plugin.kafka.topic_logging` | Specify which Kafka topic name for the logging data to report to. | SW_PLUGIN_KAFKA_TOPIC_LOGGING | `skywalking-logging`
|
| `plugin.kafka.namespace` | isolate multi OAP server when using same Kafka cluster (final topic name will append namespace before Kafka topics with `-` ). | SW_KAFKA_NAMESPACE | ``
|
+| `plugin.kafka.decrypt_class` | Specify which class to decrypt encrypted configuration of kafka.You can set encrypted information in `plugin.kafka.producer_config_json` or `plugin.kafka.producer_config` if you need. | SW_KAFKA_DECRYPT_CLASS | ``
|
Review Comment:
https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/advanced-reporters/
This doc should be updated as well, including
1. Which artifact and version should the developer depend on to develop this? Which interface should be implemented?
2. Where to put the packaged 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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org