diff --git a/router/batchrouter/asyncdestinationmanager/snowpipestreaming/apiadapter.go b/router/batchrouter/asyncdestinationmanager/snowpipestreaming/apiadapter.go index 04f612d3d5..e5e063b8a3 100644 --- a/router/batchrouter/asyncdestinationmanager/snowpipestreaming/apiadapter.go +++ b/router/batchrouter/asyncdestinationmanager/snowpipestreaming/apiadapter.go @@ -43,13 +43,14 @@ func (a *apiAdapter) defaultTags(apiName string) stats.Tags { } func (a *apiAdapter) CreateChannel(ctx context.Context, req *model.CreateChannelRequest) (*model.ChannelResponse, error) { - a.logger.Infon("Creating channel", + log := a.logger.Withn( logger.NewStringField("rudderIdentifier", req.RudderIdentifier), logger.NewStringField("partition", req.Partition), logger.NewStringField("database", req.TableConfig.Database), logger.NewStringField("namespace", req.TableConfig.Schema), logger.NewStringField("table", req.TableConfig.Table), ) + log.Infon("Creating channel") tags := a.defaultTags(createChannelAPI) defer a.recordDuration(tags)() @@ -59,6 +60,16 @@ func (a *apiAdapter) CreateChannel(ctx context.Context, req *model.CreateChannel tags["success"] = "false" return nil, err } + a.logger.Infon("Create channel response", + logger.NewBoolField("success", resp.Success), + logger.NewStringField("channelID", resp.ChannelID), + logger.NewStringField("channelName", resp.ChannelName), + logger.NewBoolField("valid", resp.Valid), + logger.NewBoolField("deleted", resp.Deleted), + logger.NewStringField("error", resp.Error), + logger.NewStringField("code", resp.Code), + logger.NewStringField("message", resp.SnowflakeAPIMessage), + ) tags["success"] = strconv.FormatBool(resp.Success) tags["code"] = resp.Code return resp, nil diff --git a/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go b/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go index 9ff65581bb..5e01150e44 100644 --- a/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go +++ b/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go @@ -65,10 +65,8 @@ func (m *Manager) addColumns(ctx context.Context, namespace, tableName string, c defer func() { snowflakeManager.Cleanup(ctx) }() - for _, column := range columns { - if err = snowflakeManager.AddColumns(ctx, tableName, []whutils.ColumnInfo{column}); err != nil { - return fmt.Errorf("adding column: %w", err) - } + if err = snowflakeManager.AddColumns(ctx, tableName, columns); err != nil { + return fmt.Errorf("adding column: %w", err) } return nil }