-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
fix: add env and project labels to feature updated metrics. #2043
Conversation
Coverage report
Test suite run success1144 tests passing in 188 suites. Report generated by 🧪jest coverage report action from 7ca517f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesnt work in my local env. I have tried flipping a kill switch multiple times with no luck
http://localhost:4242/internal-backstage/prometheus
# HELP feature_toggle_update_total Number of times a toggle has been updated
# TYPE feature_toggle_update_total counter
# HELP feature_toggle_usage_total Number of times a feature toggle has been used
# TYPE feature_toggle_usage_total counter
# HELP feature_toggles_total Number of feature toggles
# TYPE feature_toggles_total gauge
feature_toggles_total{version="4.15.0-beta.9"} 1
# HELP users_total Number of users
# TYPE users_total gauge
users_total 2
# HELP projects_total Number of projects
# TYPE projects_total gauge
projects_total 1
Works for normal toggles, but the "n/a" environment is strange as well
|
is feature toggle update total intended to increase for every time we change the status as well? If that is supposed to happen, there is some flaw there as well |
The problem is that some "updates" is not done for an environment (e.g creating a toggle, archiving it, etc). In those scenarios we have no environment to be set as label. The prometheus client fails hard if we do not specify the label value when it is configured. |
This does not make sense. A kill switch is not different from a normal toggle. It is just the type. |
would you prefer "undefined"? |
I think your explanation is good here, so n/a is a valid case here:) |
036e801
to
7ca517f
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it looks good!
feature_toggle_update_total{toggle="dummy",project="default",environment="development"} 4
feature_toggle_update_total{toggle="dummy",project="default",environment="production"} 2
feature_toggle_update_total{toggle="dummy2",project="default",environment="n/a"} 1
feature_toggle_update_total{toggle="dummy2",project="default",environment="development"} 3
feature_toggle_update_total{toggle="dummy2",project="default",environment="production"} 2
feature_toggle_update_total{toggle="testToggle",project="default",environment="production"} 8
feature_toggle_update_total{toggle="testToggle",project="default",environment="development"} 2
* PublicSignupTokens * bug fix * bug fixes and test * bug fixes and test * bug fixes and test * Add feature flag * tests * tests * Update 20220908093515-add-public-signup-tokens.js Bug Fix * task: use swc instead of ts-jest (#2042) * Add a counter for total number of environments (#1964) * add groupId to gradual rollout template (#2045) * add groupId to gradual rollout template * FMT * Improve tabs UI on smaller devices (#2014) * Improve tabs UI on smaller devices * Improve tabs UI on smaller devices * bug fix * add proper scrollable tabs * removed centered from Tabs (conflicts with scrollable) * PR comments * 4.15.0-beta.10 * Fix broken doc links (#2046) ## What This PR fixes some broken links that have been hanging around in the docs for what seems like a very long time. ## Why As discovered by the link check in #1912, there are a fair few broken links in the docs. Everyone hates broken links because it makes it harder to understand what they were supposed to be pointing at. ## How There are 3 types of links that have been fixed: - Links that should have been internal but were absolute. E.g. `https://docs.getunleash.io/path/article` that should have been `./article.md` - External links that have changed, such as Slack's API description - GitHub links to files that either no longer exist or that have been moved. These links generally pointed to `master`/`main`, meaning they are subject to change. They have been replaced with permalinks pointing to specific commits. ----- * docs: fix slack api doc link * docs: update links in migration guide * docs: fix broken link to ancient feature schema validation * docs: update links to v3 auth hooks * docs: update broken link in the go sdk article * Fix: use permalink for GitHub link * docs: fix wrong google auth link * 4.15.0 * 4.15.1 * docs: update link for symfony sdk (#2048) The doc link appears to have pointed at an address that is no longer reachable. Instead, let's point to the equivalent GitHub link Relates to and closes #2047 * docs: test broken links in website (#1912) The action triggers manually as a first step to test this functionality. In the near future, we might schedule it * Schedule link checker action (#2050) Runs at 12:30 UTC on Mon, Tue, Wed, Thu and Fri * fix: add env and project labels to feature updated metrics. (#2043) * Revert workflow (#2051) * update snapshot * PR comments * Added Events and tests * Throw error if token not found Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> Co-authored-by: Thomas Heartman <thomas@getunleash.ai> Co-authored-by: Gastón Fournier <gaston@getunleash.ai> Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com> Co-authored-by: sjaanus <sellinjaanus@gmail.com>
About the changes
Adds environment and project labels to feature updated metrics. It makes it easier to monitor usage of Unleash in larger deployments.