-
Notifications
You must be signed in to change notification settings - Fork 237
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
[BUG] trackMetric does not track stdDev nor sum #1680
Comments
Hi @stefanedwards and for more trackMetrics details, please refer https://github.com/microsoft/ApplicationInsights-JS/blob/master/AISKU/API.md#trackmetric please let us know if it works |
No, that does change the issue mentioned. I am reporting that when reporting aggregates of multiple measurements with Furthermore, thank you for the link to the documentation. But the code line in
contradicts the documentation ( |
Investigations required
|
When the SDK is updated to send the stdDev it is successfully included and displayed in the portal -- will have a PR shortly to update the trackMetric() to support the stdDev value and pass it to the backend. Still investigating the passed values not matching issue |
Ok, the issue with the average / sampleCount is because there is a different calculation between what the SDK takes and how the backend "processes" the values. Simplistically, the backend expects the total "value" of the metric and the number of events "count" and from these it calculates the "average" So, the fix is problematic... As technically the SDK should pass the |
And the backend doesn't have the ability to be passed "sum", I'm checking with the portal team on how the valueSum is calculated because of this |
- add (missing) stdDev sending for metrics
Pushed out the PR to just add stdDev as an option that is sent -- need to wait for the valueSum and above details for another PR |
Ok, the Still thinking about the "average" -> "value and "sampleCount" -> "valueCount" and the issue with the "valueMin" (and valueMax) when "sampleCount" > 1... |
The stdDev change is now published to NPM in v2.7.1, still determining the best approach for the sum / sample -- most likely will add some additional override properties to maintain backward compatibility as the "average" value is misleading but would be a breaking change |
This change is broken for the JS api. This change missed updating the constructor invocation in MetricEnvelopeCreator under EnvelopeCreator.ts and so is now passing props as the stdDev argument. All customDimensions are now lost when tracking any kind of metric. |
Well crap! |
When tracking a (custom) metric, the standard deviation is not tracked (as
valueStdDev
) andvalueSum
is identical tovalue
.Additionally, when
min
-value equals 1,Steps to Reproduce
When viewing the tracked metric in Application Insights on portal.azure.com, the values do not match what was provided.
Expected behavior
sum
.value
,valueCount
,valueSum
,valueMin
,valueMax
, andvalueStdDev
should match (within some reasonable precision) to the values submitted from the JS script.Additional context
The documentation on
appInsights.trackMetric
is entirely missing (for the JS-part), and this is my best guess for actually getting something through. A lot of other attempts (e.g.trackMetric('name',value)
didn't even raise an error -- but nothing appeared to be sent).I have further found, that the second argument to
trackMetric
can be used to send additional properties (i.e.customDimensions
), such asappInsights.trackMetric({name: 'bacon', average: 5, sampleCount: 6, min: 1, max: 15}, {PageName: "foo", "PageUrl": "/", "questionable_field": "zap" });
The text was updated successfully, but these errors were encountered: