Open ssfyn opened 1 year ago
因为版本不匹配,initMetric阶段会出现detecting resources: [cannot merge resource due to conflicting Schema URL cannot merge resource due错误。 可通过以下代码复现
detecting resources: [cannot merge resource due to conflicting Schema URL cannot merge resource due
package main import ( "github.com/aliyun-sls/opentelemetry-go-provider-sls/provider" ) type ErrorHandler struct { } func (E ErrorHandler) Handle(err error) { panic(err) } func main() { slsConfig, err := provider.NewConfig(provider.WithServiceName("service"), provider.WithServiceNamespace("namespace"), provider.WithServiceVersion("0.1.0"), provider.WithTraceExporterEndpoint("stdout"), provider.WithMetricExporterEndpoint("stdout"), provider.WithErrorHandler(&ErrorHandler{}), ) // 使用panic(),表示如果初始化失败则程序直接异常退出,您也可以使用其他错误处理方式。 if err != nil { panic(err) } if err := provider.Start(slsConfig); err != nil { panic(err) } }
因为版本不匹配,initMetric阶段会出现
detecting resources: [cannot merge resource due to conflicting Schema URL cannot merge resource due
错误。可通过以下代码复现