Skip to content
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

support prometheus #1280

Merged
merged 2 commits into from
Jan 3, 2023
Merged

support prometheus #1280

merged 2 commits into from
Jan 3, 2023

Conversation

JoeCqupt
Copy link
Contributor

Motivation:

#885

Modification:

metrics support prometheus

Result:

Fixes #885

@sofastack-bot sofastack-bot bot added cla:yes CLA is ok First-time contributor First-time contributor size/XL labels Nov 23, 2022
@OrezzerO
Copy link
Contributor

Can we combine prometheus with grafana ? And provide a config for that . So that users can easily use sofarpc with prometheus.

Another question, how can we open or close this feature ?

@JoeCqupt
Copy link
Contributor Author

Another question, how can we open or close this feature ?


        // use Prometheus-client defaultRegistry for example
        CollectorRegistry registry = CollectorRegistry.defaultRegistry;

        SofaRpcMetricsCollector collector = new SofaRpcMetricsCollector();
        
        // register collector  to open this feature
        registry.register(collector);

        // unregister collector to close this feature
        registry.unregister(collector);

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Merging #1280 (c91820f) into master (2a0556d) will increase coverage by 0.08%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1280      +/-   ##
============================================
+ Coverage     71.93%   72.02%   +0.08%     
- Complexity      780      783       +3     
============================================
  Files           413      414       +1     
  Lines         17555    17565      +10     
  Branches       2739     2740       +1     
============================================
+ Hits          12629    12652      +23     
+ Misses         3532     3521      -11     
+ Partials       1394     1392       -2     
Impacted Files Coverage Δ
.../main/java/com/alipay/sofa/rpc/common/Version.java 100.00% <ø> (ø)
...ansport/bolt/ReuseBoltClientConnectionManager.java 69.56% <0.00%> (-2.90%) ⬇️
...alipay/sofa/rpc/codec/protobuf/ProtobufHelper.java 77.08% <0.00%> (-2.09%) ⬇️
...n/java/com/alipay/sofa/rpc/common/SofaConfigs.java 84.90% <0.00%> (-1.89%) ⬇️
.../rpc/bootstrap/triple/TripleConsumerBootstrap.java 100.00% <0.00%> (ø)
...rpc/bootstrap/triple/TripleClientProxyInvoker.java 100.00% <0.00%> (ø)
...va/com/alipay/sofa/rpc/client/AbstractCluster.java 71.54% <0.00%> (+0.52%) ⬆️
...ofa/rpc/tracer/sofatracer/TripleTracerAdapter.java 61.31% <0.00%> (+0.57%) ⬆️
...pay/sofa/rpc/config/ConfigUniqueNameGenerator.java 94.44% <0.00%> (+0.69%) ⬆️
...lipay/sofa/rpc/message/AbstractResponseFuture.java 57.01% <0.00%> (+0.87%) ⬆️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@OrezzerO OrezzerO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@EvenLjj EvenLjj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EvenLjj EvenLjj merged commit a6e234b into sofastack:master Jan 3, 2023
@EvenLjj EvenLjj added this to the 5.9.1 milestone Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes CLA is ok First-time contributor First-time contributor size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

实现标准的metrics for Prometheus
3 participants