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

add subscription state metrics #137

Merged
merged 3 commits into from
May 29, 2024
Merged

add subscription state metrics #137

merged 3 commits into from
May 29, 2024

Conversation

katherinelc321
Copy link
Collaborator

What this PR does

Before this PR:
There are no metrics that tracks subscription state
After this PR:
The subscription validator middleware emits metrics for the state
Added env var containing the region where the RP is deployed to the metric contains the region label

Jira: ARO-6006
Link to demo recording:

Special notes for your reviewer

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required
  • Deployment: The deployment process was considered and addressed if required
  • Testing: New code requires new unit tests.
  • Documentation: Is the documentation updated? Either in the doc located in focus area, in the README or in the code itself.
  • Customers: Is this change affecting customers? Is the release plan considered?

Copy link
Contributor

@s-amann s-amann left a comment

Choose a reason for hiding this comment

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

Left some suggestions for review

frontend/main.go Show resolved Hide resolved
frontend/middleware_validatesubscription.go Outdated Show resolved Hide resolved
frontend/middleware_validatesubscription_test.go Outdated Show resolved Hide resolved
Copy link

Please rebase pull request.

Copy link
Collaborator

@mbarnes mbarnes left a comment

Choose a reason for hiding this comment

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

This will need revisited once #145 is merged, but it looks good to merge now.

Eventually we'll want to discontinue using the in-memory cache and fetch subscription documents from CosmosDB. I was thinking it might make sense for the subscription state validation middleware to run first and cache the subscription document in the request context, so the metrics middleware wouldn't have to call CosmosDB again. We'll work that out later.

@mbarnes mbarnes merged commit aa1394a into Azure:main May 29, 2024
5 checks passed
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.

3 participants