fix: add agent tag to Looker API calls. (#966)

This commit is contained in:
Dr. Strangelove
2025-07-24 11:19:25 -04:00
committed by GitHub
parent 1526b8ab8c
commit f55dd6fcd0

View File

@@ -67,6 +67,11 @@ func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.So
return nil, fmt.Errorf("unable to get logger from ctx: %s", err)
}
userAgent, err := util.UserAgentFromContext(ctx)
if err != nil {
return nil, err
}
duration, err := time.ParseDuration(r.Timeout)
if err != nil {
return nil, fmt.Errorf("unable to parse Timeout string as time.Duration: %s", err)
@@ -76,6 +81,7 @@ func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.So
logger.WarnContext(ctx, "Insecure HTTP is enabled for Looker source %s. TLS certificate verification is skipped.\n", r.Name)
}
cfg := rtl.ApiSettings{
AgentTag: userAgent,
BaseUrl: r.BaseURL,
ApiVersion: "4.0",
VerifySsl: (r.SslVerification == "true"),