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

Prometheus metric extension #735

Closed
wants to merge 3 commits into from

Conversation

CarpenterLee
Copy link
Contributor

Signed-off-by: Carpenter Lee [email protected]

Describe what this PR does / why we need it

Sentinel real-time statistics are useful for system monitoring. #730 adds extension interface to Sentinel internal statistics, which provides an implementation independent way to get Sentinel statistics.

This PR provides Prometheus backend implementation of MetricExtension.

Does this pull request fix one issue?

NONE

Describe how you did it

Provides Prometheus backend implementation of MetricExtension.

Describe how to verify it

Run test cases.

Special notes for reviews

@sczyh30 sczyh30 added area/metrics Issues or PRs related to metrics and monitoring kind/feature Category issues or prs related to feature request. to-review To review labels May 6, 2019
@codecov-io
Copy link

codecov-io commented May 6, 2019

Codecov Report

Merging #735 into master will increase coverage by 0.31%.
The diff coverage is 94.23%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #735      +/-   ##
============================================
+ Coverage     41.04%   41.36%   +0.31%     
- Complexity     1338     1349      +11     
============================================
  Files           301      302       +1     
  Lines          8630     8682      +52     
  Branches       1159     1159              
============================================
+ Hits           3542     3591      +49     
- Misses         4663     4666       +3     
  Partials        425      425
Impacted Files Coverage Δ Complexity Δ
...xtension/prometheus/PrometheusMetricExtension.java 94.23% <94.23%> (ø) 12 <12> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a268338...9ad95b5. Read the comment docs.

@sczyh30
Copy link
Member

sczyh30 commented May 6, 2019

Related to #211

@anjia0532
Copy link

Has there been any progress in this matter?

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Billzaifei
Copy link
Contributor

Hi, @CarpenterLee
I think the extension still need to improve. It should provide some kind of tags to distinguish from provider metrics from consumer ones.In my practice, the two metrics always make me confused.

@sczyh30 sczyh30 removed the to-review To review label Jun 28, 2020
@sczyh30 sczyh30 closed this Jun 28, 2020
@Billzaifei
Copy link
Contributor

Billzaifei commented Jun 29, 2020

Hi, @sczyh30 ! Is my request(#1566 ) closed?

Issue Description
Type: feature request

Describe what happened (or what feature you want)
For the below interface, I used it to export prometheus metrics.
com.alibaba.csp.sentinel.metric.extension.MetricExtension

Take the method[addPass(String resource, int n, Object... args)] for example.
I want to distinguish [in] type from [out] type using it as the prometheus tag. #provider[in]/consumer[out]

So I think I need a feature replacing the input String parameter[resource] with the below class type:

com.alibaba.csp.sentinel.slotchain.ResourceWrapper

@sczyh30
Copy link
Member

sczyh30 commented Jun 29, 2020

Hi, @sczyh30 ! Is my request(#1566 ) closed?

Issue Description
Type: feature request

Describe what happened (or what feature you want)
For the below interface, I used it to export prometheus metrics.
com.alibaba.csp.sentinel.metric.extension.MetricExtension

Take the method[addPass(String resource, int n, Object... args)] for example.
I want to distinguish [in] type from [out] type using it as the prometheus tag. #provider[in]/consumer[out]

So I think I need a feature replacing the input String parameter[resource] with the below class type:

com.alibaba.csp.sentinel.slotchain.ResourceWrapper

This PR is outdated. New PRs are welcomed!

@Billzaifei
Copy link
Contributor

Hi, @sczyh30 ! Is my request(#1566 ) closed?
Issue Description
Type: feature request
Describe what happened (or what feature you want)
For the below interface, I used it to export prometheus metrics.
com.alibaba.csp.sentinel.metric.extension.MetricExtension
Take the method[addPass(String resource, int n, Object... args)] for example.
I want to distinguish [in] type from [out] type using it as the prometheus tag. #provider[in]/consumer[out]
So I think I need a feature replacing the input String parameter[resource] with the below class type:
com.alibaba.csp.sentinel.slotchain.ResourceWrapper

This PR is outdated. New PRs are welcomed!

Enhancement/advanced metric extension tagging entrytype #1609 raised for the feature request#1566

@wushengju
Copy link

I have try this way to send Metric to prometheus, but i can't find metics like sentinel_pass_requests_total in http://localhost:9527/actuator/prometheus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics Issues or PRs related to metrics and monitoring kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants