Skip to content

Commit

Permalink
telemetry: don't generate cluster_id for server instances without con…
Browse files Browse the repository at this point in the history
…figured meta storage

telemetry: added instance_info.meta_storage property that is filled with configured meta storage type
  • Loading branch information
absorbb committed Sep 12, 2022
1 parent b1749d9 commit 432b30d
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 90 deletions.
5 changes: 3 additions & 2 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import (
"github.com/jitsucom/jitsu/server/telemetry"
"github.com/jitsucom/jitsu/server/timestamp"
"github.com/jitsucom/jitsu/server/users"
"github.com/jitsucom/jitsu/server/uuid"
"github.com/jitsucom/jitsu/server/wal"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -170,6 +169,8 @@ func main() {
if err != nil {
logging.Fatalf("Error initializing meta storage: %v", err)
}
telemetry.EnrichMetaStorage(metaStorage)

ctx, cancel := context.WithCancel(context.Background())

// ** Coordination Service **
Expand Down Expand Up @@ -220,7 +221,7 @@ func main() {
notifications.SystemErrorf("Panic:\n%s\n%s", value, string(debug.Stack()))
}

clusterID := metaStorage.GetOrCreateClusterID(uuid.New())
clusterID := metaStorage.GetOrCreateClusterID()
systemInfo := runtime.GetInfo()
telemetry.EnrichSystemInfo(clusterID, systemInfo)

Expand Down
2 changes: 1 addition & 1 deletion server/meta/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (d *Dummy) GetTaskLogs(taskID string, from, to time.Time) ([]TaskLogRecord,
func (d *Dummy) PushTask(task *Task) error { return nil }
func (d *Dummy) PollTask() (*Task, error) { return nil, nil }

func (d *Dummy) GetOrCreateClusterID(generatedClusterID string) string { return generatedClusterID }
func (d *Dummy) GetOrCreateClusterID() string { return "" }

func (d *Dummy) Type() string {
return DummyType
Expand Down
Loading

0 comments on commit 432b30d

Please sign in to comment.