Skip to content

Commit

Permalink
feat: add support for debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
enocom committed Mar 13, 2024
1 parent ab64481 commit a88094e
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 77 deletions.
10 changes: 10 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ Localhost Admin Server
/quitquitquit. The admin server exits gracefully when it receives a POST
request at /quitquitquit.
Debug logging
On occasion, it can help to enable debug logging which will report on
internal certificate refresh operations. To enable debug logging, use:
./cloud-sql-proxy <INSTANCE_CONNECTION_NAME> --debug-logs
Waiting for Startup
See the wait subcommand's help for details.
Expand Down Expand Up @@ -509,6 +517,8 @@ Instead prefer Application Default Credentials
the Proxy will then pick-up automatically.`)
localFlags.BoolVarP(&c.conf.StructuredLogs, "structured-logs", "l", false,
"Enable structured logs using the LogEntry format")
localFlags.BoolVar(&c.conf.DebugLogs, "debug-logs", false,
"Enable debug logging")
localFlags.Uint64Var(&c.conf.MaxConnections, "max-connections", 0,
`Limits the number of connections by refusing any additional connections.
When this flag is not set, there is no limit.`)
Expand Down
8 changes: 8 additions & 0 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,14 @@ func TestNewCommandArguments(t *testing.T) {
RunConnectionTest: true,
}),
},
{
desc: "using the debug logs flag",
args: []string{"--debug-logs",
"projects/proj/locations/region/clusters/clust/instances/inst"},
want: withDefaults(&proxy.Config{
DebugLogs: true,
}),
},
}

for _, tc := range tcs {
Expand Down
42 changes: 21 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ module github.com/GoogleCloudPlatform/alloydb-auth-proxy
go 1.22

require (
cloud.google.com/go/alloydbconn v1.7.0
cloud.google.com/go/alloydbconn v1.8.0
contrib.go.opencensus.io/exporter/prometheus v0.4.2
contrib.go.opencensus.io/exporter/stackdriver v0.13.14
github.com/coreos/go-systemd/v22 v22.5.0
github.com/google/go-cmp v0.6.0
github.com/hanwen/go-fuse/v2 v2.5.0
github.com/jackc/pgx/v5 v5.5.3
github.com/jackc/pgx/v5 v5.5.5
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
go.opencensus.io v0.24.0
go.uber.org/zap v1.27.0
golang.org/x/oauth2 v0.17.0
golang.org/x/sys v0.17.0
google.golang.org/api v0.166.0
golang.org/x/oauth2 v0.18.0
golang.org/x/sys v0.18.0
google.golang.org/api v0.169.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)

require (
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/alloydb v1.8.1 // indirect
cloud.google.com/go/compute v1.23.4 // indirect
cloud.google.com/go/alloydb v1.10.0 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/longrunning v0.5.5 // indirect
cloud.google.com/go/monitoring v1.17.1 // indirect
cloud.google.com/go/monitoring v1.18.0 // indirect
cloud.google.com/go/trace v1.10.5 // indirect
github.com/aws/aws-sdk-go v1.43.31 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -44,7 +44,7 @@ require (
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.1 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
Expand All @@ -67,24 +67,24 @@ require (
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/otel v1.23.0 // indirect
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.opentelemetry.io/otel/trace v1.23.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/grpc v1.61.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240304161311-37d4d3c04a78 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit a88094e

Please sign in to comment.