diff --git a/cmd/common.go b/cmd/common.go index 71b0e5f8f..513cbdb78 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -39,6 +39,7 @@ const ( modeKonnect = iota modeKong modeKongEnterprise + modeLocal ) var jsonOutput diff.JSONOutputObject @@ -488,6 +489,8 @@ func sendAnalytics(cmd, kongVersion string, mode mode) error { modeStr = "konnect" case modeKongEnterprise: modeStr = "enterprise" + case modeLocal: + modeStr = "local" } return utils.SendAnalytics(cmd, VERSION, kongVersion, modeStr) } diff --git a/cmd/file_addplugins.go b/cmd/file_addplugins.go index 1adc79721..ccf95a0f7 100644 --- a/cmd/file_addplugins.go +++ b/cmd/file_addplugins.go @@ -29,6 +29,7 @@ var ( func executeAddPlugins(cmd *cobra.Command, cfgFiles []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-add-plugins", "", modeLocal) cmdAddPluginOutputFormat = strings.ToUpper(cmdAddPluginOutputFormat) diff --git a/cmd/file_addtags.go b/cmd/file_addtags.go index c15779b92..4b7f7133a 100644 --- a/cmd/file_addtags.go +++ b/cmd/file_addtags.go @@ -26,6 +26,7 @@ var ( func executeAddTags(cmd *cobra.Command, tagsToAdd []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-add-tags", "", modeLocal) cmdAddTagsOutputFormat = strings.ToUpper(cmdAddTagsOutputFormat) diff --git a/cmd/file_convert.go b/cmd/file_convert.go index 60ec957db..3670239b3 100644 --- a/cmd/file_convert.go +++ b/cmd/file_convert.go @@ -22,6 +22,8 @@ var ( ) func executeConvert(_ *cobra.Command, _ []string) error { + _ = sendAnalytics("file-convert", "", modeLocal) + sourceFormat, err := convert.ParseFormat(convertCmdSourceFormat) if err != nil { return err diff --git a/cmd/file_listtags.go b/cmd/file_listtags.go index 1fd611088..cb910ff50 100644 --- a/cmd/file_listtags.go +++ b/cmd/file_listtags.go @@ -27,6 +27,7 @@ var ( func executeListTags(cmd *cobra.Command, _ []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-list-tags", "", modeLocal) cmdListTagsOutputFormat = strings.ToUpper(cmdListTagsOutputFormat) diff --git a/cmd/file_merge.go b/cmd/file_merge.go index e7e9406d4..154c4c7bc 100644 --- a/cmd/file_merge.go +++ b/cmd/file_merge.go @@ -19,6 +19,7 @@ var ( func executeMerge(cmd *cobra.Command, args []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-merge", "", modeLocal) // do the work: read/merge merged, info, err := merge.Files(args) diff --git a/cmd/file_openapi2kong.go b/cmd/file_openapi2kong.go index ff405d99a..06125733f 100644 --- a/cmd/file_openapi2kong.go +++ b/cmd/file_openapi2kong.go @@ -24,6 +24,7 @@ var ( func executeOpenapi2Kong(cmd *cobra.Command, _ []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-openapi2kong", "", modeLocal) if len(cmdO2KentityTags) == 0 { cmdO2KentityTags = nil diff --git a/cmd/file_patch.go b/cmd/file_patch.go index 793e00de2..dc74a0576 100644 --- a/cmd/file_patch.go +++ b/cmd/file_patch.go @@ -25,6 +25,7 @@ var ( func executePatch(cmd *cobra.Command, args []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-patch", "", modeLocal) cmdPatchOutputFormat = strings.ToUpper(cmdPatchOutputFormat) diff --git a/cmd/file_removetags.go b/cmd/file_removetags.go index 49eb0ff42..f6e578d7f 100644 --- a/cmd/file_removetags.go +++ b/cmd/file_removetags.go @@ -28,6 +28,7 @@ var ( func executeRemoveTags(cmd *cobra.Command, tagsToRemove []string) error { verbosity, _ := cmd.Flags().GetInt("verbose") logbasics.Initialize(log.LstdFlags, verbosity) + _ = sendAnalytics("file-remove-tags", "", modeLocal) cmdRemoveTagsOutputFormat = strings.ToUpper(cmdRemoveTagsOutputFormat) diff --git a/cmd/file_render.go b/cmd/file_render.go index b6985340b..bf799f5ba 100644 --- a/cmd/file_render.go +++ b/cmd/file_render.go @@ -15,6 +15,7 @@ var ( ) func executeFileRenderCmd(_ *cobra.Command, _ []string) error { + _ = sendAnalytics("file-render", "", modeLocal) return convert.Convert( fileRenderCmdKongStateFile, fileRenderCmdKongFileOutput,