Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrytfleung committed Jul 22, 2024
1 parent d4acac2 commit f932fd6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

const (
JSONOutputFile = "/tmp/solarwinds-apm-settings.json"
GrpcContextDeadline = time.Duration(2) * time.Second
GrpcContextDeadline = time.Duration(1) * time.Second
)

type solarwindsapmSettingsExtension struct {
Expand Down Expand Up @@ -171,19 +171,20 @@ func refresh(extension *solarwindsapmSettingsExtension) {
}

func (extension *solarwindsapmSettingsExtension) Start(ctx context.Context, _ component.Host) error {
extension.logger.Info("Just in the first line of start()")
extension.logger.Info("Starting up solarwinds apm settings extension")
ctx = context.Background()
ctx, extension.cancel = context.WithCancel(ctx)
systemCertPool, err := x509.SystemCertPool()
if err != nil {
return err
}
subjects := systemCertPool.Subjects()
extension.logger.Info("Loading system certificates", zap.Int("numberOfSubjects", len(subjects)))
extension.conn, err = grpc.NewClient(extension.config.Endpoint, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{RootCAs: systemCertPool})))
if err != nil {
return err
}
extension.logger.Info("grpc.Dial to " + extension.config.Endpoint)
extension.logger.Info("Created a grpc.NewClient", zap.String("endpoint", extension.config.Endpoint))
extension.client = collectorpb.NewTraceCollectorClient(extension.conn)

go func() {
Expand All @@ -200,7 +201,6 @@ func (extension *solarwindsapmSettingsExtension) Start(ctx context.Context, _ co
}
}()

extension.logger.Info("Return from start()")
return nil
}

Expand Down

0 comments on commit f932fd6

Please sign in to comment.