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

Dev/twegner/issue 18 #111

Merged
merged 37 commits into from
Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e345d65
Merge pull request #1 from open-telemetry/master
trwegner May 13, 2019
4214ea1
Merge remote-tracking branch 'upstream/master'
trwegner May 16, 2019
9c4525a
Merge remote-tracking branch 'upstream/master'
trwegner May 20, 2019
d9d9a1c
Merge remote-tracking branch 'upstream/master'
trwegner May 21, 2019
9358bae
Merge remote-tracking branch 'upstream/master'
trwegner May 21, 2019
2fd8136
Merge remote-tracking branch 'upstream/master'
trwegner May 31, 2019
b2abb6d
Merge remote-tracking branch 'upstream/master'
trwegner Jun 5, 2019
697bd0a
Merge branch 'master' of https://github.com/trwegner/opentelemetry-do…
trwegner Jun 6, 2019
0337ea5
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
trwegner Jun 8, 2019
055febf
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
trwegner Jun 10, 2019
6c56c0f
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
trwegner Jun 10, 2019
5711694
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
trwegner Jun 12, 2019
47d239c
Rmoving ITraceComponent and TraceComponent
trwegner Jun 12, 2019
15f3928
Removing ITagsComponent, TagsComponentBase and TagsComponent
trwegner Jun 12, 2019
66f9f05
REmoving ITagPropagationComponent, TagPropagationComponentBase and Ta…
trwegner Jun 12, 2019
feba07d
Removing IStatsComponent, StatsComponentBase and StatsComponent
trwegner Jun 13, 2019
66651d2
Addressing test failures since updates have allowed rules on duplicat…
trwegner Jun 14, 2019
d41ce8b
Test updates, wrok in progress
trwegner Jun 18, 2019
482c637
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jun 18, 2019
590747f
Merge branch 'master' into dev/twegner/issue_18
trwegner Jun 18, 2019
d52e985
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jun 24, 2019
bbcd428
Merging upstream master
trwegner Jun 24, 2019
398139f
Resolving some unit test failrues
trwegner Jun 27, 2019
63fd512
Resolving some unit test failrues
trwegner Jun 28, 2019
6b16190
Simplify map to list
trwegner Jun 28, 2019
5afafcc
Addressing final set of unit test failures
trwegner Jul 2, 2019
d15c9f5
Updating for feedback
trwegner Jul 2, 2019
e8ae3ed
Merging upstream master
trwegner Jul 2, 2019
26d6045
Addressing tests that were relying on specific order
trwegner Jul 2, 2019
eaffa3c
Updating for feedback
trwegner Jul 9, 2019
b79920a
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jul 10, 2019
73013e3
Merging upstream master
trwegner Jul 10, 2019
76b7ee4
Addressing merge issues
trwegner Jul 10, 2019
39356fc
Resolving build and test failures introduced in merge
trwegner Jul 11, 2019
ac06f52
Merging upstream master
trwegner Jul 11, 2019
85e24e9
Resolving additional build and test issues
trwegner Jul 11, 2019
aa3bc31
Fixing unresolved dependencies
trwegner Jul 11, 2019
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
9 changes: 8 additions & 1 deletion samples/Exporters/TestApplicationInsights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
using System.Threading;
using Microsoft.ApplicationInsights.Extensibility;
using OpenTelemetry.Exporter.ApplicationInsights;
using OpenTelemetry.Internal;
using OpenTelemetry.Stats;
using OpenTelemetry.Stats.Aggregations;
using OpenTelemetry.Stats.Measures;
using OpenTelemetry.Tags;
using OpenTelemetry.Trace;
using OpenTelemetry.Trace.Export;
using OpenTelemetry.Trace.Sampler;

internal class TestApplicationInsights
Expand All @@ -34,8 +36,11 @@ internal class TestApplicationInsights

internal static object Run()
{
SimpleEventQueue eventQueue = new SimpleEventQueue();
ExportComponent exportComponent = ExportComponent.CreateWithInProcessStores(eventQueue);

TelemetryConfiguration.Active.InstrumentationKey = "instrumentation-key";
var exporter = new ApplicationInsightsExporter(Tracing.ExportComponent, Stats.ViewManager, TelemetryConfiguration.Active);
var exporter = new ApplicationInsightsExporter(exportComponent, Stats.ViewManager, TelemetryConfiguration.Active);
exporter.Start();

var tagContextBuilder = tagger.CurrentBuilder.Put(FrontendKey, TagValue.Create("mobile-ios9.3.5"));
Expand Down Expand Up @@ -67,6 +72,8 @@ internal static object Run()
Console.WriteLine("Done... wait for events to arrive to backend!");
Console.ReadLine();

exportComponent.SpanExporter.Dispose();

return null;
}
}
Expand Down
4 changes: 2 additions & 2 deletions samples/Exporters/TestHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using OpenTelemetry.Collector.Dependencies;
using OpenTelemetry.Exporter.Zipkin;
using OpenTelemetry.Trace;
using OpenTelemetry.Context.Propagation;
using OpenTelemetry.Trace.Export;
using OpenTelemetry.Trace.Sampler;

internal class TestHttpClient
Expand All @@ -24,7 +24,7 @@ internal static object Run()
Endpoint = new Uri("https://zipkin.azurewebsites.net/api/v2/spans"),
ServiceName = typeof(Program).Assembly.GetName().Name,
},
Tracing.ExportComponent);
ExportComponent.NewNoopExportComponent);
exporter.Start();

var scope = tracer.SpanBuilder("incoming request").SetSampler(Samplers.AlwaysSample).StartScopedSpan();
Expand Down
30 changes: 18 additions & 12 deletions samples/Exporters/TestRedis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using System.Threading;
using OpenTelemetry.Collector.StackExchangeRedis;
using OpenTelemetry.Exporter.Zipkin;
using OpenTelemetry.Internal;
using OpenTelemetry.Trace;
using OpenTelemetry.Trace.Export;
using OpenTelemetry.Trace.Config;
using OpenTelemetry.Trace.Sampler;
using StackExchange.Redis;
Expand All @@ -14,19 +16,23 @@ internal class TestRedis
{
internal static object Run(string zipkinUri)
{
// 0. Initialization
SimpleEventQueue eventQueue = new SimpleEventQueue();
ExportComponent exportComponent = ExportComponent.CreateWithInProcessStores(eventQueue);

// 1. Configure exporter to export traces to Zipkin
var exporter = new ZipkinTraceExporter(
new ZipkinTraceExporterOptions()
{
Endpoint = new Uri(zipkinUri),
ServiceName = "tracing-to-zipkin-service",
},
Tracing.ExportComponent);
exportComponent);
exporter.Start();

// 2. Configure 100% sample rate for the purposes of the demo
var traceConfig = Tracing.TraceConfig;
var currentConfig = traceConfig.ActiveTraceParams;
ITraceConfig traceConfig = new TraceConfig();
ITraceParams currentConfig = traceConfig.ActiveTraceParams;
var newConfig = currentConfig.ToBuilder()
.SetSampler(Samplers.AlwaysSample)
.Build();
Expand All @@ -36,44 +42,44 @@ internal static object Run(string zipkinUri)
// but if not - you can use it as follows:
var tracer = Tracing.Tracer;

var collector = new StackExchangeRedisCallsCollector(null, tracer, null, Tracing.ExportComponent);
var collector = new StackExchangeRedisCallsCollector(null, tracer, null, exportComponent);

// connect to the server
var connection = ConnectionMultiplexer.Connect("localhost:6379");
ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("localhost:6379");
connection.RegisterProfiler(collector.GetProfilerSessionsFactory());

// select a database (by default, DB = 0)
var db = connection.GetDatabase();
IDatabase db = connection.GetDatabase();


// 4. Create a scoped span. It will end automatically when using statement ends
using (var scope = tracer.SpanBuilder("Main").StartScopedSpan())
{
Console.WriteLine("About to do a busy work");
for (var i = 0; i < 10; i++)
for (int i = 0; i < 10; i++)
{
DoWork(db, i);
}
}

// 5. Gracefully shutdown the exporter so it'll flush queued traces to Zipkin.
Tracing.ExportComponent.SpanExporter.Dispose();
exportComponent.SpanExporter.Dispose();

return null;
}

private static void DoWork(IDatabase db, int i)
{
// 6. Get the global singleton Tracer object
var tracer = Tracing.Tracer;
ITracer tracer = Tracing.Tracer;

// 7. Start another span. If another span was already started, it'll use that span as the parent span.
// In this example, the main method already started a span, so that'll be the parent span, and this will be
// a child span.
using (var scope = tracer.SpanBuilder("DoWork").StartScopedSpan())
using (OpenTelemetry.Context.IScope scope = tracer.SpanBuilder("DoWork").StartScopedSpan())
{
// Simulate some work.
var span = tracer.CurrentSpan;
ISpan span = tracer.CurrentSpan;

try
{
Expand All @@ -83,7 +89,7 @@ private static void DoWork(IDatabase db, int i)
Thread.Sleep(1000);

// run a command, in this case a GET
var myVal = db.StringGet("key");
RedisValue myVal = db.StringGet("key");

Console.WriteLine(myVal);

Expand Down
5 changes: 3 additions & 2 deletions samples/Exporters/TestStackdriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using OpenTelemetry.Stats.Measures;
using OpenTelemetry.Tags;
using OpenTelemetry.Trace;
using OpenTelemetry.Trace.Export;
using OpenTelemetry.Trace.Sampler;

internal class TestStackdriver
Expand All @@ -34,8 +35,8 @@ internal class TestStackdriver
internal static object Run(string projectId)
{
var exporter = new StackdriverExporter(
projectId,
Tracing.ExportComponent,
projectId,
ExportComponent.NewNoopExportComponent,
Stats.ViewManager);
exporter.Start();

Expand Down
22 changes: 14 additions & 8 deletions samples/Exporters/TestZipkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@
using System.Collections.Generic;
using System.Threading;
using OpenTelemetry.Exporter.Zipkin;
using OpenTelemetry.Internal;
using OpenTelemetry.Trace;
using OpenTelemetry.Trace.Config;
using OpenTelemetry.Trace.Export;
using OpenTelemetry.Trace.Sampler;

internal class TestZipkin
{
internal static object Run(string zipkinUri)
{
// 0. Initialization
SimpleEventQueue eventQueue = new SimpleEventQueue();
ExportComponent exportComponent = ExportComponent.CreateWithInProcessStores(eventQueue);

// 1. Configure exporter to export traces to Zipkin
var exporter = new ZipkinTraceExporter(
new ZipkinTraceExporterOptions()
{
Endpoint = new Uri(zipkinUri),
ServiceName = "tracing-to-zipkin-service",
},
Tracing.ExportComponent);
exportComponent);
exporter.Start();

// 2. Configure 100% sample rate for the purposes of the demo
var traceConfig = Tracing.TraceConfig;
var currentConfig = traceConfig.ActiveTraceParams;
ITraceConfig traceConfig = new TraceConfig();
ITraceParams currentConfig = traceConfig.ActiveTraceParams;
var newConfig = currentConfig.ToBuilder()
.SetSampler(Samplers.AlwaysSample)
.Build();
Expand All @@ -38,30 +44,30 @@ internal static object Run(string zipkinUri)
using (var scope = tracer.SpanBuilder("Main").StartScopedSpan())
{
Console.WriteLine("About to do a busy work");
for (var i = 0; i < 10; i++)
for (int i = 0; i < 10; i++)
{
DoWork(i);
}
}

// 5. Gracefully shutdown the exporter so it'll flush queued traces to Zipkin.
Tracing.ExportComponent.SpanExporter.Dispose();
exportComponent.SpanExporter.Dispose();

return null;
}

private static void DoWork(int i)
{
// 6. Get the global singleton Tracer object
var tracer = Tracing.Tracer;
ITracer tracer = Tracing.Tracer;

// 7. Start another span. If another span was already started, it'll use that span as the parent span.
// In this example, the main method already started a span, so that'll be the parent span, and this will be
// a child span.
using (var scope = tracer.SpanBuilder("DoWork").StartScopedSpan())
using (OpenTelemetry.Context.IScope scope = tracer.SpanBuilder("DoWork").StartScopedSpan())
{
// Simulate some work.
var span = tracer.CurrentSpan;
ISpan span = tracer.CurrentSpan;

try
{
Expand Down
39 changes: 0 additions & 39 deletions src/OpenTelemetry.Abstractions/Stats/IStatsComponent.cs

This file was deleted.

41 changes: 0 additions & 41 deletions src/OpenTelemetry.Abstractions/Tags/ITagsComponent.cs

This file was deleted.

This file was deleted.

Loading