-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/repairkafka3.7 #707
Merged
Merged
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3feef5a
Fixed an issue where intercept methods for kafka3.7 were invalid
darkness-2nd 2971c2b
Fixed an issue where intercept methods for kafka3.7 were invalid
darkness-2nd 7db4f51
Revert "Fixed an issue where intercept methods for kafka3.7 were inva…
darkness-2nd 1cbc3db
Revert "Fixed an issue where intercept methods for kafka3.7 were inva…
darkness-2nd 6220bd4
add support for kafka3.7.x, because kafka3.7 changed the pull message…
darkness-2nd 1e2b82a
add support for kafka3.7.x, because kafka3.7 changed the pull message…
darkness-2nd d875bd3
add support for kafka3.7.x, because kafka3.7 changed the pull message…
darkness-2nd ef2193b
add support for kafka3.7.x, because kafka3.7 changed the pull message…
darkness-2nd e20ef76
repair ci error
darkness-2nd 3543204
add case of 3.6.0
darkness-2nd 526abbb
fix upe
darkness-2nd abd3848
repair spring-kafka 2.2.x ci
darkness-2nd 0cb524c
remove dead line in Bootstrap-plugins.md
darkness-2nd f31fb6f
repair the uncompatible code in kafka Case
darkness-2nd 8297b83
test ci for 3.7 jdk ci
darkness-2nd 73c85a0
add support version in Supported-list.md
darkness-2nd 1cc9438
remove error class
darkness-2nd 960be6c
remove error class
darkness-2nd 14ebf37
Add comments for resolve the problem that Kafka3.7.x can not be inter…
darkness-2nd 39353e8
revert the format codes
darkness-2nd 3f51753
ignore 403 when checking markdown link
kezhenxu94 1a5f39c
Update CHANGES.md: Support kafka-clients-3.7.x intercept
darkness-2nd b876765
Update docs/en/setup/service-agent/java-agent/Supported-list.md
wu-sheng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
200, | ||
301, | ||
302, | ||
401 | ||
401, | ||
403 | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...va/org/apache/skywalking/apm/plugin/kafka/define/Kafka37AsyncConsumerInstrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* 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.plugin.kafka.define; | ||
|
||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; | ||
import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; | ||
|
||
/** | ||
* For Kafka 3.7.x change | ||
* | ||
* <pre> | ||
* 1. The method named pollForFetchs was removed from KafkaConsumer to <code>AsyncKafkaConsumer</code> and <code>LegacyKafkaConsumer</code> | ||
* 2. Because of the enhance class was changed, so we should create new Instrumentation to intercept the method | ||
* </pre> | ||
*/ | ||
public class Kafka37AsyncConsumerInstrumentation extends KafkaConsumerInstrumentation { | ||
|
||
private static final String ENHANCE_CLASS_37_ASYNC = "org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer"; | ||
|
||
@Override | ||
protected ClassMatch enhanceClass() { | ||
return byName(ENHANCE_CLASS_37_ASYNC); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...a/org/apache/skywalking/apm/plugin/kafka/define/Kafka37LegacyConsumerInstrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* 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.plugin.kafka.define; | ||
|
||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; | ||
import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; | ||
|
||
/** | ||
* For Kafka 3.7.x change | ||
* | ||
* <pre> | ||
* 1. The method named pollForFetchs was removed from KafkaConsumer to <code>AsyncKafkaConsumer</code> and <code>LegacyKafkaConsumer</code> | ||
* 2. Because of the enhance class was changed, so we should create new Instrumentation to intercept the method | ||
* </pre> | ||
*/ | ||
public class Kafka37LegacyConsumerInstrumentation extends KafkaConsumerInstrumentation { | ||
|
||
private static final String ENHANCE_CLASS_37_LEGACY = "org.apache.kafka.clients.consumer.internals.LegacyKafkaConsumer"; | ||
|
||
@Override | ||
protected ClassMatch enhanceClass() { | ||
return byName(ENHANCE_CLASS_37_LEGACY); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,6 @@ | |
3.0.2 | ||
3.1.2 | ||
3.2.3 | ||
3.6.0 | ||
3.7.0 | ||
3.7.1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the comment, I think we can focus on the difference instead of repeating what is already written in the parent class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the difference is the method named pollForFetchs was removed from KafkaConsumer to another two classes, so the original interceptor can not intercept it. Because of the enhance class is changed, so I create two new classes to repair the uncompatible problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant you can modify the comment for this class......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I forget to change the comment