-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Auth: Add anonymous users view and stats #78685
Conversation
Hello @eleijonmarck!
Please, if the current pull request addresses a bug fix, label it with the |
- anonymous users users page - add feature toggle `anonymousAccess` - remove check for enterprise for `Device-Id` header in request - add anonusers/device count to stats
d85bbec
to
f6575eb
Compare
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.
Great to see progress on this! Adding some comments that I had after a quick skim through the PR.
docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
Outdated
Show resolved
Hide resolved
c8f314e
to
5f97916
Compare
6ec1e17
to
dd34d74
Compare
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
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.
Frontend changes look good!
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-78685-to-v10.2.x origin/v10.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 59bdff0280d52ca5d8918157d7697b9279b25501 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-78685-to-v10.2.x
# Create the PR body template
PR_BODY=$(gh pr view 78685 --json body --template 'Backport 59bdff0280d52ca5d8918157d7697b9279b25501 from #78685{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.2.x] Auth: Add anonymous users view and stats" --body-file - --label "type/docs" --label "area/backend" --label "area/frontend" --label "add to changelog" --label "product-approved" --label "backport" --base v10.2.x --milestone 10.2.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-78685-to-v10.2.x
# Create a pull request where the `base` branch is `v10.2.x` and the `compare`/`head` branch is `backport-78685-to-v10.2.x`.
# Remove the local backport branch
git switch main
git branch -D backport-78685-to-v10.2.x |
* Add anonymous stats and user table - anonymous users users page - add feature toggle `anonymousAccess` - remove check for enterprise for `Device-Id` header in request - add anonusers/device count to stats * promise all, review comments * make use of promise all settled * refactoring: devices instead of users * review comments, moved countdevices to httpserver * fakeAnonService for tests and generate openapi spec * do not commit openapi3 and api-merged * add openapi * Apply suggestions from code review Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> * formatin * precise anon devices to avoid confusion --------- Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: jguer <me@jguer.space> (cherry picked from commit 59bdff0)
* Auth: Add anonymous users view and stats (#78685) * Add anonymous stats and user table - anonymous users users page - add feature toggle `anonymousAccess` - remove check for enterprise for `Device-Id` header in request - add anonusers/device count to stats * promise all, review comments * make use of promise all settled * refactoring: devices instead of users * review comments, moved countdevices to httpserver * fakeAnonService for tests and generate openapi spec * do not commit openapi3 and api-merged * add openapi * Apply suggestions from code review Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> * formatin * precise anon devices to avoid confusion --------- Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: jguer <me@jguer.space> (cherry picked from commit 59bdff0) * update component to experimental --------- Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
...(config.featureToggles.displayAnonymousStats && stats.activeDevices | ||
? [ | ||
{ name: 'Active anonymous devices in last 30 days', value: stats.activeDevices }, | ||
{ name: 'Active anonymous users in last 30 days', value: Math.floor(stats.activeDevices / 3) }, |
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.
@eleijonmarck i know this is behind a feature toggle and stuff, but is this intentional? doesn't feel like the number of active users will be numActiveDevices / 3
😅
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.
@ashharrison90 yea this is intentional. We count the number of users based on devices is activeDevices/3
I can send over the design doc from product. This is products decision
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.
...ok 😅
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.
@eleijonmarck I can see how it's pretty confusing though. Maybe we can add a comment explaining the thinking (in one of the future PRs)?
What is this feature?
displayAnonymousStats
X-Grafana-Device-Id
header in requestWhy do we need this feature?
We want to surface the anonymous users to our users as well as show a count of them in the stats page.
Special notes for your reviewer:
Please check that: