mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-11 00:40:00 +08:00
feat: add secure option for sending traces via otlphttp (#3973)
This commit is contained in:
@@ -97,9 +97,12 @@ func createExporter(c Config) (sdktrace.SpanExporter, error) {
|
||||
case kindOtlpHttp:
|
||||
// Not support flexible configuration now.
|
||||
opts := []otlptracehttp.Option{
|
||||
otlptracehttp.WithInsecure(),
|
||||
otlptracehttp.WithEndpoint(c.Endpoint),
|
||||
}
|
||||
|
||||
if !c.OtlpHttpSecure {
|
||||
opts = append(opts, otlptracehttp.WithInsecure())
|
||||
}
|
||||
if len(c.OtlpHeaders) > 0 {
|
||||
opts = append(opts, otlptracehttp.WithHeaders(c.OtlpHeaders))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user