feat 链路追踪

This commit is contained in:
2026-01-16 22:01:35 +08:00
parent 7cb057fc91
commit e59d106700
11 changed files with 394 additions and 108 deletions

View File

@@ -2,6 +2,7 @@ package resolver
import (
"git.hlsq.asia/mmorpg/service-common/log"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive"
@@ -12,6 +13,7 @@ func NewGrpcConnection(target string) (*grpc.ClientConn, error) {
cc, err := grpc.NewClient(
target,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(`{"loadBalancingConfig": [{"round_robin": {}}]}`),
grpc.WithKeepaliveParams(
keepalive.ClientParameters{