Skip to content

Commit

Permalink
add reflection for grpcurl (open-telemetry#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredTan95 authored and styblope committed Mar 12, 2023
1 parent 11dd4b0 commit 1b93468
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/productcatalogservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"net"
"os"
"strings"
"sync"
"time"

pb "github.com/opentelemetry/opentelemetry-demo/src/productcatalogservice/genproto/hipstershop"
"github.com/sirupsen/logrus"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/contrib/instrumentation/runtime"
"go.opentelemetry.io/otel/metric/global"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
healthpb "google.golang.org/grpc/health/grpc_health_v1"
"io/ioutil"
"net"
"os"
"strings"
"sync"
"time"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
Expand All @@ -48,6 +47,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/reflection"
"google.golang.org/grpc/status"
)

Expand Down Expand Up @@ -151,6 +151,8 @@ func main() {
grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor()),
)

reflection.Register(srv)

pb.RegisterProductCatalogServiceServer(srv, svc)
healthpb.RegisterHealthServer(srv, svc)
srv.Serve(ln)
Expand Down

0 comments on commit 1b93468

Please sign in to comment.