You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/29 11:37:20 UTC
[GitHub] [shardingsphere] jiangML opened a new pull request, #22505: Refactor agent plugin to support JDBC
jiangML opened a new pull request, #22505:
URL: https://github.com/apache/shardingsphere/pull/22505
For #22409
Changes proposed in this pull request:
- Refactor agent plugin to support JDBC
---
Before committing this PR, I'm sure that I have checked the following options:
- [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [ ] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [ ] I have added corresponding unit tests for my changes.
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jiangML commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
jiangML commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035588502
##########
agent/plugins/metrics/prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/collector/BuildInfoCollector.java:
##########
@@ -32,23 +33,28 @@
* Build information collector.
*/
@Slf4j
+@AllArgsConstructor
public final class BuildInfoCollector extends Collector {
private static final String PROXY_BOOTSTRAP_CLASS = "org.apache.shardingsphere.proxy.Bootstrap";
private static final PrometheusWrapperFactory FACTORY = new PrometheusWrapperFactory();
+ private final boolean isRunWithProxy;
Review Comment:
I mean the same thing, let me adjust 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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035581610
##########
agent/plugins/metrics/prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/collector/BuildInfoCollector.java:
##########
@@ -32,23 +33,28 @@
* Build information collector.
*/
@Slf4j
+@AllArgsConstructor
public final class BuildInfoCollector extends Collector {
private static final String PROXY_BOOTSTRAP_CLASS = "org.apache.shardingsphere.proxy.Bootstrap";
private static final PrometheusWrapperFactory FACTORY = new PrometheusWrapperFactory();
+ private final boolean isRunWithProxy;
+
@Override
public List<MetricFamilySamples> collect() {
Optional<GaugeMetricFamily> artifactInfo = FACTORY.createGaugeMetricFamily(MetricIds.BUILD_INFO);
if (!artifactInfo.isPresent()) {
return Collections.emptyList();
}
addMetric(artifactInfo.get(), getClass().getPackage());
- try {
- addMetric(artifactInfo.get(), Class.forName(PROXY_BOOTSTRAP_CLASS).getPackage());
- } catch (final ClassNotFoundException ignored) {
- log.warn("No proxy class find");
+ if (isRunWithProxy) {
+ try {
+ addMetric(artifactInfo.get(), Class.forName(PROXY_BOOTSTRAP_CLASS).getPackage());
+ } catch (final ClassNotFoundException ignored) {
+ log.warn("No proxy class find");
Review Comment:
`find` shoule be `found`.
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035572096
##########
agent/api/src/main/java/org/apache/shardingsphere/agent/spi/boot/PluginBootService.java:
##########
@@ -27,8 +27,9 @@ public interface PluginBootService extends AgentTypedSPI, AutoCloseable {
/**
* Start plugin boot service.
- *
- * @param pluginConfig plugin configuration
+ *
+ * @param pluginConfig pluginConfig plugin configuration
Review Comment:
Duplicate pluginConfig
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang merged pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jiangML commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
jiangML commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035601296
##########
agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/PluginBootServiceManager.java:
##########
@@ -38,19 +38,20 @@ public final class PluginBootServiceManager {
/**
* Start all services.
- *
+ *
Review Comment:
ok thanks, i will remove
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jiangML commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
jiangML commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035588998
##########
agent/plugins/metrics/prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/collector/BuildInfoCollector.java:
##########
@@ -32,23 +33,28 @@
* Build information collector.
*/
@Slf4j
+@AllArgsConstructor
public final class BuildInfoCollector extends Collector {
private static final String PROXY_BOOTSTRAP_CLASS = "org.apache.shardingsphere.proxy.Bootstrap";
private static final PrometheusWrapperFactory FACTORY = new PrometheusWrapperFactory();
+ private final boolean isRunWithProxy;
+
@Override
public List<MetricFamilySamples> collect() {
Optional<GaugeMetricFamily> artifactInfo = FACTORY.createGaugeMetricFamily(MetricIds.BUILD_INFO);
if (!artifactInfo.isPresent()) {
return Collections.emptyList();
}
addMetric(artifactInfo.get(), getClass().getPackage());
- try {
- addMetric(artifactInfo.get(), Class.forName(PROXY_BOOTSTRAP_CLASS).getPackage());
- } catch (final ClassNotFoundException ignored) {
- log.warn("No proxy class find");
+ if (isRunWithProxy) {
+ try {
+ addMetric(artifactInfo.get(), Class.forName(PROXY_BOOTSTRAP_CLASS).getPackage());
+ } catch (final ClassNotFoundException ignored) {
+ log.warn("No proxy class find");
Review Comment:
ok
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035580442
##########
agent/plugins/metrics/prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/collector/BuildInfoCollector.java:
##########
@@ -32,23 +33,28 @@
* Build information collector.
*/
@Slf4j
+@AllArgsConstructor
public final class BuildInfoCollector extends Collector {
private static final String PROXY_BOOTSTRAP_CLASS = "org.apache.shardingsphere.proxy.Bootstrap";
private static final PrometheusWrapperFactory FACTORY = new PrometheusWrapperFactory();
+ private final boolean isRunWithProxy;
Review Comment:
What is the different between `isEnhancedForProxy` and `isRunWithProxy`
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jiangML commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
jiangML commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035593330
##########
agent/api/src/main/java/org/apache/shardingsphere/agent/spi/boot/PluginBootService.java:
##########
@@ -27,8 +27,9 @@ public interface PluginBootService extends AgentTypedSPI, AutoCloseable {
/**
* Start plugin boot service.
- *
- * @param pluginConfig plugin configuration
+ *
+ * @param pluginConfig pluginConfig plugin configuration
Review Comment:
It did repeat that I modified 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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#discussion_r1035579338
##########
agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/PluginBootServiceManager.java:
##########
@@ -38,19 +38,20 @@ public final class PluginBootServiceManager {
/**
* Start all services.
- *
+ *
Review Comment:
unnecessary space
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #22505: Refactor agent plugin to support JDBC
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #22505:
URL: https://github.com/apache/shardingsphere/pull/22505#issuecomment-1330665547
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/22505?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#22505](https://codecov.io/gh/apache/shardingsphere/pull/22505?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0f143ca) into [master](https://codecov.io/gh/apache/shardingsphere/commit/34c5cba3bb9bc58c61496112ba44f533a63f9b94?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (34c5cba) will **decrease** coverage by `0.01%`.
> The diff coverage is `32.25%`.
```diff
@@ Coverage Diff @@
## master #22505 +/- ##
============================================
- Coverage 50.98% 50.97% -0.02%
+ Complexity 2514 2513 -1
============================================
Files 4185 4185
Lines 58239 58253 +14
Branches 9902 9905 +3
============================================
+ Hits 29694 29695 +1
- Misses 26015 26027 +12
- Partials 2530 2531 +1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/22505?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...pi/definition/AbstractPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9hZ2VudC9zcGkvZGVmaW5pdGlvbi9BYnN0cmFjdFBsdWdpbkRlZmluaXRpb25TZXJ2aWNlLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...ingsphere/agent/core/plugin/AgentPluginLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvY29yZS9wbHVnaW4vQWdlbnRQbHVnaW5Mb2FkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...definition/BaseLoggingPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy9sb2dnaW5nL2Jhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L3BsdWdpbi9sb2dnaW5nL2Jhc2UvZGVmaW5pdGlvbi9CYXNlTG9nZ2luZ1BsdWdpbkRlZmluaXRpb25TZXJ2aWNlLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [.../definition/PrometheusPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy9tZXRyaWNzL3Byb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9kZWZpbml0aW9uL1Byb21ldGhldXNQbHVnaW5EZWZpbml0aW9uU2VydmljZS5qYXZh) | `47.61% <0.00%> (-2.39%)` | :arrow_down: |
| [...eger/definition/JaegerPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy90cmFjaW5nL2phZWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvcGx1Z2luL3RyYWNpbmcvamFlZ2VyL2RlZmluaXRpb24vSmFlZ2VyUGx1Z2luRGVmaW5pdGlvblNlcnZpY2UuamF2YQ==) | `88.88% <0.00%> (-5.23%)` | :arrow_down: |
| [...n/OpenTelemetryTracingPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy90cmFjaW5nL29wZW50ZWxlbWV0cnkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L3BsdWdpbi90cmFjaW5nL29wZW50ZWxlbWV0cnkvZGVmaW5pdGlvbi9PcGVuVGVsZW1ldHJ5VHJhY2luZ1BsdWdpbkRlZmluaXRpb25TZXJ2aWNlLmphdmE=) | `88.88% <0.00%> (-5.23%)` | :arrow_down: |
| [...definition/OpenTracingPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy90cmFjaW5nL29wZW50cmFjaW5nL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9hZ2VudC9wbHVnaW4vdHJhY2luZy9vcGVudHJhY2luZy9kZWZpbml0aW9uL09wZW5UcmFjaW5nUGx1Z2luRGVmaW5pdGlvblNlcnZpY2UuamF2YQ==) | `88.88% <0.00%> (-5.23%)` | :arrow_down: |
| [...pkin/definition/ZipkinPluginDefinitionService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy90cmFjaW5nL3ppcGtpbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvcGx1Z2luL3RyYWNpbmcvemlwa2luL2RlZmluaXRpb24vWmlwa2luUGx1Z2luRGVmaW5pdGlvblNlcnZpY2UuamF2YQ==) | `88.88% <0.00%> (-5.23%)` | :arrow_down: |
| [...rometheus/service/PrometheusPluginBootService.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy9tZXRyaWNzL3Byb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9zZXJ2aWNlL1Byb21ldGhldXNQbHVnaW5Cb290U2VydmljZS5qYXZh) | `60.60% <54.54%> (-7.40%)` | :arrow_down: |
| [...trics/prometheus/collector/BuildInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvcGx1Z2lucy9tZXRyaWNzL3Byb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvQnVpbGRJbmZvQ29sbGVjdG9yLmphdmE=) | `68.75% <80.00%> (ø)` | |
| ... and [4 more](https://codecov.io/gh/apache/shardingsphere/pull/22505/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org