Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics to Main #2174

Merged
merged 46 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7d5faf9
Revert "Remove metrics from 1.0.0 release (#1743)"
cijothomas Jan 29, 2021
92d1950
conflict in changelog resolved
cijothomas Jan 29, 2021
9b61fe2
Merge branch 'main' into metrics
cijothomas Jan 29, 2021
b438d5c
Merge branch 'main' into metrics
cijothomas Jan 29, 2021
b894c4f
Merge branch 'main' into metrics
cijothomas Jan 29, 2021
b406a42
Merge branch 'main' into metrics
cijothomas Jan 29, 2021
b5851a3
merge conflict
cijothomas Feb 11, 2021
b28db93
conflict resolved for public apis
cijothomas Feb 11, 2021
646bb10
Merge branch 'main' into metrics
cijothomas Feb 11, 2021
ab278ce
Remove public api analyzer for metrics (#1830)
cijothomas Feb 12, 2021
2660c74
Remove obsolete from Metrics - one file to test #1750 (#1751)
cijothomas Mar 16, 2021
ab83a45
Remove public API entries for metric (#1920)
cijothomas Mar 17, 2021
56afcea
conflict resolved in sdk and changelog
cijothomas Mar 17, 2021
6d6a045
Merge branch 'main' into metrics
cijothomas Mar 19, 2021
b1df9db
Merge branch 'main' into metrics
cijothomas Apr 29, 2021
9d415bf
Remove existing Metrics code (#2030)
cijothomas May 4, 2021
c5a8535
Add a temp project with Metric API (which will come eventually from r…
cijothomas May 4, 2021
c8d8b8c
Initial Metric API/SDK framing (#2034)
victlu May 5, 2021
4faf1d4
Metric config modified to look similar to Tracing (#2037)
cijothomas May 5, 2021
4190b6b
Initial structure for running Processors (#2038)
victlu May 10, 2021
b5f8873
Initial framework for Aggregators (#2053)
victlu May 27, 2021
23987a4
Swap to using .NET Preview for Metrics API (#2067)
victlu May 28, 2021
88b732e
Refactor for new [Gauge|Sum|Summary|Histogram]Metric types and aggreg…
victlu Jun 15, 2021
d18fa52
Merge branch 'main' into metrics
cijothomas Jun 16, 2021
9071827
conflict resolved for nuget conifg
cijothomas Jun 16, 2021
8492de6
Metric console exporter modified to deal with all known types (#2087)
cijothomas Jun 16, 2021
ed3322c
Merge branch 'main' into metrics
cijothomas Jun 17, 2021
95a1367
Refactor for DataValue (#2093)
victlu Jul 6, 2021
8a89dbd
Use ActivityTraceId/ActivitySpanId for exemplars (#2125)
alanwest Jul 9, 2021
1f2075a
Merge branch 'main' into metrics
cijothomas Jul 13, 2021
be1d13f
Add a getting started doc for metric (#2132)
cijothomas Jul 14, 2021
8f525df
Modify MeterProvider to no longer maintain instrument state as it is …
cijothomas Jul 14, 2021
4814924
Measurement type conversion done at the MeterProvider. (#2136)
cijothomas Jul 14, 2021
9a5d9fd
Remove timestamp read per metric update (#2137)
cijothomas Jul 15, 2021
63c28f0
Refactor MeterProvider to be similar to TracerProvider (#2141)
cijothomas Jul 16, 2021
a572ad8
Make Delta vs Cumulative based purely on Exporter (#2142)
cijothomas Jul 16, 2021
8577221
Add a very basic prometheus exporter (#2143)
cijothomas Jul 16, 2021
a1f6f42
Add reference to Instrument on IMetric (#2124)
alanwest Jul 16, 2021
5d6d400
Add OTLP metrics exporter (#2092)
alanwest Jul 17, 2021
a4d8b35
Add Resource support for MetricProvider (#2150)
cijothomas Jul 19, 2021
d05b8d2
Simple ASP.NET Core instrumentation capturing request count metric (#…
alanwest Jul 20, 2021
3d95e7d
conflict resolve
cijothomas Jul 21, 2021
4f8eb89
Merge branch 'main' into metrics
cijothomas Jul 21, 2021
94c6e56
Update DS version (#2169)
cijothomas Jul 21, 2021
49f3c18
Small cleanup on MeterProvider (#2172)
cijothomas Jul 21, 2021
ea84510
Merge branch 'main' into metrics
cijothomas Jul 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<packageSources>
<clear />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<!--
<add key="dotnet6" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json" />
-->
<add key=".Net Core Tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources />
Expand Down
19 changes: 19 additions & 0 deletions OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "trace", "trace", "{5B7FB835
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "getting-started", "docs\trace\getting-started\getting-started.csproj", "{BE60E3D5-DE30-4BAB-8E7A-63B21D0E80D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "metrics", "metrics", "{3277B1C0-BDFE-4460-9B0D-D9A661FB48DB}"
ProjectSection(SolutionItems) = preProject
docs\metrics\building-your-own-exporter.md = docs\metrics\building-your-own-exporter.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "logs", "logs", "{3862190B-E2C5-418E-AFDC-DB281FB5C705}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MicroserviceExample", "MicroserviceExample", "{4D492D62-5150-45F9-817F-C99562E364E2}"
Expand Down Expand Up @@ -200,6 +205,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "exception-reporting", "docs
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "customizing-the-sdk", "docs\trace\customizing-the-sdk\customizing-the-sdk.csproj", "{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "getting-started", "docs\metrics\getting-started\getting-started.csproj", "{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.Exporter.Prometheus", "src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj", "{52158A12-E7EF-45A1-859F-06F9B17410CB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -394,6 +403,14 @@ Global
{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06}.Release|Any CPU.Build.0 = Release|Any CPU
{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8}.Release|Any CPU.Build.0 = Release|Any CPU
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -411,6 +428,7 @@ Global
{2C7DD1DA-C229-4D9E-9AF0-BCD5CD3E4948} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
{5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818} = {7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}
{BE60E3D5-DE30-4BAB-8E7A-63B21D0E80D7} = {5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818}
{3277B1C0-BDFE-4460-9B0D-D9A661FB48DB} = {7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}
{3862190B-E2C5-418E-AFDC-DB281FB5C705} = {7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}
{4D492D62-5150-45F9-817F-C99562E364E2} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
{07336602-860B-4975-95DD-405D19C00901} = {4D492D62-5150-45F9-817F-C99562E364E2}
Expand All @@ -424,6 +442,7 @@ Global
{972396A8-E35B-499C-9BA1-765E9B8822E1} = {77C7929A-2EED-4AA6-8705-B5C443C8AA0F}
{08D29501-F0A3-468F-B18D-BD1821A72383} = {5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818}
{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06} = {5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818}
{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8} = {3277B1C0-BDFE-4460-9B0D-D9A661FB48DB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {55639B5C-0770-4A22-AB56-859604650521}
Expand Down
4 changes: 3 additions & 1 deletion build/Common.nonprod.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<Content Include="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!--Temp workaround to allow using daily dotnet 6 builds-->
<!--<PackageReference Include="System.Runtime.CompilerServices.Unsafe" PrivateAssets="All" NoWarn="NU1605" Version="6.0.0-preview.4.21253.7" />-->
</ItemGroup>

<PropertyGroup Label="Package versions used by test and example projects">
<!--
Expand Down
3 changes: 0 additions & 3 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftCodeAnalysisAnalyzersPkgVer)" Condition=" $(OS) == 'Windows_NT'">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Comment on lines -9 to -11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will continue to leave this disabled on main for now?

</ItemGroup>

<ItemGroup Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<StackExchangeRedisPkgVer>[2.1.58,3.0)</StackExchangeRedisPkgVer>
<StyleCopAnalyzersPkgVer>[1.1.118,2.0)</StyleCopAnalyzersPkgVer>
<SystemCollectionsImmutablePkgVer>1.4.0</SystemCollectionsImmutablePkgVer>
<SystemDiagnosticSourcePkgVer>5.0.1</SystemDiagnosticSourcePkgVer>
<SystemDiagnosticSourcePkgVer>6.0.0-preview.6.21352.12</SystemDiagnosticSourcePkgVer>
<SystemReflectionEmitLightweightPkgVer>4.7.0</SystemReflectionEmitLightweightPkgVer>
<SystemTextJsonPkgVer>4.7.0</SystemTextJsonPkgVer>
<SystemThreadingTasksExtensionsPkgVer>4.5.3</SystemThreadingTasksExtensionsPkgVer>
Expand Down
54 changes: 54 additions & 0 deletions docs/metrics/getting-started/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// <copyright file="Program.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.Threading;
using System.Threading.Tasks;
using OpenTelemetry;
using OpenTelemetry.Metrics;

public class Program
{
private static readonly Meter MyMeter = new Meter("TestMeter", "0.0.1");
private static readonly Counter<long> Counter = MyMeter.CreateCounter<long>("counter");

public static async Task Main(string[] args)
{
using var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddSource("TestMeter")
.AddConsoleExporter()
.Build();

using var token = new CancellationTokenSource();
Task writeMetricTask = new Task(() =>
{
while (!token.IsCancellationRequested)
{
Counter.Add(
10,
new KeyValuePair<string, object>("tag1", "value1"),
new KeyValuePair<string, object>("tag2", "value2"));
Task.Delay(10).Wait();
}
});
writeMetricTask.Start();

token.CancelAfter(10000);
await writeMetricTask;
}
}
59 changes: 59 additions & 0 deletions docs/metrics/getting-started/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Getting Started with OpenTelemetry .NET in 5 Minutes

First, download and install the [.NET Core
SDK](https://dotnet.microsoft.com/download) on your computer.

Create a new console application and run it:

```sh
dotnet new console --output getting-started
cd getting-started
dotnet run
```

You should see the following output:

```text
Hello World!
```

Install the
[OpenTelemetry.Exporter.Console](../../../src/OpenTelemetry.Exporter.Console/README.md)
package:

```sh
dotnet add package OpenTelemetry.Exporter.Console
```

Update the `Program.cs` file with the code from [Program.cs](./Program.cs):

Run the application again (using `dotnet run`) and you should see the metric
output from the console, similar to shown below:

<!-- markdownlint-disable MD013 -->
```text
Export[] 16:38:36.241 16:38:37.233 TestMeter:counter [tag1=value1;tag2=value2] SumMetricAggregator Value: 590, Details: Delta=True,Mon=True,Count=59,Sum=590
Export[] 16:38:37.233 16:38:38.258 TestMeter:counter [tag1=value1;tag2=value2] SumMetricAggregator Value: 640, Details: Delta=True,Mon=True,Count=64,Sum=640
Export[] 16:38:38.258 16:38:39.261 TestMeter:counter [tag1=value1;tag2=value2] SumMetricAggregator Value: 640, Details: Delta=True,Mon=True,Count=64,Sum=640
Export[] 16:38:39.261 16:38:40.266 TestMeter:counter [tag1=value1;tag2=value2] SumMetricAggregator Value: 630, Details: Delta=True,Mon=True,Count=63,Sum=630
Export[] 16:38:40.266 16:38:41.271 TestMeter:counter [tag1=value1;tag2=value2] SumMetricAggregator Value: 640, Details: Delta=True,Mon=True,Count=64,Sum=640
```
<!-- markdownlint-enable MD013 -->

Congratulations! You are now collecting metrics using OpenTelemetry.

What does the above program do?

The program creates a
[Meter](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#meter)
instance named "TestMeter" and then creates a
[Counter](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#counter)
instrument from it. This counter is used to repeatedly report metric
measurements until exited after 10 seconds.

An OpenTelemetry
[MeterProvider](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#meterprovider)
is configured to subscribe to instruments from the Meter `TestMeter`, and
aggregate the measurements in-memory. The pre-aggregated metrics are exported
every 1 second to a `ConsoleExporter`. `ConsoleExporter` simply displays it on
the console.
6 changes: 6 additions & 0 deletions docs/metrics/getting-started/getting-started.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions examples/AspNetCore/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using OpenTelemetry;
using OpenTelemetry.Exporter;
using OpenTelemetry.Instrumentation.AspNetCore;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;

namespace Examples.AspNetCore
{
public class Startup
{
private MeterProvider meterProvider;

public Startup(IConfiguration configuration)
{
this.Configuration = configuration;
Expand Down Expand Up @@ -112,6 +116,16 @@ public void ConfigureServices(IServiceCollection services)

break;
}

// TODO: Add IServiceCollection.AddOpenTelemetryMetrics extension method
var providerBuilder = Sdk.CreateMeterProviderBuilder()
.AddAspNetCoreInstrumentation();

// TODO: Add configuration switch for Prometheus and OTLP export
providerBuilder
.AddConsoleExporter();

this.meterProvider = providerBuilder.Build();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Expand Down
1 change: 1 addition & 0 deletions examples/Console/Examples.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Zipkin\OpenTelemetry.Exporter.Zipkin.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Jaeger\OpenTelemetry.Exporter.Jaeger.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.InMemory\OpenTelemetry.Exporter.InMemory.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj" />
</ItemGroup>
</Project>
51 changes: 48 additions & 3 deletions examples/Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ public class Program
/// dotnet run -p Examples.Console.csproj prometheus -i 15 -p 9184 -d 2
/// dotnet run -p Examples.Console.csproj otlp -e "http://localhost:4317"
/// dotnet run -p Examples.Console.csproj zpages
/// dotnet run -p Examples.Console.csproj metrics --help
///
/// The above must be run from the project root folder
/// (eg: C:\repos\opentelemetry-dotnet\examples\Console\).
/// </summary>
/// <param name="args">Arguments from command line.</param>
public static void Main(string[] args)
{
Parser.Default.ParseArguments<JaegerOptions, ZipkinOptions, GrpcNetClientOptions, HttpClientOptions, RedisOptions, ZPagesOptions, ConsoleOptions, OpenTelemetryShimOptions, OpenTracingShimOptions, OtlpOptions, InMemoryOptions>(args)
Parser.Default.ParseArguments<JaegerOptions, ZipkinOptions, PrometheusOptions, MetricsOptions, GrpcNetClientOptions, HttpClientOptions, RedisOptions, ZPagesOptions, ConsoleOptions, OpenTelemetryShimOptions, OpenTracingShimOptions, OtlpOptions, InMemoryOptions>(args)
.MapResult(
(JaegerOptions options) => TestJaegerExporter.Run(options.Host, options.Port),
(ZipkinOptions options) => TestZipkinExporter.Run(options.Uri),
(PrometheusOptions options) => TestPrometheusExporter.Run(options.Port, options.DurationInMins),
(MetricsOptions options) => TestMetrics.Run(options),
(GrpcNetClientOptions options) => TestGrpcNetClient.Run(),
(HttpClientOptions options) => TestHttpClient.Run(),
(RedisOptions options) => TestRedis.Run(options.Uri),
Expand All @@ -55,8 +58,6 @@ public static void Main(string[] args)
(OtlpOptions options) => TestOtlpExporter.Run(options.Endpoint),
(InMemoryOptions options) => TestInMemoryExporter.Run(options),
errs => 1);

System.Console.ReadLine();
}
}

Expand All @@ -79,6 +80,50 @@ internal class ZipkinOptions
public string Uri { get; set; }
}

[Verb("prometheus", HelpText = "Specify the options required to test Prometheus")]
internal class PrometheusOptions
{
[Option('p', "port", Default = 9184, HelpText = "The port to expose metrics. The endpoint will be http://localhost:port/metrics (This is the port from which your Prometheus server scraps metrics from.)", Required = false)]
public int Port { get; set; }

[Option('d', "duration", Default = 2, HelpText = "Total duration in minutes to run the demo.", Required = false)]
public int DurationInMins { get; set; }
}

[Verb("metrics", HelpText = "Specify the options required to test Metrics")]
internal class MetricsOptions
{
[Option('d', "IsDelta", HelpText = "Export Delta metrics", Required = false, Default = true)]
public bool IsDelta { get; set; }

[Option('g', "Gauge", HelpText = "Include Observable Gauge.", Required = false)]
public bool? FlagGauge { get; set; }

[Option('u', "UpDownCounter", HelpText = "Include Observable Up/Down Counter.", Required = false)]
public bool? FlagUpDownCounter { get; set; }

[Option('c', "Counter", HelpText = "Include Counter.", Required = false)]
public bool? FlagCounter { get; set; }

[Option('h', "Histogram", HelpText = "Include Histogram.", Required = false)]
public bool? FlagHistogram { get; set; }

[Option("defaultCollection", Default = 500, HelpText = "Default collection period in milliseconds.", Required = false)]
public int DefaultCollectionPeriodMilliseconds { get; set; }

[Option("runtime", Default = 5000, HelpText = "Run time in milliseconds.", Required = false)]
public int RunTime { get; set; }

[Option("tasks", Default = 1, HelpText = "Run # of concurrent tasks.", Required = false)]
public int NumTasks { get; set; }

[Option("maxLoops", Default = 0, HelpText = "Maximum number of loops/iterations per task. (0 = No Limit)", Required = false)]
public int MaxLoops { get; set; }

[Option("useExporter", Default = "console", HelpText = "Options include otlp or console.", Required = false)]
public string UseExporter { get; set; }
}

[Verb("grpc", HelpText = "Specify the options required to test Grpc.Net.Client")]
internal class GrpcNetClientOptions
{
Expand Down
1 change: 1 addition & 0 deletions examples/Console/TestGrpcNetClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ internal static object Run()
}

System.Console.WriteLine("Press Enter key to exit.");
System.Console.ReadLine();

return null;
}
Expand Down
1 change: 1 addition & 0 deletions examples/Console/TestHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ internal static object Run()
}

System.Console.WriteLine("Press Enter key to exit.");
System.Console.ReadLine();

return null;
}
Expand Down
Loading