Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: log config init errors using exposed methods #4541

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ replace (
require (
cloud.google.com/go/bigquery v1.60.0
cloud.google.com/go/pubsub v1.36.1
cloud.google.com/go/storage v1.39.1
cloud.google.com/go/storage v1.40.0
github.com/Azure/azure-storage-blob-go v0.15.0
github.com/ClickHouse/clickhouse-go v1.5.4
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/alexeyco/simpletable v1.0.0
github.com/allisson/go-pglock/v2 v2.0.1
github.com/apache/pulsar-client-go v0.12.1
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/aws/aws-sdk-go v1.51.6
github.com/aws/aws-sdk-go v1.51.12
github.com/bugsnag/bugsnag-go/v2 v2.3.1
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/cenkalti/backoff/v4 v4.2.1
Expand Down Expand Up @@ -84,7 +84,7 @@ require (
github.com/rudderlabs/analytics-go v3.3.3+incompatible
github.com/rudderlabs/bing-ads-go-sdk v0.2.1
github.com/rudderlabs/compose-test v0.1.3
github.com/rudderlabs/rudder-go-kit v0.23.3
github.com/rudderlabs/rudder-go-kit v0.23.4-0.20240403132211-8416504f7319
github.com/rudderlabs/rudder-observability-kit v0.0.3
github.com/rudderlabs/sql-tunnels v0.1.6
github.com/samber/lo v1.39.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho=
cloud.google.com/go/storage v1.21.0/go.mod h1:XmRlxkgPjlBONznT2dDUU/5XlpU2OjMnKuqnZI01LAA=
cloud.google.com/go/storage v1.39.1 h1:MvraqHKhogCOTXTlct/9C3K3+Uy2jBmFYb3/Sp6dVtY=
cloud.google.com/go/storage v1.39.1/go.mod h1:xK6xZmxZmo+fyP7+DEF6FhNc24/JAe95OLyOHCXFH1o=
cloud.google.com/go/storage v1.40.0 h1:VEpDQV5CJxFmJ6ueWNsKxcr1QAYOXEgxDa+sBbJahPw=
cloud.google.com/go/storage v1.40.0/go.mod h1:Rrj7/hKlG87BLqDJYtwR0fbPld8uJPbQ2ucUMY7Ir0g=
cloud.google.com/go/trace v1.0.0/go.mod h1:4iErSByzxkyHWzzlAj63/Gmjz0NH1ASqhJguHpGcr6A=
cloud.google.com/go/trace v1.2.0/go.mod h1:Wc8y/uYyOhPy12KEnXG9XGrvfMz5F5SrYecQlbW1rwM=
contrib.go.opencensus.io/exporter/aws v0.0.0-20200617204711-c478e41e60e9/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
Expand Down Expand Up @@ -211,8 +211,8 @@ github.com/aws/aws-sdk-go v1.30.19/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZve
github.com/aws/aws-sdk-go v1.32.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.51.6 h1:Ld36dn9r7P9IjU8WZSaswQ8Y/XUCRpewim5980DwYiU=
github.com/aws/aws-sdk-go v1.51.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go v1.51.12 h1:DvuhIHZXwnjaR1/Gu19gUe1EGPw4J0qSJw4Qs/5PA8g=
github.com/aws/aws-sdk-go v1.51.12/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go-v2 v1.16.2/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU=
github.com/aws/aws-sdk-go-v2 v1.23.0 h1:PiHAzmiQQr6JULBUdvR8fKlA+UPKLT/8KbiqpFBWiAo=
github.com/aws/aws-sdk-go-v2 v1.23.0/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA=
Expand Down Expand Up @@ -950,8 +950,8 @@ github.com/rudderlabs/compose-test v0.1.3 h1:uyep6jDCIF737sfv4zIaMsKRQKX95IDz5Xb
github.com/rudderlabs/compose-test v0.1.3/go.mod h1:tuvS1eQdSfwOYv1qwyVAcpdJxPLQXJgy5xGDd/9XmMg=
github.com/rudderlabs/parquet-go v0.0.2 h1:ZXRdZdimB0PdJtmxeSSxfI0fDQ3kZjwzBxRi6Ut1J8k=
github.com/rudderlabs/parquet-go v0.0.2/go.mod h1:g6guum7o8uhj/uNhunnt7bw5Vabu/goI5i21/3fnxWQ=
github.com/rudderlabs/rudder-go-kit v0.23.3 h1:p05gWVNpAtn6Ua8otU747xgtP+PRqk1zb6HzIp9tsG0=
github.com/rudderlabs/rudder-go-kit v0.23.3/go.mod h1:D064XcD8TnnJbzNBjb9KgwYEWXP1xcO5erMH8M873FE=
github.com/rudderlabs/rudder-go-kit v0.23.4-0.20240403132211-8416504f7319 h1:Ikdz92kSw4LIOmzg+jHBsCFFiEc7MQwdFodODH1kUUE=
github.com/rudderlabs/rudder-go-kit v0.23.4-0.20240403132211-8416504f7319/go.mod h1:y4ddwY7N+r3Dfy7AHKYRfCe6jD5xaLZ6Rzfd5x0Tl4M=
github.com/rudderlabs/rudder-observability-kit v0.0.3 h1:vZtuZRkGX+6rjaeKtxxFE2YYP6QlmAcVcgecTOjvz+Q=
github.com/rudderlabs/rudder-observability-kit v0.0.3/go.mod h1:6UjAh3H6rkE0fFLh7z8ZGQEQbKtUkRfhWOf/OUhfqW8=
github.com/rudderlabs/sql-tunnels v0.1.6 h1:v2KA2cq8ZV5LXRJQpqigq1Q4V64oDL+XlfckW/0K2/4=
Expand Down
13 changes: 13 additions & 0 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ func (r *Runner) Run(ctx context.Context, args []string) int {
return 1
}

path, err := config.Default.ConfigFileUsed()
if err != nil {
r.logger.Warnf("Config: Failed to parse config file from path %q, using default values: %v", path, err)
} else {
r.logger.Infof("Config: Using config file: %s", path)
}

if err := config.Default.DotEnvLoaded(); err != nil {
r.logger.Infof("Config: No .env file loaded: %v", err)
} else {
r.logger.Infof("Config: Loaded .env file")
}
Comment on lines +103 to +114
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path, err := config.Default.ConfigFileUsed()
if err != nil {
r.logger.Warnf("Config: Failed to parse config file from path %q, using default values: %v", path, err)
} else {
r.logger.Infof("Config: Using config file: %s", path)
}
if err := config.Default.DotEnvLoaded(); err != nil {
r.logger.Infof("Config: No .env file loaded: %v", err)
} else {
r.logger.Infof("Config: Loaded .env file")
}
path, err := config.Default.ConfigFileUsed()
if err != nil {
r.logger.Warnn("Config: Failed to parse config file, using default values",
logger.NewStringField("path", path),
obskit.Error(err),
)
} else {
r.logger.Infon("Config: Using config file", logger.NewStringField("path", path))
}
if err := config.Default.DotEnvLoaded(); err != nil {
r.logger.Infon("Config: No .env file loaded", obskit.Error(err))
} else {
r.logger.Infon("Config: Loaded .env file")
}


// TODO: remove as soon as we update the configuration with statsExcludedTags where necessary
if !config.IsSet("statsExcludedTags") && deploymentType == deployment.MultiTenantType &&
(!config.IsSet("WORKSPACE_NAMESPACE") || strings.Contains(config.GetString("WORKSPACE_NAMESPACE", ""), "free")) {
Expand Down
Loading