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

Azure Monitor: Add 5 curated dashboards for App insights troubleshooting experience #75916

Merged
merged 18 commits into from Oct 17, 2023

Conversation

yves-chan
Copy link
Contributor

@yves-chan yves-chan commented Oct 3, 2023

What is this feature?

This PR adds some troubleshooting experiences for Azure Application Insights. It will use the new trace view for the Azure Monitor datasource to view the traces from Azure Application Insights. Included are drilldown experiences for Performance on operations and dependencies, and drill down experiences for Failures on operations, dependencies, and exceptions.

Why do we need this feature?

This feature helps customers of Grafana using Azure Application Insights troubleshoot requests by using the new Azure Monitor trace to view the trace details.

Who is this feature for?

This feature is for customers who monitor their applications using Azure Application Insights and want to troubleshoot requests, dependencies, and exceptions with the help of traces.

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

image
image

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2023

CLA assistant check
All committers have signed the CLA.

@grafana-pr-automation grafana-pr-automation bot added datasource/Azure Azure Monitor Datasource area/frontend pr/external This PR is from external contributor labels Oct 3, 2023
@yves-chan yves-chan marked this pull request as ready for review October 5, 2023 21:29
@yves-chan yves-chan requested a review from a team as a code owner October 5, 2023 21:29
@yves-chan yves-chan requested review from asimpson, bossinc, aangelisc and alyssabull and removed request for a team October 5, 2023 21:29
@yves-chan yves-chan changed the title App insights traces Dashboards: App insights traces Oct 5, 2023
@yves-chan yves-chan changed the title Dashboards: App insights traces Azure Monitor: Add 5 curated dashboards for App insights troubleshooting experience Oct 5, 2023
Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

Hi @yves-chan! Thank you for contributing! I've reviewed this and just have some changes to request:

Most of the dashboard variables e.g. operationName or resultCode should use a query that begins with search "*". Whilst this query is inefficient, it avoids errors in the dashboard where a user may not have requests that have failed and overall provides a nicer UX. WDYT?

Additionally, once this change has been made could you run prettier --fix public/app/plugins/datasource/azuremonitor to ensure the files have the correct styling.

Thank you!

@yves-chan
Copy link
Contributor Author

Hi @yves-chan! Thank you for contributing! I've reviewed this and just have some changes to request:

Most of the dashboard variables e.g. operationName or resultCode should use a query that begins with search "*". Whilst this query is inefficient, it avoids errors in the dashboard where a user may not have requests that have failed and overall provides a nicer UX. WDYT?

Additionally, once this change has been made could you run prettier --fix public/app/plugins/datasource/azuremonitor to ensure the files have the correct styling.

Thank you!

oh great idea, it is way better to have an experience without failures upon load. Let me also run the prettier fixes, I will tag you again when these changes are in :) thanks!

@yves-chan
Copy link
Contributor Author

yves-chan commented Oct 6, 2023

@aangelisc regarding the search keyword do you mind giving me an example? I'm not sure I'm using it correctly

requests
| search "*"
| where $__timeFilter(timestamp)
| where client_Type != "Browser"
| summarize count() by operation_Name

@aangelisc
Copy link
Contributor

aangelisc commented Oct 6, 2023

Hey @yves-chan, thank you for working on this so quickly. This is what I had in mind:

search "*"
| where $__timeFilter(timestamp)
| where client_Type != "Browser"
| summarize count() by operation_Name

This should be the case for all the variables to avoid empty data in dashboard panels where possible 😊

@yves-chan
Copy link
Contributor Author

yves-chan commented Oct 10, 2023

@aangelisc
ah ok I get what you mean, I actually want to keep the tables strict. But I have updated the variables to have a default value of "All" and updated the queries such that they wouldn't error out because of KQL syntax. They should be fixed now!

Screenshot 2023-10-10 101955

@yves-chan
Copy link
Contributor Author

@aangelisc Can I get another review on this please 😄 ?

@aangelisc
Copy link
Contributor

Hi @yves-chan, I still have the same issue. See the image below:

image

This is because the result_code and operation_name variable queries directly depend on the requests table and if there are no requests in the AI workspace then these queries will fail. This leads to the panels showing the failed status. It would make more sense to search all tables for potential variable values as this will show the below:

image

See my updated result_code query (operation_name would also have to be updated):
image

@yves-chan
Copy link
Contributor Author

yves-chan commented Oct 16, 2023

hey @aangelisc thanks for the follow up!

I believe that this case should be handled in the query themselves. I default a custom value of "All", which gets passed in the queries and the KQL queries should still be syntactically correct even if there's no data
image
image

For cases like the result_code variable, the requests table and the dependencies table both share the resultCode column (and the codes could be different between the two tables) , so I'm a little hesitant to use search * and would like to avoid if possible.

I haven't been able to reproduce the case where there's no data and the panel fails, are you able to inspect the query and share the request and response details for one of the failed panels?

@aangelisc

This comment was marked as outdated.

Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

Hi @yves-chan,

Never mind me, I didn't have your latest updates locally! I've checked and everything looks great now! Once the build succeeds I'll merge this. Thank you!

@aangelisc aangelisc added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes add to changelog and removed no-changelog Skip including change in changelog/release notes labels Oct 17, 2023
@aangelisc aangelisc added this to the 10.2.x milestone Oct 17, 2023
@aangelisc
Copy link
Contributor

Could you merge main please @yves-chan?

@yves-chan
Copy link
Contributor Author

@aangelisc Just merged main to this branch, thanks!

@aangelisc aangelisc enabled auto-merge (squash) October 17, 2023 16:30
@aangelisc aangelisc merged commit 8ac7736 into grafana:main Oct 17, 2023
33 checks passed
@aangelisc aangelisc modified the milestones: 10.2.x, 10.3.x Oct 17, 2023
darrenjaneczek pushed a commit that referenced this pull request Oct 23, 2023
…ing experience (#75916)

* initial changes

* fix indent

* fix some bugs, and update fit and finish

* remove inputs

* change ms.portal to portal

* add new dashboards, fix some links and queries

* fix more links

* update the default time ranges

* prettier fix dashboards

* update log query variables with search '*'

* default the variable value to All

* missed a few spots to assume that the values of the variable are in an array

* fix queries for min and max duraation as well

* keep variables naming consistent

* fix missing parenthesis in dependencies operation query

* fix some links, change todouble instead of tollong
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend datasource/Azure Azure Monitor Datasource no-backport Skip backport of PR pr/external This PR is from external contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants