From 6c2c19a2d84bf60dafc51dde4c9ae8b250cd103c Mon Sep 17 00:00:00 2001 From: Alan West <3676547+alanwest@users.noreply.github.com> Date: Thu, 12 Nov 2020 16:35:32 -0800 Subject: [PATCH] Better instructions for running gRPC examples (#1526) Co-authored-by: Cijo Thomas --- examples/Console/TestGrpcNetClient.cs | 16 ++++++++++++++++ examples/GrpcService/Program.cs | 1 + 2 files changed, 17 insertions(+) diff --git a/examples/Console/TestGrpcNetClient.cs b/examples/Console/TestGrpcNetClient.cs index a4fc9167df0..ade965950c8 100644 --- a/examples/Console/TestGrpcNetClient.cs +++ b/examples/Console/TestGrpcNetClient.cs @@ -27,6 +27,20 @@ internal class TestGrpcNetClient { internal static object Run() { + // Prerequisite for running this example. + // In a separate console window, start the example + // ASP.NET Core gRPC service by running the following command + // from the reporoot\examples\GrpcService\. + // (eg: C:\repos\opentelemetry-dotnet\examples\GrpcService\) + // + // dotnet run + + // To run this example, run the following command from + // the reporoot\examples\Console\. + // (eg: C:\repos\opentelemetry-dotnet\examples\Console\) + // + // dotnet run grpc + using var openTelemetry = Sdk.CreateTracerProviderBuilder() .AddGrpcClientInstrumentation() .AddSource("grpc-net-client-test") @@ -51,6 +65,8 @@ internal static object Run() } } + System.Console.WriteLine("Press Enter key to exit."); + return null; } } diff --git a/examples/GrpcService/Program.cs b/examples/GrpcService/Program.cs index 2016a454555..5207d243c33 100644 --- a/examples/GrpcService/Program.cs +++ b/examples/GrpcService/Program.cs @@ -33,6 +33,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) => .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); + webBuilder.UseUrls("https://localhost:44335"); }); } }