Skip to content

Commit

Permalink
Merge branch 'main' into alanwest/otlp-metricreadertype-option
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Nov 24, 2021
2 parents a7f260e + cabb847 commit 2d427c4
Show file tree
Hide file tree
Showing 25 changed files with 364 additions and 134 deletions.
2 changes: 1 addition & 1 deletion examples/Console/TestConsoleExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static object RunWithActivitySource()
{
// Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient"
// and use Console exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("Samples.SampleClient", "Samples.SampleServer")
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("console-test"))
.AddProcessor(new MyProcessor()) // This must be added before ConsoleExporter
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestGrpcNetClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal static object Run()
//
// dotnet run grpc

using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddGrpcClientInstrumentation()
.AddSource("grpc-net-client-test")
.AddConsoleExporter()
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal static object Run()
{
System.Console.WriteLine("Hello World!");

using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddHttpClientInstrumentation()
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("http-service-example"))
.AddSource("http-client-test")
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestInMemoryExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private static void RunWithActivitySource(ICollection<Activity> exportedItems)
{
// Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient"
// and use InMemory exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("Samples.SampleClient", "Samples.SampleServer")
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("inmemory-test"))
.AddInMemoryExporter(exportedItems)
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestJaegerExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal static object RunWithActivity(string host, int port)
{
// Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient"
// and use the Jaeger exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("jaeger-test"))
.AddSource("Samples.SampleClient", "Samples.SampleServer")
.AddJaegerExporter(o =>
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestOpenTracingShim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal static object Run(OpenTracingShimOptions options)
{
// Enable OpenTelemetry for the source "MyCompany.MyProduct.MyWebServer"
// and use Console exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("MyCompany.MyProduct.MyWebServer")
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyServiceName"))
.AddConsoleExporter()
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestOtlpExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static object RunWithActivitySource(string endpoint, string protocol)

// Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient"
// and use OTLP exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("Samples.SampleClient", "Samples.SampleServer")
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("otlp-test"))
.AddOtlpExporter(opt =>
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestRedis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal static object Run(string zipkinUri)
var connection = ConnectionMultiplexer.Connect("localhost");

// Configure exporter to export traces to Zipkin
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddZipkinExporter(o =>
{
o.Endpoint = new Uri(zipkinUri);
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestZPagesExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal static object Run()
// Start the server
httpServer.Start();

using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("zpages-test")
.AddZPagesExporter(o =>
{
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestZipkinExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal static object Run(string zipkinUri)

// Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient"
// and use the Zipkin exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("Samples.SampleClient", "Samples.SampleServer")
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("zipkin-test"))
.AddZipkinExporter(o =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ internal static OtlpMetrics.Metric ToOtlpMetric(this Metric metric)
};

AddAttributes(metricPoint.Tags, dataPoint.Attributes);
dataPoint.Count = (ulong)metricPoint.LongValue;
dataPoint.Sum = metricPoint.DoubleValue;
dataPoint.Count = (ulong)metricPoint.GetHistogramCount();
dataPoint.Sum = metricPoint.GetHistogramSum();

foreach (var histogramMeasurement in metricPoint.GetHistogramBuckets())
{
Expand Down
Loading

0 comments on commit 2d427c4

Please sign in to comment.