microsoft / microsoft/ApplicationInsights-JS
[TrackMetric] The `average` of the `trackMetric` call is sent as `value` which seems wrong
- Dominant language
- TypeScript
- Stars
- 685
- Forks
- 261
- Avg merge
- 21h 33m
- Merged PRs (30d)
- 5
Description
The current `trackMetric` API takes an object where the property `average` shows up in the portal as `valueSum` and the internal documentation states that it is the [value or average](https://github.com/microsoft/ApplicationInsights-JS/blob/3a1fdb18d7cd9536f11de91f61957f283c7811c5/shared/AppInsightsCommon/src/Interfaces/IMetricTelemetry.ts#L15-L19).
We need to
- investigate whether this can still be defined as the "average" and stored in the Portal as an "average" value
- If it's always a value or if "can" be either, then we "should" add another optional property (to keep backward compatibility) to provide `average` or `value` and if both are provided then it should "prefer" the `average` (unless the above investigation identifies the specific case / reason why it's either)
Adding and tagging as an enhancement to review as part of the backlog when we have cycles to investigate further.
Contributor guide
Research direction
Start with shared/AppInsightsCommon/src/Interfaces/IMetricTelemetry.ts and trace how trackMetric's average property appears in the portal as valueSum. Investigate whether the value is always an average or can represent either value, then define the backward-compatible API behavior and the conditions for considering the issue complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100