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

Dev/twegner/issue 18 #111

merged 37 commits into from
Jul 12, 2019

Conversation

trwegner
Copy link
Contributor

@trwegner trwegner commented Jun 18, 2019

With last commits i'm moving from draft to actual PR. The changes are generally for removing the unnecessary component layer in the API referred to in issue #18. Removed components were primarily wrappers for a single class so largely redundant. I did encounter a number of challenges along the way since the changes introduced race conditions in several places which led to the use of concurrent-aware classes and/or locks. As a result some tests would fail randomly due to expected order in collections no longer being stable between runs. I was not able to find info in the spec indicated this was a problem so updated validation to allow varying order of results in the impacted tests.

Notes from draft PR:

@SergeyKanzhelev, @austinlparker, @lmolkova and @discostu105

Looking for feedback on these changes to ensure the work is addressing #18 appropriately. Currently still facing unit test failures in ViewManagerTest.cs and StatsRecorderTest.cs. Any observations in this area in particular would be appreciated.

trwegner added 22 commits May 13, 2019 14:53
Merging open-telemetry/opentelemetry-dotnet master
private readonly IBinaryFormat binaryFormat;
private readonly ITextFormat textFormat;

public Tracer(IRandomGenerator randomGenerator, IStartEndHandler startEndHandler, ITraceConfig traceConfig, IExportComponent exportComponent)
: this(randomGenerator, startEndHandler, traceConfig, exportComponent, null, null)

Choose a reason for hiding this comment

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

if it does not get export component, it should probably get exporter instead and use it in RecordSpanData?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great point. Have updated implementation to include exporter.

/// Gets the tracer configuration.
/// </summary>
public static ITraceConfig TraceConfig => tracing.traceComponent.TraceConfig;
public static ITracer Tracer => TracerBase.NoopTracer;

Choose a reason for hiding this comment

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

is it intended? we have to create real tracer somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another great point. Have updated implementation to create a tracer.

@trwegner trwegner marked this pull request as ready for review July 2, 2019 21:16
//[Fact(Skip = "need to fix the way tracer being instantiated")]
//public void DefaultTraceExporter()
//{
// Assert.Equal(ExportComponent.NewNoopExportComponent.GetType(), Tracing.ExportComponent.GetType());
Copy link

@lmolkova lmolkova Jul 4, 2019

Choose a reason for hiding this comment

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

is it intentionally commented? should it be returned back or fixed?
It seems export component is still there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to restore tests

@@ -51,7 +50,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<RequestsCollector>();
services.AddSingleton<DependenciesCollectorOptions>(new DependenciesCollectorOptions());
services.AddSingleton<DependenciesCollector>();
services.AddSingleton<IExportComponent>(Tracing.ExportComponent);
services.AddSingleton<IExportComponent>(ExportComponent.NewNoopExportComponent);
Copy link

Choose a reason for hiding this comment

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

i probably miss something - why do we need to register noop? It doesn't seem right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted to original

// TODO(bdrutu): Add a config/argument for supportInProcessStores.
if (eventQueue is SimpleEventQueue)
{
this.ExportComponent = Export.ExportComponent.CreateWithoutInProcessStores(eventQueue);
Copy link

Choose a reason for hiding this comment

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

so the only reason for export component are span stores?
But they are not even defined in the spec.

May be @SergeyKanzhelev could help here - why do we keep them in this repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are there additional changes I should make to address ExportComponent? It was not called out in the original issue. Should it be another issue instead?

Copy link

Choose a reason for hiding this comment

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

sure! I didn't realize it was not par of original issue, sorry about that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem :) I will add a new issue for removing ExportComponent.

@lmolkova lmolkova merged commit 4b273d4 into open-telemetry:master Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants