[MM-54522] Add trial info to log + support packet (#24596)

Automatic Merge
This commit is contained in:
Julien Tant
2023-10-26 12:22:22 -07:00
committed by GitHub
parent 756765b9b4
commit 375404c12e
3 changed files with 15 additions and 1 deletions

View File

@@ -421,6 +421,11 @@ func NewServer(options ...Option) (*Server, error) {
s.EmailService.InitEmailBatching()
})
isTrial := false
if licence := s.License(); licence != nil {
isTrial = licence.IsTrial
}
logCurrentVersion := fmt.Sprintf("Current version is %v (%v/%v/%v/%v)", model.CurrentVersion, model.BuildNumber, model.BuildDate, model.BuildHash, model.BuildHashEnterprise)
mlog.Info(
logCurrentVersion,
@@ -432,7 +437,11 @@ func NewServer(options ...Option) (*Server, error) {
mlog.String("service_environment", model.GetServiceEnvironment()),
)
if model.BuildEnterpriseReady == "true" {
mlog.Info("Enterprise Build", mlog.Bool("enterprise_build", true))
mlog.Info(
"Enterprise Build",
mlog.Bool("enterprise_build", true),
mlog.Bool("is_trial", isTrial),
)
} else {
mlog.Info("Team Edition Build", mlog.Bool("enterprise_build", false))
}

View File

@@ -9,6 +9,7 @@ import (
"os"
"runtime"
"runtime/pprof"
"strconv"
"strings"
"time"
@@ -111,9 +112,11 @@ func (a *App) generateSupportPacketYaml(c *request.Context) (*model.FileData, er
licenseTo := ""
supportedUsers := 0
var isTrial bool
if license := a.Srv().License(); license != nil {
supportedUsers = *license.Features.Users
licenseTo = license.Customer.Company
isTrial = license.IsTrial
}
/* Jobs */
@@ -183,6 +186,7 @@ func (a *App) generateSupportPacketYaml(c *request.Context) (*model.FileData, er
/* License */
LicenseTo: licenseTo,
LicenseSupportedUsers: supportedUsers,
LicenseIsTrial: strconv.FormatBool(isTrial),
/* Server stats */
ActiveUsers: int(uniqueUserCount),

View File

@@ -117,6 +117,7 @@ type SupportPacket struct {
LicenseTo string `yaml:"license_to"`
LicenseSupportedUsers int `yaml:"license_supported_users,omitempty"`
LicenseIsTrial string `yaml:"license_is_trial,omitempty"`
/* Server stats */