mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-16 02:35:12 +00:00
feat: enable cross-app distributed tracing for v2 APIs (#11453)
This commit is contained in:
+7
-2
@@ -110,6 +110,7 @@ func New(
|
||||
accessInterceptor *http_mw.AccessInterceptor,
|
||||
targetEncryptionAlgorithm crypto.EncryptionAlgorithm,
|
||||
translator *i18n.Translator,
|
||||
trustRemoteSpans bool,
|
||||
) (_ *API, err error) {
|
||||
api := &API{
|
||||
port: port,
|
||||
@@ -132,12 +133,16 @@ func New(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
api.connectOTELInterceptor, err = otelconnect.NewInterceptor(
|
||||
otelOpts := []otelconnect.Option{
|
||||
otelconnect.WithTracerProvider(otel.GetTracerProvider()),
|
||||
otelconnect.WithMeterProvider(otel.GetMeterProvider()),
|
||||
otelconnect.WithPropagator(otel.GetTextMapPropagator()),
|
||||
otelconnect.WithoutServerPeerAttributes(),
|
||||
)
|
||||
}
|
||||
if trustRemoteSpans {
|
||||
otelOpts = append(otelOpts, otelconnect.WithTrustRemote())
|
||||
}
|
||||
api.connectOTELInterceptor, err = otelconnect.NewInterceptor(otelOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user