diff --git a/pkg/output/xatu/exporter.go b/pkg/output/xatu/exporter.go index 9fa5f166..911a44b3 100644 --- a/pkg/output/xatu/exporter.go +++ b/pkg/output/xatu/exporter.go @@ -7,6 +7,7 @@ import ( "github.com/ethpandaops/xatu/pkg/observability" pb "github.com/ethpandaops/xatu/pkg/proto/xatu" + grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/sirupsen/logrus" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" @@ -27,7 +28,10 @@ type ItemExporter struct { } func NewItemExporter(name string, config *Config, log logrus.FieldLogger) (ItemExporter, error) { - var opts []grpc.DialOption + opts := []grpc.DialOption{ + grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor), + grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor), + } if config.TLS { host, _, err := net.SplitHostPort(config.Address) diff --git a/pkg/server/server.go b/pkg/server/server.go index 27410717..9a259fe9 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -224,6 +224,8 @@ func (x *Xatu) startGrpcServer(ctx context.Context) error { mb100 := 1024 * 1024 * 100 + grpc_prometheus.EnableHandlingTimeHistogram() + opts := []grpc.ServerOption{ grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor), grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),