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 139 #153

Merged
merged 24 commits into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 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
482c637
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jun 18, 2019
d52e985
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jun 24, 2019
b79920a
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jul 10, 2019
528375a
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jul 15, 2019
05a0a6f
Removing ExportComponent
trwegner Jul 16, 2019
e9abcd5
Merge branch 'master' into dev/twegner/issue_139
Jul 16, 2019
b2c8e70
Merge branch 'master' into dev/twegner/issue_139
Jul 22, 2019
9138c66
Merge branch 'master' into dev/twegner/issue_139
austinlparker Jul 24, 2019
2dc97b3
Merge https://github.com/open-telemetry/opentelemetry-dotnet
trwegner Jul 24, 2019
5782321
Merge branch 'master' into dev/twegner/issue_139
trwegner Jul 24, 2019
ebec9e3
Updating IExportComponent references
trwegner Jul 24, 2019
f631a4e
Updating references to ExportComponent
trwegner Jul 24, 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
8 changes: 4 additions & 4 deletions samples/Exporters/TestApplicationInsights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ internal class TestApplicationInsights
internal static object Run()
{
SimpleEventQueue eventQueue = new SimpleEventQueue();
ExportComponent exportComponent = ExportComponent.CreateWithInProcessStores(eventQueue);
ISpanExporter exporter = OpenTelemetry.Trace.Export.SpanExporter.Create();

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

var tagContextBuilder = Tagger.CurrentBuilder.Put(FrontendKey, TagValue.Create("mobile-ios9.3.5"));

Expand Down Expand Up @@ -88,7 +88,7 @@ internal static object Run()
Console.WriteLine("Done... wait for events to arrive to backend!");
Console.ReadLine();

exportComponent.SpanExporter.Dispose();
exporter.Dispose();

return null;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/Exporters/TestHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal static object Run()
Endpoint = new Uri("https://zipkin.azurewebsites.net/api/v2/spans"),
ServiceName = typeof(Program).Assembly.GetName().Name,
},
Tracing.ExportComponent);
Tracing.SpanExporter);
exporter.Start();

using (Tracer.WithSpan(Tracer.SpanBuilder("incoming request").SetSampler(Samplers.AlwaysSample).StartSpan()))
Expand Down
6 changes: 3 additions & 3 deletions samples/Exporters/TestRedis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static object Run(string zipkinUri)
Endpoint = new Uri(zipkinUri),
ServiceName = "tracing-to-zipkin-service",
},
Tracing.ExportComponent);
Tracing.SpanExporter);
exporter.Start();

// 2. Configure 100% sample rate for the purposes of the demo
Expand All @@ -51,7 +51,7 @@ internal static object Run(string zipkinUri)
// but if not - you can use it as follows:
var tracer = Tracing.Tracer;

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

// connect to the server
var connection = ConnectionMultiplexer.Connect("localhost:6379");
Expand All @@ -71,7 +71,7 @@ internal static object Run(string zipkinUri)
}

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

return null;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/Exporters/TestStackdriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal static object Run(string projectId)
{
var exporter = new StackdriverExporter(
projectId,
Tracing.ExportComponent,
Tracing.SpanExporter,
Stats.ViewManager);
exporter.Start();

Expand Down
4 changes: 2 additions & 2 deletions samples/Exporters/TestZipkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal static object Run(string zipkinUri)
Endpoint = new Uri(zipkinUri),
ServiceName = "tracing-to-zipkin-service",
},
Tracing.ExportComponent);
Tracing.SpanExporter);
exporter.Start();

// 2. Configure 100% sample rate for the purposes of the demo
Expand All @@ -60,7 +60,7 @@ internal static object Run(string zipkinUri)
}

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

return null;
}
Expand Down
29 changes: 0 additions & 29 deletions src/OpenTelemetry.Abstractions/Trace/Export/IExportComponent.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace OpenTelemetry.Collector.StackExchangeRedis
public class StackExchangeRedisCallsCollector : IDisposable
{
private readonly ITracer tracer;
private readonly IExportComponent exporter;
private readonly ISpanExporter exporter;
private readonly ISampler sampler;

private readonly CancellationTokenSource cancellationTokenSource;
Expand All @@ -46,11 +46,11 @@ public class StackExchangeRedisCallsCollector : IDisposable
/// </summary>
/// <param name="tracer">Tracer to record traced with.</param>
/// <param name="sampler">Sampler to use to sample dependnecy calls.</param>
/// <param name="exportComponent">TEMPORARY: handler to send data to.</param>
public StackExchangeRedisCallsCollector(ITracer tracer, ISampler sampler, IExportComponent exportComponent)
/// <param name="exporter">TEMPORARY: handler to send data to.</param>
public StackExchangeRedisCallsCollector(ITracer tracer, ISampler sampler, ISpanExporter exporter)
{
this.tracer = tracer;
this.exporter = exportComponent;
this.exporter = exporter;
this.sampler = sampler;

this.cancellationTokenSource = new CancellationTokenSource();
Expand Down Expand Up @@ -125,7 +125,7 @@ private void DumpEntries(object state)

foreach (var s in spans)
{
this.exporter.SpanExporter.ExportAsync(s, CancellationToken.None).Wait();
this.exporter.ExportAsync(s, CancellationToken.None).Wait();
}

Thread.Sleep(TimeSpan.FromSeconds(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ApplicationInsightsExporter

private readonly IViewManager viewManager;

private readonly IExportComponent exportComponent;
private readonly ISpanExporter exporter;

private readonly object lck = new object();

Expand All @@ -49,12 +49,12 @@ public class ApplicationInsightsExporter
/// Initializes a new instance of the <see cref="ApplicationInsightsExporter"/> class.
/// This exporter allows to send Open Census data to Azure Application Insights.
/// </summary>
/// <param name="exportComponent">Exporter to get traces and metrics from.</param>
/// <param name="exporter">Exporter to get traces and metrics from.</param>
/// <param name="viewManager">View manager to get stats from.</param>
/// <param name="telemetryConfiguration">Telemetry configuration to use to report telemetry.</param>
public ApplicationInsightsExporter(IExportComponent exportComponent, IViewManager viewManager, TelemetryConfiguration telemetryConfiguration)
public ApplicationInsightsExporter(ISpanExporter exporter, IViewManager viewManager, TelemetryConfiguration telemetryConfiguration)
{
this.exportComponent = exportComponent;
this.exporter = exporter;
this.viewManager = viewManager;
this.telemetryConfiguration = telemetryConfiguration;
}
Expand All @@ -73,7 +73,7 @@ public void Start()

this.handler = new TraceExporterHandler(this.telemetryConfiguration);

this.exportComponent.SpanExporter.RegisterHandler(TraceExporterName, this.handler);
this.exporter.RegisterHandler(TraceExporterName, this.handler);

this.tokenSource = new CancellationTokenSource();

Expand All @@ -96,7 +96,7 @@ public void Stop()
return;
}

this.exportComponent.SpanExporter.UnregisterHandler(TraceExporterName);
this.exporter.UnregisterHandler(TraceExporterName);
this.tokenSource.Cancel();
this.workerThread.Wait();
this.tokenSource = null;
Expand Down
12 changes: 6 additions & 6 deletions src/OpenTelemetry.Exporter.Ocagent/OcagentExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class OcagentExporter
{
private const string TraceExporterName = "OcagentTraceExporter";

private readonly IExportComponent exportComponent;
private readonly ISpanExporter exporter;

private readonly object lck = new object();

Expand All @@ -41,17 +41,17 @@ public class OcagentExporter
/// Initializes a new instance of the <see cref="OcagentExporter"/> class.
/// This exporter allows to send Open Census data to OpenTelemetry service or LocalForwarder.
/// </summary>
/// <param name="exportComponent">Exporter to get traces from.</param>
/// <param name="exporter">Exporter to get traces from.</param>
/// <param name="agentEndpoint">Agent endpoint in the host:port format.</param>
/// <param name="hostName">Name of the host.</param>
/// <param name="serviceName">Name of the application.</param>
public OcagentExporter(
IExportComponent exportComponent,
ISpanExporter exporter,
string agentEndpoint,
string hostName,
string serviceName)
{
this.exportComponent = exportComponent;
this.exporter = exporter;
this.agentEndpoint = agentEndpoint;
this.hostName = hostName;
this.serviceName = serviceName;
Expand All @@ -75,7 +75,7 @@ public void Start()
this.serviceName,
ChannelCredentials.Insecure);

this.exportComponent.SpanExporter.RegisterHandler(TraceExporterName, this.handler);
this.exporter.RegisterHandler(TraceExporterName, this.handler);
}
}

Expand All @@ -91,7 +91,7 @@ public void Stop()
return;
}

this.exportComponent.SpanExporter.UnregisterHandler(TraceExporterName);
this.exporter.UnregisterHandler(TraceExporterName);
this.handler.Dispose();
this.handler = null;
}
Expand Down
22 changes: 11 additions & 11 deletions src/OpenTelemetry.Exporter.Stackdriver/StackdriverExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class StackdriverExporter
{
private const string ExporterName = "StackdriverTraceExporter";

private readonly IExportComponent exportComponent;
private readonly ISpanExporter exporter;
private readonly IViewManager viewManager;
private readonly string projectId;
private readonly string jsonPath;
Expand All @@ -42,12 +42,12 @@ public class StackdriverExporter
/// Initializes a new instance of the <see cref="StackdriverExporter"/> class.
/// </summary>
/// <param name="projectId">Google Cloud ProjectId that is used to send data to Stackdriver.</param>
/// <param name="exportComponent">Exporter to get traces from.</param>
/// <param name="exporter">Exporter to get traces from.</param>
/// <param name="viewManager">View manager to get the stats from.</param>
public StackdriverExporter(
string projectId,
IExportComponent exportComponent,
IViewManager viewManager) : this(projectId, null, exportComponent, viewManager)
ISpanExporter exporter,
IViewManager viewManager) : this(projectId, null, exporter, viewManager)
{
}

Expand All @@ -56,19 +56,19 @@ public StackdriverExporter(
/// </summary>
/// <param name="projectId">Google Cloud ProjectId that is used to send data to Stackdriver.</param>
/// <param name="jsonPath">File path to the json file containing the service credential used to authenticate against Stackdriver APIs.</param>
/// <param name="exportComponent">Exporter to get traces from.</param>
/// <param name="exporter">Exporter to get traces from.</param>
/// <param name="viewManager">View manager to get the stats from.</param>
public StackdriverExporter(
string projectId,
string jsonPath,
IExportComponent exportComponent,
ISpanExporter exporter,
IViewManager viewManager)
{
GaxPreconditions.CheckNotNullOrEmpty(projectId, "projectId");

this.projectId = projectId;
this.jsonPath = jsonPath;
this.exportComponent = exportComponent;
this.exporter = exporter;
this.viewManager = viewManager;
}

Expand All @@ -85,10 +85,10 @@ public void Start()
}

// Register trace exporter
if (this.exportComponent != null)
if (this.exporter != null)
{
var traceExporter = new StackdriverTraceExporter(this.projectId);
this.exportComponent.SpanExporter.RegisterHandler(ExporterName, traceExporter);
this.exporter.RegisterHandler(ExporterName, traceExporter);
}

// Register stats(metrics) exporter
Expand Down Expand Up @@ -125,9 +125,9 @@ public void Stop()
}

// Stop tracing exporter
if (this.exportComponent != null)
if (this.exporter != null)
{
this.exportComponent.SpanExporter.UnregisterHandler(ExporterName);
this.exporter.UnregisterHandler(ExporterName);
}

// Stop metrics exporter
Expand Down
12 changes: 6 additions & 6 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinTraceExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ZipkinTraceExporter

private readonly ZipkinTraceExporterOptions options;

private readonly IExportComponent exportComponent;
private readonly ISpanExporter exporter;

private readonly object lck = new object();

Expand All @@ -42,16 +42,16 @@ public class ZipkinTraceExporter
/// This exporter sends Open Census traces to Zipkin.
/// </summary>
/// <param name="options">Zipkin exporter configuration options.</param>
/// <param name="exportComponent">Exporter to get traces from.</param>
/// <param name="exporter">Exporter to get traces from.</param>
/// <param name="client">Http client to use to upload telemetry.
/// For local development with invalid certificates use code like this:
/// new HttpClient(new HttpClientHandler() { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator }).
/// </param>
public ZipkinTraceExporter(ZipkinTraceExporterOptions options, IExportComponent exportComponent, HttpClient client = null)
public ZipkinTraceExporter(ZipkinTraceExporterOptions options, ISpanExporter exporter, HttpClient client = null)
{
this.options = options;

this.exportComponent = exportComponent;
this.exporter = exporter;

this.httpClient = client;
}
Expand All @@ -70,7 +70,7 @@ public void Start()

this.handler = new TraceExporterHandler(this.options, this.httpClient);

this.exportComponent.SpanExporter.RegisterHandler(ExporterName, this.handler);
this.exporter.RegisterHandler(ExporterName, this.handler);
}
}

Expand All @@ -86,7 +86,7 @@ public void Stop()
return;
}

this.exportComponent.SpanExporter.UnregisterHandler(ExporterName);
this.exporter.UnregisterHandler(ExporterName);

this.handler = null;
}
Expand Down
Loading