You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/13 15:31:42 UTC
[GitHub] [incubator-shenyu] erdengk opened a new pull request, #3549: [type:Integration Test] Add metrics-plugin Integration Test
erdengk opened a new pull request, #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549
Add metrics-plugin Integration Test
--
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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] erdengk commented on a diff in pull request #3549: [type:Integration Test] Add metrics-plugin Integration Test
Posted by GitBox <gi...@apache.org>.
erdengk commented on code in PR #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549#discussion_r906631187
##########
shenyu-integrated-test/shenyu-integrated-test-http/src/main/resources/application.yml:
##########
@@ -33,6 +33,14 @@ management:
enabled: false
shenyu:
+ metrics:
+ enabled: true
+ name: prometheus
+ host: 127.0.0.1
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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] JooKS-me commented on a diff in pull request #3549: [type:Integration Test] Add metrics-plugin Integration Test
Posted by GitBox <gi...@apache.org>.
JooKS-me commented on code in PR #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549#discussion_r906630416
##########
shenyu-integrated-test/shenyu-integrated-test-http/config/prometheus.yml:
##########
@@ -0,0 +1,26 @@
+# 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.
+
+global:
+ scrape_interval: 5s
+
+scrape_configs:
+ - job_name: 'Apache ShenYu'
+ static_configs:
+ - targets: ['127.0.0.1:8090']
Review Comment:
```suggestion
- targets: ['shenyu-integrated-test-http:8090']
```
##########
shenyu-integrated-test/shenyu-integrated-test-http/src/main/resources/application.yml:
##########
@@ -33,6 +33,14 @@ management:
enabled: false
shenyu:
+ metrics:
+ enabled: true
+ name: prometheus
+ host: 127.0.0.1
Review Comment:
```suggestion
host: 0.0.0.0
```
--
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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] codecov-commenter commented on pull request #3549: [type:Integration Test] Add metrics-plugin Integration Test
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549#issuecomment-1154091287
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3549?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 [#3549](https://codecov.io/gh/apache/incubator-shenyu/pull/3549?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6755406) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/b2b5f6f48ae0e9840b795e8e045a65b1f61b0836?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b2b5f6f) will **decrease** coverage by `0.33%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #3549 +/- ##
============================================
- Coverage 62.83% 62.49% -0.34%
+ Complexity 5571 5535 -36
============================================
Files 842 842
Lines 23351 23351
Branches 2118 2116 -2
============================================
- Hits 14672 14594 -78
- Misses 7331 7404 +73
- Partials 1348 1353 +5
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/3549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...plugin/logging/rocketmq/LoggingRocketMQPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvTG9nZ2luZ1JvY2tldE1RUGx1Z2luLmphdmE=) | `22.72% <0.00%> (-72.73%)` | :arrow_down: |
| [...ache/shenyu/plugin/grpc/cache/GrpcClientCache.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9jYWNoZS9HcnBjQ2xpZW50Q2FjaGUuamF2YQ==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [...controller/ShenyuClientHttpRegistryController.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vY29udHJvbGxlci9TaGVueXVDbGllbnRIdHRwUmVnaXN0cnlDb250cm9sbGVyLmphdmE=) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
| [...ogging/rocketmq/body/LoggingServerHttpRequest.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvYm9keS9Mb2dnaW5nU2VydmVySHR0cFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-20.00%)` | :arrow_down: |
| [...ruptor/RegisterClientServerDisruptorPublisher.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vZGlzcnVwdG9yL1JlZ2lzdGVyQ2xpZW50U2VydmVyRGlzcnVwdG9yUHVibGlzaGVyLmphdmE=) | `52.94% <0.00%> (-11.77%)` | :arrow_down: |
| [...a/org/apache/shenyu/common/utils/VersionUtils.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi91dGlscy9WZXJzaW9uVXRpbHMuamF2YQ==) | `67.85% <0.00%> (-10.72%)` | :arrow_down: |
| [.../apache/shenyu/admin/model/dto/BatchCommonDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0JhdGNoQ29tbW9uRFRPLmphdmE=) | `50.00% <0.00%> (-7.15%)` | :arrow_down: |
| [...apache/shenyu/admin/model/dto/AuthPathWarpDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0F1dGhQYXRoV2FycERUTy5qYXZh) | `57.14% <0.00%> (-7.15%)` | :arrow_down: |
| [...org/apache/shenyu/admin/model/dto/AuthPathDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0F1dGhQYXRoRFRPLmphdmE=) | `58.82% <0.00%> (-5.89%)` | :arrow_down: |
| [...rg/apache/shenyu/plugin/rewrite/RewritePlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLXJld3JpdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vcmV3cml0ZS9SZXdyaXRlUGx1Z2luLmphdmE=) | `66.66% <0.00%> (-5.56%)` | :arrow_down: |
| ... and [30 more](https://codecov.io/gh/apache/incubator-shenyu/pull/3549/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) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3549?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3549?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b2b5f6f...6755406](https://codecov.io/gh/apache/incubator-shenyu/pull/3549?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] erdengk commented on a diff in pull request #3549: [type:Integration Test] Add metrics-plugin Integration Test
Posted by GitBox <gi...@apache.org>.
erdengk commented on code in PR #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549#discussion_r906660941
##########
shenyu-integrated-test/shenyu-integrated-test-common/src/main/java/org/apache/shenyu/integratedtest/common/helper/HttpHelper.java:
##########
@@ -264,4 +265,25 @@ public Response getHttpService(final String url, final Map<String, Object> heade
Request request = requestBuilder.build();
return client.newCall(request).execute();
}
+
+ /**
+ * Send a get http request to shenyu gateway .
+ *
+ * @param <S> response type
+ * @param headers headers
+ * @param path path
+ * @param type type of response passed to {@link Gson#fromJson(String, Type)}
+ * @return response from gateway
+ * @throws IOException IO exception
+ */
+ public <S> S getHttpService(final String path, final Map<String, Object> headers, final Type type) throws IOException {
+ Response response = getHttpService(path, headers);
+ String respBody = Objects.requireNonNull(response.body()).string();
+ LOG.info("testMetricsPluginFromGateway({}) resp({})", path, respBody);
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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] JooKS-me merged pull request #3549: [type:Integration Test] Add metrics-plugin Integration Test
Posted by GitBox <gi...@apache.org>.
JooKS-me merged PR #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549
--
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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] JooKS-me commented on a diff in pull request #3549: [type:Integration Test] Add metrics-plugin Integration Test
Posted by GitBox <gi...@apache.org>.
JooKS-me commented on code in PR #3549:
URL: https://github.com/apache/incubator-shenyu/pull/3549#discussion_r906660685
##########
shenyu-integrated-test/shenyu-integrated-test-common/src/main/java/org/apache/shenyu/integratedtest/common/helper/HttpHelper.java:
##########
@@ -264,4 +265,25 @@ public Response getHttpService(final String url, final Map<String, Object> heade
Request request = requestBuilder.build();
return client.newCall(request).execute();
}
+
+ /**
+ * Send a get http request to shenyu gateway .
+ *
+ * @param <S> response type
+ * @param headers headers
+ * @param path path
+ * @param type type of response passed to {@link Gson#fromJson(String, Type)}
+ * @return response from gateway
+ * @throws IOException IO exception
+ */
+ public <S> S getHttpService(final String path, final Map<String, Object> headers, final Type type) throws IOException {
+ Response response = getHttpService(path, headers);
+ String respBody = Objects.requireNonNull(response.body()).string();
+ LOG.info("testMetricsPluginFromGateway({}) resp({})", path, respBody);
Review Comment:
Pls modify the log, this method should be a common util.
##########
shenyu-integrated-test/shenyu-integrated-test-http/docker-compose.yml:
##########
@@ -87,13 +87,30 @@ services:
condition: service_healthy
ports:
- "9195:9195"
+ - "8090:8090"
networks:
- shenyu
healthcheck:
test: [ "CMD", "wget", "http://shenyu-integrated-test-http:9195/actuator/health" ]
timeout: 2s
retries: 30
+ shenyu-prometheus:
+ image: prom/prometheus:v2.35.0
+ container_name: shenyu-prometheus
+ ports:
+ - "9090:9090"
+ depends_on:
+ shenyu-integrated-test-http:
+ condition: service_healthy
+ networks:
+ - shenyu
+ volumes:
+ - type: bind
+ source: ./config/prometheus.yml
+ target: /etc/prometheus/prometheus.yml
+
+
Review Comment:
remove meaningless blank lines
##########
shenyu-integrated-test/shenyu-integrated-test-http/config/prometheus.yml:
##########
@@ -0,0 +1,26 @@
+# 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.
+
+global:
+ scrape_interval: 5s
+
+scrape_configs:
+ - job_name: 'Apache ShenYu'
+ static_configs:
+ - targets: ['shenyu-integrated-test-http:8090']
+ - job_name: "prometheus"
+ static_configs:
+ - targets: ["localhost:9090"]
Review Comment:
Add a blank line at the end of the file
--
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@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org