mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 15:10:01 +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))
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ type Config struct {
|
||||
// For example
|
||||
// /v1/traces
|
||||
OtlpHttpPath string `json:",optional"`
|
||||
// OtlpHttpSecure represents the scheme to use for OTLP HTTP transport.
|
||||
OtlpHttpSecure bool `json:",optional"`
|
||||
// Disabled indicates whether StartAgent starts the agent.
|
||||
Disabled bool `json:",optional"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user