apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.25k stars 8.77k forks source link

bugfix: fix prometheus fail to return seata metrics data when using Nacos #6786

Closed slievrly closed 3 weeks ago

slievrly commented 1 month ago

Ⅰ. Describe what this PR did

fix prometheus fail to return seata metrics data when using Nacos

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 52.41%. Comparing base (fde59c1) to head (83848b9). Report is 2 commits behind head on 2.x.

Files with missing lines Patch % Lines
...etrics/exporter/prometheus/PrometheusExporter.java 0.00% 3 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/6786/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/6786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## 2.x #6786 +/- ## ============================================ - Coverage 52.41% 52.41% -0.01% Complexity 6379 6379 ============================================ Files 1080 1080 Lines 37565 37566 +1 Branches 4451 4451 ============================================ Hits 19691 19691 - Misses 15923 15924 +1 Partials 1951 1951 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/6786?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...in/java/org/apache/seata/common/DefaultValues.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6786?src=pr&el=tree&filepath=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcommon%2FDefaultValues.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb21tb24vRGVmYXVsdFZhbHVlcy5qYXZh) | `0.00% <ø> (ø)` | | | [...etrics/exporter/prometheus/PrometheusExporter.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6786?src=pr&el=tree&filepath=metrics%2Fseata-metrics-exporter-prometheus%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fmetrics%2Fexporter%2Fprometheus%2FPrometheusExporter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWV0cmljcy9zZWF0YS1tZXRyaWNzLWV4cG9ydGVyLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlYXRhL21ldHJpY3MvZXhwb3J0ZXIvcHJvbWV0aGV1cy9Qcm9tZXRoZXVzRXhwb3J0ZXIuamF2YQ==) | `8.82% <0.00%> (-0.27%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6786/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
xjlgod commented 1 month ago

LGTM.I have tested by some examples.