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

Event Counter metric support for ingestion response time #1796

Merged
merged 19 commits into from
Apr 28, 2020

Conversation

rajkumar-rangaraj
Copy link
Member

@rajkumar-rangaraj rajkumar-rangaraj commented Apr 17, 2020

Addressing Proposal 3 for issue #1735.

Changes

  • Added IngestionEndpoint-ResponseTimeMsec to CoreEventSource
  • Modified SendAsync in Transmission.cs to track ingestion response time and log to CoreEventSource as IngestionEndpoint-ResponseTimeMsec

Analysis

Ran below program and collected dotnet-trace

class Program 
{
 static void Main(string[] args) 
 {
  TelemetryConfiguration configuration = TelemetryConfiguration.CreateDefault();
  configuration.InstrumentationKey = "IKEY";
  var telemetryClient = new TelemetryClient(configuration);

  // Send IngestionEndpoint-ResponseTimeMsec metric to application insights
  var module = new EventCounterCollectionModule();
  module.Counters.Add(new EventCounterCollectionRequest("Microsoft-ApplicationInsights-Core", "IngestionEndpoint-ResponseTimeMsec"));
  module.Initialize(configuration);

  for (int i = 1; i <= 600; i++) 
  {
   telemetryClient.TrackTrace("App Insights Test" + i);
  }

  telemetryClient.Flush();
  Console.ReadLine();
 }
}

Used below command to collect dotnet-trace on provider Microsoft-ApplicationInsights-Core.

dotnet-trace collect --process-id 1024 --providers Microsoft-ApplicationInsights-Core:0:1:EventCounterIntervalSec=1     
Provider Name                           Keywords            Level               Enabled By
Microsoft-ApplicationInsights-Core      0x0000000000000000  Critical(1)         --providers

Process        : D:\Test.exe
Output File    : D:\trace.nettrace

[00:00:00:32]   Recording trace 1.4384   (MB)
Press <Enter> or <Ctrl+C> to exit...

Trace completed.

Used Perfview to parse trace.nettrace . Metric data for ingestion response time is logged.

EventCounters

image

EventData

image

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

@rajkumar-rangaraj rajkumar-rangaraj marked this pull request as ready for review April 17, 2020 03:36
Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Thanks for getting this started! Added couple feedback.

@rajkumar-rangaraj rajkumar-rangaraj changed the title Rajrang/eventcounter Event Counter metric support for breeze ingestion time Apr 21, 2020
@rajkumar-rangaraj rajkumar-rangaraj changed the title Event Counter metric support for breeze ingestion time Event Counter metric support for breeze response time Apr 21, 2020
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Looks good - can you unit test for EventCounter part?

@rajkumar-rangaraj rajkumar-rangaraj changed the title Event Counter metric support for breeze response time Event Counter metric support for ingestion response time Apr 27, 2020
@rajkumar-rangaraj rajkumar-rangaraj merged commit 53ea6f5 into develop Apr 28, 2020
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.

None yet

2 participants