mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 14:52:46 +08:00
Plugins: Propagate distributed tracing headers to backend plugins (#54107)
This commit is contained in:

committed by
GitHub

parent
1cfb3c1627
commit
cd5f27a25d
@ -8,7 +8,10 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin/pluginextensionv2"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin/secretsmanagerplugin"
|
||||
grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
||||
goplugin "github.com/hashicorp/go-plugin"
|
||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Handshake is the HandshakeConfig used to configure clients and servers.
|
||||
@ -36,6 +39,16 @@ func newClientConfig(executablePath string, env []string, logger log.Logger,
|
||||
VersionedPlugins: versionedPlugins,
|
||||
Logger: logWrapper{Logger: logger},
|
||||
AllowedProtocols: []goplugin.Protocol{goplugin.ProtocolGRPC},
|
||||
GRPCDialOptions: []grpc.DialOption{
|
||||
grpc.WithChainUnaryInterceptor(
|
||||
otelgrpc.UnaryClientInterceptor(),
|
||||
grpc_opentracing.UnaryClientInterceptor(),
|
||||
),
|
||||
grpc.WithChainStreamInterceptor(
|
||||
otelgrpc.StreamClientInterceptor(),
|
||||
grpc_opentracing.StreamClientInterceptor(),
|
||||
),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user