-
Notifications
You must be signed in to change notification settings - Fork 287
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
Enable SDK to create package for auto-instrumentation #2365
Conversation
…ights-dotnet into rajrang/redfield
...nInsights/Extensibility/Implementation/Tracing/DiagnosticsModule/DiagnosticsEventListener.cs
Outdated
Show resolved
Hide resolved
BASE/src/Microsoft.ApplicationInsights/Microsoft.ApplicationInsights.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some suggestions.
...ghts/Extensibility/Implementation/Tracing/FileDiagnosticsModule/TraceSourceForEventSource.cs
Show resolved
Hide resolved
WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs
Show resolved
Hide resolved
...rosoft.ApplicationInsights.Tests/Extensibility/Implementation/Tracing/CoreEventSourceTest.cs
Show resolved
Hide resolved
Note: Won't be able to support https://github.com/microsoft/ApplicationInsights-dotnet/pull/2185/files with this change |
We added a redfied sanity check in GitHub actions. This ensures builds are not broken with new changes. This is a temporary workaround until we resolve the DiagnosticSource versioning issue. We will remove these changes once the DiagnosticSource issue is resolved. |
run: dotnet restore ./BASE/Microsoft.ApplicationInsights.sln | ||
|
||
- name: Build | ||
run: dotnet build -p:Redfield=True ./BASE/Microsoft.ApplicationInsights.sln --configuration Release --no-restore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only building Base sdk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running our full test suite here will fail.
We have too many flaky tests and Github Actions does not have a mechanism for retries.
(I'm investigating this in #2345)
If we want to run more test projects here, we must filter those tests.
@@ -52,7 +52,11 @@ private static bool Initialize() | |||
{ | |||
try | |||
{ | |||
#if REDFIELD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an issue to completely remove this class. it should not be required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigated a little and found methods from this class is called in several places.
For example Tryrun is called in OperationCorrelationTelemetryInitializer.cs
.
Did I understand your comment incorrectly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea all the places where this ActivityExtensions is used can be modified to directly use Activity API, instead of doing it via this class.
BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/RichPayloadEventSource.cs
Show resolved
Hide resolved
@@ -7,7 +7,11 @@ | |||
/// <summary> | |||
/// ETW EventSource tracing class. | |||
/// </summary> | |||
#if REDFIELD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for a separate PR , this file seems doing nothing and could be removed!
I think we can support PRs like the above, by doing it inside IF !REDFIELD check, as we'll have 5.0.0 of DS when not-redfield. |
Thanks @TimothyMothra for the PoC
To upgrade Application Insights SDK for .NET Core instrumentation following are the requirements and this PR propose the changes for it.
System.Diagnostics.DiagnosticSource
package reference to4.7.0
from5.0.0
.Changes
(Please provide a brief description of the changes here.)
REDFIELD
which is used as preprocessor to decide the event source nameredfield
compilation switch to build and generate package for auto-instrumentation