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

Improving pre-aggregated Standard Metrics in SDK #1233

Closed
cijothomas opened this issue Oct 3, 2019 · 4 comments
Closed

Improving pre-aggregated Standard Metrics in SDK #1233

cijothomas opened this issue Oct 3, 2019 · 4 comments

Comments

@cijothomas
Copy link
Contributor

cijothomas commented Oct 3, 2019

Background read: https://docs.microsoft.com/en-us/azure/azure-monitor/app/pre-aggregated-metrics-log-metrics

The UI screenshots in this post are from Metric Explorer.

The default configuration of SDK (when used with Web, AspNetCore or WorkerService nugets) adds a special telemetry processor called AutocollectedMetricsExtractor before sampling processors. This processor inspects every Request and Dependency telemetry items, and aggregates them with key dimension. This pre-agg metric is sent to Application Insights once every min, and are available to query under StandardMetrics->Server in metric explorer.

As this metric is calculated before sampling, these metrics are superior in terms of accuracy.
There are 5 standard metrics which are populated from the above.
image

They are:
Dependency Calls - Count of dep calls.
Dependency duration - Duration of dep calls
Server request - Count of incoming Server request
Server response time - Duration of Server requests
Server request rate - Derived metric from server request count showing requests/sec.

As explained in the docs, these counters are sent with certain key dimensions only. (instead of entire dimensions available in log-based metrics). In UI, these dimensions allow splitting the metric chart, and Alerting allows alerting based on these dimensions.

For Requests, currently the only dimension populated by SDK is 'successful request', even though the UI lists 6 dimensions.
image

For Dependencies, SDK populates dimensions Dependency type and Sucessful call, though UI lists 6 dimensions.
image

As SDK pre-aggregation did not add all the dimensions supported in UI, it was not possible to split the charts using these dimensions. (eg: it is not possible to split based on cloudRoleInstance)

We plan to improve the metric experience for the Standard Metrics, by adding more dimension to the SDK pre-aggregators.

This will be done in several steps:
1 Add dimensions which are low/fixed cardinality like CloudRoleName, CloudRoleInstance, Dependency/Request performance, real/synthetic. Users will be allowed to pick a max limit to the number of values for these. (similar to MaxDependencyTypesToDiscover)

  1. Add dimensions like OperationName, DependencyName which can potentially be high cardinality. We'll provide option for user to configure this. For example, user could say configure a regex on the OperationName before applying it as a dimension. (these needs to designed)

  2. Allow users to add any custom dimensions. (this also need to be designed)

#1 is planned to be addressed soon (in 2.12.0 version of SDK (to be released as stable by end of year, with betas before)
#2, #3 will follow later. (no ETAs)

@cijothomas
Copy link
Contributor Author

@Dawgfan

@cijothomas
Copy link
Contributor Author

Dependency.Target and Dependency.ResultCode are additional being enabled in backend, hence SDKs should also add them as dimensions.

@cijothomas
Copy link
Contributor Author

cijothomas commented Nov 18, 2019

2.12.0-beta2 shipped with the following pre-aggregated standard metrics:

"Server response time" with dimensions:
"Request.Success"
"cloud/roleInstance"
"cloud/roleName"
"request/resultCode"
"request/performanceBucket"
"operation/synthetic"

“Dependency duration” with dimensions:
"Dependency.Success"
"cloud/roleInstance"
"cloud/roleName"
"Dependency.Type"
"dependency/target"
"operation/synthetic"
"dependency/performanceBucket"

Additional metric are generated from the above by the back end, leading the following full list of metrics:
image

@cijothomas
Copy link
Contributor Author

Closing this as the original requirements are met. We'll create new issue to track adding more user-defined dimensions.

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

No branches or pull requests

1 participant