Skip to content

Add guid correlation support and change activity processing#169

Merged
AndreyTretyak merged 14 commits into
masterfrom
feature/correlation-guid-support
Mar 19, 2020
Merged

Add guid correlation support and change activity processing#169
AndreyTretyak merged 14 commits into
masterfrom
feature/correlation-guid-support

Conversation

@AndreyTretyak
Copy link
Copy Markdown
Contributor

@AndreyTretyak AndreyTretyak commented Mar 17, 2020

  • Move all Activty processing into extensible activity observres
  • Add logic for supporting guid correlation id
  • Change activity API to correspond to future activity changes Improvements to the System.Diagnostics.Activity APIs dotnet/designs#98
  • Switch to using BacgroungService for Omex SF services to reduce the amount of custom code
  • Now all core for using activities inside Abstraction package, add TimedScopes package needed only to log activities

Comment thread src/Extensions/Abstractions/Activities/Processing/ActivityResultStrings.cs Outdated
Comment thread src/Extensions/Abstractions/Activities/Processing/ActivityResultStrings.cs Outdated
Comment thread src/Extensions/Abstractions/Activities/Processing/ActivityTagKeys.cs Outdated
Comment thread src/Extensions/Abstractions/Activities/TimedScope.cs Outdated
Comment thread src/Extensions/Abstractions/Activities/TimedScopesExtensions.cs Outdated
Comment thread src/Extensions/Abstractions/Activities/TimedScopesExtensions.cs
Comment thread src/Extensions/Logging/Internal/EventSource/ActivityEnhensementObserver.cs Outdated
Comment thread src/Extensions/Logging/ServiceCollectionExtensions.cs Outdated
Comment thread src/Extensions/TimedScopes/ITimedScopeEventSender.cs
AndreyTretyak and others added 4 commits March 18, 2020 13:30
…eys.cs

Co-Authored-By: Vlad Ion <vlad.ion@gmail.com>
…ltStrings.cs

Co-Authored-By: Vlad Ion <vlad.ion@gmail.com>
Co-Authored-By: Vlad Ion <vlad.ion@gmail.com>
Comment thread src/Extensions/TimedScopes/Internal/TimedScopeEventSender.cs Outdated
Comment thread src/Extensions/TimedScopes/Internal/TimedScopeEventSender.cs
Comment thread tests/Extensions/Abstractions.UnitTests/Activities/TimedScopeTests.cs Outdated
Comment thread tests/Extensions/Hosting.Services.UnitTests/ServiceAccessorTests.cs Outdated
AndreyTretyak and others added 2 commits March 18, 2020 13:40
Co-Authored-By: Vlad Ion <vlad.ion@gmail.com>
…ests.cs

Co-Authored-By: Vlad Ion <vlad.ion@gmail.com>
Comment thread src/Extensions/Abstractions/Activities/ActivityExtensions.cs
Comment thread src/Extensions/Abstractions/Activities/ActivityExtensions.cs
/// <remarks>This property would be transfered to child activity and via web requests</remarks>
[Obsolete(TransactionIdObsoleteMessage, false)]
public static Activity SetObsoleteTransactionId(this Activity activity, uint transactionId) =>
activity.AddBaggage(ObsoleteTransactionId, transactionId.ToString());
Copy link
Copy Markdown
Member

@muiriswoulfe muiriswoulfe Mar 18, 2020

Choose a reason for hiding this comment

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

ToString [](start = 60, length = 8)

Add CultureInfo.InvariantCulture as a parameter to avoid differences in behaviour on different machines #Closed

Copy link
Copy Markdown
Contributor Author

@AndreyTretyak AndreyTretyak Mar 19, 2020

Choose a reason for hiding this comment

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

Fixed. Out of curiosity does it actually does anything for int? I'm not aware of different formats for it. #Closed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are differing number systems around the world, which this could potentially get converted into. See https://en.wikipedia.org/wiki/Numeral_system#/media/File:Numeral_Systems_of_the_World.svg


In reply to: 394708563 [](ancestors = 394708563)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I was hoping we have a single standard at least in numbers :) thanks

Comment thread src/Extensions/Logging/Internal/EventSource/ActivityEnhensementObserver.cs Outdated
Comment thread src/Extensions/Logging/Internal/EventSource/OmexLogEventSender.cs
@muiriswoulfe
Copy link
Copy Markdown
Member

muiriswoulfe commented Mar 18, 2020

  	string applicationName,

The parameters here are replicated throughout and then passed directly down the hierarchy of methods as far as I can tell, which is typically considered a code smell. It would be preferable to create a property bag class and pass this around, to avoid all of the replication #Closed


Refers to: src/Extensions/Logging/Internal/EventSource/OmexLogEventSource.cs:15 in 1f380b6. [](commit_id = 1f380b6, deletion_comment = False)

Comment thread src/Extensions/Logging/Internal/Replayable/ReplayableActivityStopObserver.cs Outdated
Comment thread src/Extensions/Logging/Internal/Replayable/ReplayableActivityStopObserver.cs Outdated
Comment thread src/Extensions/TimedScopes/ITimedScopeEventSender.cs
serviceCollection.AddHostedService<ActivityObserversIntializer>();
serviceCollection.TryAddEnumerable(ServiceDescriptor.Transient<IActivityStopObserver, ActivityStopObserver>());

serviceCollection.TryAddTransient<IActivityProvider, SimpleActivityProvider>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason for the line break? In my mind, it's indicating some difference but I'm not seeing one here

Copy link
Copy Markdown
Contributor Author

@AndreyTretyak AndreyTretyak Mar 19, 2020

Choose a reason for hiding this comment

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

I've added it to split enumerable registration (hosted is also a special case of enumerable) from Transient, but I don't have a strong opinion and okay removing it if you insisting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be good to add a comment clarifying this for future readers


In reply to: 394724148 [](ancestors = 394724148)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No sure that it worth a comment, it's like splitting different blocks in method, if blank line creates confusion we can just remove it

Comment thread src/Extensions/TimedScopes/Internal/ActivityObserversIntializer.cs
Comment thread src/Extensions/TimedScopes/Internal/ActivityObserversIntializer.cs Outdated
Comment thread src/Extensions/TimedScopes/Internal/ActivityObserversIntializer.cs Outdated
Comment thread src/Extensions/TimedScopes/Internal/TimedScopeEventSender.cs
Comment thread tests/Extensions/Abstractions.UnitTests/Activities/ActivityExtensionsTests.cs Outdated
Comment thread tests/Extensions/Abstractions.UnitTests/Activities/TimedScopeTests.cs Outdated
Comment thread tests/Extensions/Hosting.Services.UnitTests/OmexHostedServiceTests.cs Outdated
Comment thread tests/Extensions/Hosting.Services.UnitTests/OmexHostedServiceTests.cs Outdated
Comment thread tests/Extensions/Hosting.Services.UnitTests/ServiceAccessorTests.cs
Comment thread tests/Extensions/TimedScopes.UnitTests/ActivityObserversIntializerTests.cs Outdated
Comment thread tests/Extensions/TimedScopes.UnitTests/ActivityObserversIntializerTests.cs Outdated
Comment thread tests/Extensions/TimedScopes.UnitTests/ServiceCollectionTests.cs
Copy link
Copy Markdown
Member

@muiriswoulfe muiriswoulfe left a comment

Choose a reason for hiding this comment

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

🕐

Comment thread tests/Extensions/TimedScopes.UnitTests/ActivityObserversIntializerTests.cs Outdated
Copy link
Copy Markdown
Member

@muiriswoulfe muiriswoulfe left a comment

Choose a reason for hiding this comment

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

:shipit:

@AndreyTretyak AndreyTretyak merged commit 2b0627d into master Mar 19, 2020
@AndreyTretyak AndreyTretyak deleted the feature/correlation-guid-support branch March 19, 2020 11:36
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.

Investigate and fix possible breaking changes in Extension projects

3 participants