Skip to content

Commit

Permalink
Logging: resolving log group names into group ids via static config (#…
Browse files Browse the repository at this point in the history
…218)

* Not operational

* Not operational

* Fix SQL Formatting

* Reuse resolver

* Reconfigure Logging

* Validate configs

* Refactor request validation

* Use IAM_TOKEN

* Reused metadata

* Read some data from Logging

* Fix linter complainings

* Fix review
  • Loading branch information
vitalyisaev2 authored Dec 9, 2024
1 parent ba94605 commit 0a7d43c
Show file tree
Hide file tree
Showing 38 changed files with 1,682 additions and 500 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
projectPath = $(shell pwd)
serverConfig ?= ./app/server/config/config.debug.yaml

build:
go build -o fq-connector-go ./app

run: build
./fq-connector-go server -c ./app/server/config/config.debug.yaml
./fq-connector-go server --config="$(serverConfig)"

lint:
golangci-lint run --fix ./app/... ./common/... ./tests/... ./tools/...
Expand Down
264 changes: 175 additions & 89 deletions api/common/data_source.pb.go

Large diffs are not rendered by default.

440 changes: 269 additions & 171 deletions api/service/protos/connector.pb.go

Large diffs are not rendered by default.

13 changes: 1 addition & 12 deletions app/bench/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/spf13/cobra"
"go.uber.org/zap"

api_common "github.com/ydb-platform/fq-connector-go/api/common"
"github.com/ydb-platform/fq-connector-go/app/config"
"github.com/ydb-platform/fq-connector-go/common"
)
Expand All @@ -37,17 +36,7 @@ func validateConfig(logger *zap.Logger, cfg *config.TBenchmarkConfig) error {
}
}

// securely override credentials
if token := os.Getenv("IAM_TOKEN"); token != "" {
cfg.DataSourceInstance.Credentials = &api_common.TCredentials{
Payload: &api_common.TCredentials_Token{
Token: &api_common.TCredentials_TToken{
Type: "IAM",
Value: token,
},
},
}
}
common.MaybeInjectTokenToDataSourceInstance(cfg.DataSourceInstance)

return nil
}
Expand Down
6 changes: 5 additions & 1 deletion app/client/connector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func runClient(cmd *cobra.Command, _ []string) error {
sessionID: sessionID,
}

// override credentials if IAM-token provided
common.MaybeInjectTokenToDataSourceInstance(cfg.DataSourceInstance)

if err := callServer(logger, &cfg, tableName, api_service_protos.EDateTimeFormat(dateTimeFormat), md); err != nil {
return fmt.Errorf("call server: %w", err)
}
Expand All @@ -93,7 +96,8 @@ func callServer(
switch cfg.DataSourceInstance.Kind {
case api_common.EDataSourceKind_CLICKHOUSE, api_common.EDataSourceKind_POSTGRESQL,
api_common.EDataSourceKind_YDB, api_common.EDataSourceKind_MS_SQL_SERVER,
api_common.EDataSourceKind_MYSQL, api_common.EDataSourceKind_GREENPLUM, api_common.EDataSourceKind_ORACLE:
api_common.EDataSourceKind_MYSQL, api_common.EDataSourceKind_GREENPLUM,
api_common.EDataSourceKind_ORACLE, api_common.EDataSourceKind_LOGGING:
typeMappingSettings := &api_service_protos.TTypeMappingSettings{
DateTimeFormat: dateTimeFormat,
}
Expand Down
Loading

0 comments on commit 0a7d43c

Please sign in to comment.