예제 #1
0
        /// <summary>
        /// Main method - invoke this using command line.
        /// For example:
        ///
        /// Samples.dll zipkin -u http://localhost:9411/api/v2/spans
        /// Sample.dll appInsights
        /// Sample.dll prometheus.
        /// </summary>
        /// <param name="args">Arguments from command line.</param>
        public static void Main(string[] args)
        {
            Parser.Default.ParseArguments <JaegerOptions, ZipkinOptions, ApplicationInsightsOptions, PrometheusOptions, HttpClientOptions, StackdriverOptions, LightStepOptions>(args)
            .MapResult(
                (JaegerOptions options) => TestJaeger.Run(options.Host, options.Port),
                (ZipkinOptions options) => TestZipkin.Run(options.Uri),
                (ApplicationInsightsOptions options) => TestApplicationInsights.Run(),
                (PrometheusOptions options) => TestPrometheus.Run(),
                (HttpClientOptions options) => TestHttpClient.Run(),
                (RedisOptions options) => TestRedis.Run(options.Uri),
                (StackdriverOptions options) => TestStackdriver.Run(options.ProjectId),
                (LightStepOptions options) => TestLightstep.Run(options.AccessToken),
                errs => 1);

            Console.ReadLine();
        }
예제 #2
0
        /// <summary>
        /// Main method - invoke this using command line.
        /// For example:
        ///
        /// dotnet Exporters.dll zipkin -u http://localhost:9411/api/v2/spans
        /// dotnet Exporters.dll jaeger -h localhost -o 6831
        /// dotnet Exporters.dll prometheus -i 15 -p 9184 -d 2
        ///
        /// The above must be run from the project bin folder
        /// (eg: C:\repos\opentelemetry-dotnet\src\samples\Exporters\Console\bin\Debug\netcoreapp3.1).
        /// </summary>
        /// <param name="args">Arguments from command line.</param>
        public static void Main(string[] args)
        {
            Parser.Default.ParseArguments <JaegerOptions, ZipkinOptions, PrometheusOptions, HttpClientOptions, StackdriverOptions, LightStepOptions, ZPagesOptions, ConsoleOptions, OtlpOptions>(args)
            .MapResult(
                (JaegerOptions options) => TestJaeger.Run(options.Host, options.Port),
                (ZipkinOptions options) => TestZipkin.Run(options.Uri),
                (PrometheusOptions options) => TestPrometheus.RunAsync(options.Port, options.PushIntervalInSecs, options.DurationInMins),
                (HttpClientOptions options) => TestHttpClient.Run(),
                (RedisOptions options) => TestRedis.Run(options.Uri),
                (StackdriverOptions options) => TestStackdriver.Run(options.ProjectId),
                (LightStepOptions options) => TestLightstep.Run(options.AccessToken),
                (ZPagesOptions options) => TestZPages.Run(),
                (ConsoleOptions options) => TestConsole.Run(options),
                (OtlpOptions options) => TestOtlp.Run(options.Endpoint),
                errs => 1);

            Console.ReadLine();
        }