Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

TrackMetric only works sometimes when aggregating #628

Closed
Cooke opened this issue Apr 4, 2018 · 6 comments
Closed

TrackMetric only works sometimes when aggregating #628

Cooke opened this issue Apr 4, 2018 · 6 comments

Comments

@Cooke
Copy link

Cooke commented Apr 4, 2018

Repro Steps

  1. Follow the (recommended) metric aggregation method according to https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics#aggregating-metrics
  2. Generate metrics (with http requests)

Actual Behavior

Some of none of the metrics are collected and shown in the portal.

Expected Behavior

All of the metrics are collected (or skipped due to sampling).

Work around

Make sure to explicitly set MetricTelemetry.Context.Operation.Name before calling TelemetryClient.TrackMetric

Version Info

SDK Version : 2.2.1
.NET Version : 2.1.2
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : Nuget/custom
OS : Win10 x64
Hosting Info (IIS/Azure WebApps/ etc) : console, kestrel

@cijothomas
Copy link
Contributor

@Cooke Metrics are not subject to sampling, so sampling cannot explain the issue. How do you validate that metrics are missing? Its possible are there is a latency before which they show up in portal.

Can you verify if local VisualStudio is also showing this missing behavior. ?

@Cooke
Copy link
Author

Cooke commented Apr 7, 2018

@cijothomas I validate they are missing by not showing up in the portal, and by not seeing any related output in the debug log. It is not possible that this is due to latency since I have a workaround that seems to work 100% and for which I can see the related metrics being present in the portal.

What do you mean with local VisualStudio?

@cijothomas
Copy link
Contributor

Can you share a small repro for us to dig deeper into this? It's hard to investigate without repro app. Thanks for your time! @Cooke

@Cooke
Copy link
Author

Cooke commented Apr 16, 2018

@cijothomas Maybe later, too little time now. I just wanted to let you know and share my work around. Thank you for your time and nice service!

@cijothomas
Copy link
Contributor

@Cooke Okay. The latest SDK has built-in support for aggregated metrics! It'd be awesome if you can give it a try!
New api is documented here : microsoft/ApplicationInsights-dotnet#774
The aspnet.core sdk which refers this new base sdk containing aggregation features, is 2.3.0-beta1, and will be released today on nuget.

@cijothomas
Copy link
Contributor

Closing this for now as no action pending from SDK.
Feel free to reopen if you need help or when you have a repro for further investigation.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants