Пример #1
0
        /// <summary>
        /// Main method - invoke this using command line.
        /// For example:
        ///
        /// Samples.dll zipkin 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 <ZipkinOptions, ApplicationInsightsOptions, PrometheusOptions, HttpClientOptions, StackdriverOptions>(args)
            .MapResult(
                (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),
                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, 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),
                (ZPagesOptions options) => TestZPages.Run(),
                (ConsoleOptions options) => TestConsole.Run(options),
                (OtlpOptions options) => TestOtlp.Run(options.Endpoint),
                errs => 1);

            Console.ReadLine();
        }
Пример #3
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, ConsoleOptions>(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),
                (ConsoleOptions options) => TestConsole.Run(options),
                errs => 1);

            Console.ReadLine();
        }