diff --git a/examples/Console/Program.cs b/examples/Console/Program.cs index b24b58d0b5d..4b57a0b4810 100644 --- a/examples/Console/Program.cs +++ b/examples/Console/Program.cs @@ -35,7 +35,7 @@ public class Program /// dotnet run -p Examples.Console.csproj zpages /// /// The above must be run from the project root folder - /// (eg: C:\repos\opentelemetry-dotnet\src\examples\Console\). + /// (eg: C:\repos\opentelemetry-dotnet\examples\Console\). /// /// Arguments from command line. public static void Main(string[] args) diff --git a/examples/Console/TestConsoleExporter.cs b/examples/Console/TestConsoleExporter.cs index 938096e9463..a36e5618662 100644 --- a/examples/Console/TestConsoleExporter.cs +++ b/examples/Console/TestConsoleExporter.cs @@ -24,6 +24,11 @@ namespace Examples.Console { internal class TestConsoleExporter { + // To run this example, run the following command from + // the reporoot\examples\Console\. + // (eg: C:\repos\opentelemetry-dotnet\examples\Console\) + // + // dotnet run console internal static object Run(ConsoleOptions options) { // Enable TracerProvider for the source "MyCompany.MyProduct.MyWebServer" diff --git a/examples/Console/TestGrpcNetClient.cs b/examples/Console/TestGrpcNetClient.cs index 24666e41169..a4fc9167df0 100644 --- a/examples/Console/TestGrpcNetClient.cs +++ b/examples/Console/TestGrpcNetClient.cs @@ -36,7 +36,7 @@ internal static object Run() var source = new ActivitySource("grpc-net-client-test"); using (var parent = source.StartActivity("Main", ActivityKind.Server)) { - using var channel = GrpcChannel.ForAddress("https://localhost:5001"); + using var channel = GrpcChannel.ForAddress("https://localhost:44335"); var client = new Greeter.GreeterClient(channel); try diff --git a/examples/Console/TestHttpClient.cs b/examples/Console/TestHttpClient.cs index 2484b295198..a570daadbef 100644 --- a/examples/Console/TestHttpClient.cs +++ b/examples/Console/TestHttpClient.cs @@ -23,6 +23,11 @@ namespace Examples.Console { internal class TestHttpClient { + // To run this example, run the following command from + // the reporoot\examples\Console\. + // (eg: C:\repos\opentelemetry-dotnet\examples\Console\) + // + // dotnet run httpclient internal static object Run() { System.Console.WriteLine("Hello World!"); @@ -41,7 +46,7 @@ internal static object Run() client.GetStringAsync("http://bing.com").GetAwaiter().GetResult(); } - System.Console.ReadLine(); + System.Console.WriteLine("Press Enter key to exit."); return null; } diff --git a/examples/Console/TestJaegerExporter.cs b/examples/Console/TestJaegerExporter.cs index fc23db24986..7352022db50 100644 --- a/examples/Console/TestJaegerExporter.cs +++ b/examples/Console/TestJaegerExporter.cs @@ -22,6 +22,11 @@ internal class TestJaegerExporter { internal static object Run(string host, int port) { + // To run this example, run the following command from + // the reporoot\examples\Console\. + // (eg: C:\repos\opentelemetry-dotnet\examples\Console\) + // + // dotnet run jaeger -h localhost -p 6831 return RunWithActivity(host, port); } diff --git a/examples/Console/TestOtlpExporter.cs b/examples/Console/TestOtlpExporter.cs index 04e79898108..558881a3ebf 100644 --- a/examples/Console/TestOtlpExporter.cs +++ b/examples/Console/TestOtlpExporter.cs @@ -22,13 +22,9 @@ namespace Examples.Console internal static class TestOtlpExporter { internal static object Run(string endpoint) - { - return RunWithActivitySource(endpoint); - } - - private static object RunWithActivitySource(string endpoint) { /* + * Prerequisite to run this example: * Setup an OpenTelemetry Collector to run on local docker. * * Open a terminal window at the examples/Console/ directory and @@ -51,7 +47,11 @@ private static object RunWithActivitySource(string endpoint) * For more information about the OpenTelemetry Collector go to https://github.com/open-telemetry/opentelemetry-collector * */ + return RunWithActivitySource(endpoint); + } + private static object RunWithActivitySource(string endpoint) + { // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use OTLP exporter. using var openTelemetry = Sdk.CreateTracerProviderBuilder() diff --git a/examples/Console/TestZipkinExporter.cs b/examples/Console/TestZipkinExporter.cs index 5f17ed2827b..d5e8f1617c0 100644 --- a/examples/Console/TestZipkinExporter.cs +++ b/examples/Console/TestZipkinExporter.cs @@ -24,12 +24,15 @@ internal class TestZipkinExporter { internal static object Run(string zipkinUri) { - /* - * Setup zipkin inside local docker. - * docker run -d -p 9411:9411 openzipkin/zipkin - * - * In zipkinUri, use http://localhost:9411/api/v2/spans - */ + // Prerequisite for running this example. + // Setup zipkin inside local docker using following command: + // docker run -d -p 9411:9411 openzipkin/zipkin + + // To run this example, run the following command from + // the reporoot\examples\Console\. + // (eg: C:\repos\opentelemetry-dotnet\examples\Console\) + // + // dotnet run zipkin -u http://localhost:9411/api/v2/spans // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use the Zipkin exporter.