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

feat(prometheus): Add consumer metric data support #2469

Merged
merged 2 commits into from Oct 21, 2020

Conversation

imjoey
Copy link
Member

@imjoey imjoey commented Oct 19, 2020

Signed-off-by: imjoey majunjiev@gmail.com

What this PR does / why we need it:

Fixes #2445 .

This PR is going to add consumer label for metric items. Based on this, we could trigger/send notifications to specified consumer when http status is unexpected, as well as get the estimated data about different consumers for several metrics.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

Signed-off-by: imjoey <majunjiev@gmail.com>
@liuxiran liuxiran self-assigned this Oct 19, 2020
@imjoey
Copy link
Member Author

imjoey commented Oct 19, 2020

ping @membphis @nic-chen @liuxiran for reviewing. Many thanks.

@liuxiran liuxiran removed their assignment Oct 19, 2020
metrics.status = prometheus:counter("http_status",
"HTTP status codes per service in APISIX",
{"code", "route", "service", "node"})
{"code", "route", "service", "consumer", "node"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps more code comments are better for new comer just like me to understand codes :)

Copy link
Member Author

Choose a reason for hiding this comment

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

@liuxiran more detailed comment is added, thanks for your suggestions.

Signed-off-by: imjoey <majunjiev@gmail.com>
Copy link
Member

@membphis membphis 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
Member

@juzhiyuan juzhiyuan left a comment

Choose a reason for hiding this comment

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

Good job!

@liuxiran
Copy link
Contributor

Merge it now :)

@liuxiran liuxiran merged commit 127dac9 into apache:master Oct 21, 2020
@imjoey imjoey deleted the feat/consumer-in-prometheus branch October 21, 2020 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[discuss](prometheus): Add consumer_id dimension in http metrics for prometheus plugin
4 participants