You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "polaru (via GitHub)" <gi...@apache.org> on 2023/10/04 14:30:21 UTC
[PR] fix: Label http_requests_total metric as counter [apisix]
polaru opened a new pull request, #10290:
URL: https://github.com/apache/apisix/pull/10290
### Description
The number never goes down, except for when it gets reset to zero, which is in line with the definition from [Prometheus docs](https://prometheus.io/docs/concepts/metric_types/#counter).
> A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.
Fixes #10289
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [ ] I have explained the changes or the new features added to this PR
- [ ] I have added tests corresponding to this change
- [x] I have updated the documentation to reflect this change
- [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
<!--
Note
1. Mark the PR as draft until it's ready to be reviewed.
2. Always add/update tests for any changes unless you have a good reason.
3. Always update the documentation to reflect the changes made in the PR.
4. Make a new commit to resolve conversations instead of `push -f`.
5. To resolve merge conflicts, merge master instead of rebasing.
6. Use "request review" to notify the reviewer after making changes.
7. Only a reviewer can mark a conversation as resolved.
-->
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on PR #10290:
URL: https://github.com/apache/apisix/pull/10290#issuecomment-1786467060
@polaru Though it would look like at first that counter should be used here but we have to use gauge because APISIX doesn't keep track of this metric by itself. It uses nginx `stub_status` - http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
This always returns absolute values. So here we have to deal with this metric as not just a value that goes up by some amount which APISIX controls but as a gauge metric that APISIX reads from nginx. Given that I am closing this issue. Feel free to reopen if you have doubts.
// @monkeyDluffy6017
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on PR #10290:
URL: https://github.com/apache/apisix/pull/10290#issuecomment-1767800190
@polaru Are you still working on this?
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #10290:
URL: https://github.com/apache/apisix/pull/10290#issuecomment-1769799881
@polaru Thanks for your contribution, we will wait for you to pick it up
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup closed pull request #10290: fix: Label http_requests_total metric as counter
URL: https://github.com/apache/apisix/pull/10290
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "polaru (via GitHub)" <gi...@apache.org>.
polaru commented on PR #10290:
URL: https://github.com/apache/apisix/pull/10290#issuecomment-1768160112
> @polaru Are you still working on this?
At the moment I had to prioritize other work and I don't expect to be able to pick it up in the next 2 weeks either.
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on PR #10290:
URL: https://github.com/apache/apisix/pull/10290#issuecomment-1747422145
@polaru please checkout the failing ci
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Label http_requests_total metric as counter [apisix]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on PR #10290:
URL: https://github.com/apache/apisix/pull/10290#issuecomment-1782525276
@polaru You need to adjust the calling functions accordingly as well like set->increment. That is why tests are are failing. If you're no longer working on this then will you give permissions to me on this branch?
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org