Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
2b839d43
Unverified
Commit
2b839d43
authored
3 years ago
by
Noah Moss
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add analytics-uuid setting for snowplow (#18607)
parent
dfd30e5a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/public_settings.clj
+17
-5
17 additions, 5 deletions
src/metabase/public_settings.clj
src/metabase/util/stats.clj
+1
-1
1 addition, 1 deletion
src/metabase/util/stats.clj
with
18 additions
and
6 deletions
src/metabase/public_settings.clj
+
17
−
5
View file @
2b839d43
...
...
@@ -57,6 +57,14 @@
(
deferred-tru
"The name used for this instance of Metabase."
)
:default
"Metabase"
)
(
defn-
uuid-nonce
"Getter for settings that should be set to a UUID the first time they are fetched."
[
setting
]
(
or
(
setting/get-string
setting
)
(
let
[
value
(
str
(
UUID/randomUUID
))]
(
setting/set-string!
setting
value
)
value
)))
(
defsetting
site-uuid
;; Don't i18n this docstring because it's not user-facing! :)
"Unique identifier used for this instance of Metabase. This is set once and only once the first time it is fetched via
...
...
@@ -64,11 +72,15 @@
:visibility
:internal
:setter
:none
;; magic getter will either fetch value from DB, or if no value exists, set the value to a random UUID.
:getter
(
fn
[]
(
or
(
setting/get-string
:site-uuid
)
(
let
[
value
(
str
(
UUID/randomUUID
))]
(
setting/set-string!
:site-uuid
value
)
value
))))
:getter
#
(
uuid-nonce
:site-uuid
))
(
defsetting
analytics-uuid
(
str
(
deferred-tru
"Unique identifier to be used in Snowplow analytics, to identify this instance of Metabase."
)
" "
(
deferred-tru
"This is a public setting since some analytics events are sent prior to initial setup."
))
:visibility
:public
:setter
:none
:getter
#
(
uuid-nonce
:analytics-uuid
))
(
defn-
normalize-site-url
[
^
String
s
]
(
let
[
;; remove trailing slashes
...
...
This diff is collapsed.
Click to expand it.
src/metabase/util/stats.clj
+
1
−
1
View file @
2b839d43
...
...
@@ -106,7 +106,7 @@
:default
:unknown
))
(
defn-
instance-settings
"Figure out global info about his instance"
"Figure out global info about
t
his instance"
[]
{
:version
(
config/mb-version-info
:tag
)
:running_on
(
environment-type
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment