Comments (2)
Hey @kzhou57! 👋 I'm here to help you with any bugs, questions, or contributions you have for the project. Just give me a shout if you need anything!
To resolve the AxiosError: Request failed with status code 500
on the projects page and the SQL query execution errors in the Grafana DORA dashboard, follow these steps:
-
Check Data Sources: Ensure that the required data sources (
Deployments
,Pull Requests
,Incidents
) are correctly set up and connected in Grafana. These data sources should be from Jenkins, GitLab CI, GitHub Action, webhook, Jira issues, GitHub issues, TAPD issues, PagerDuty Incidents, etc. -
Define Transformations: Make sure that the
deployments
andincidents
are defined in the data transformations while configuring the blueprint of a project. This is crucial for the SQL queries to fetch the correct data. -
Validate SQL Queries: Ensure that the SQL queries used in the Grafana panels are correct and can execute without errors. Here is an example of a SQL query used in the DORA dashboard:
-- Metric 1: Deployment Frequency with last_few_calendar_months as( -- construct the last few calendar months within the selected time period in the top-right corner SELECT CAST(($__timeTo()-INTERVAL (H+T+U) DAY) AS date) day FROM ( SELECT 0 H UNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300 ) H CROSS JOIN ( SELECT 0 T UNION ALL SELECT 10 UNION ALL SELECT 20 UNION ALL SELECT 30 UNION ALL SELECT 40 UNION ALL SELECT 50 UNION ALL SELECT 60 UNION ALL SELECT 70 UNION ALL SELECT 80 UNION ALL SELECT 90 ) T CROSS JOIN ( SELECT 0 U UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 ) U WHERE ($__timeTo()-INTERVAL (H+T+U) DAY) > $__timeFrom() ), _production_deployment_days as( -- When deploying multiple commits in one pipeline, GitLab and BitBucket may generate more than one deployment. However, DevLake consider these deployments as ONE production deployment and use the last one's finished_date as the finished date. SELECT cdc.cicd_deployment_id as deployment_id, max(DATE(cdc.finished_date)) as day FROM cicd_deployment_commits cdc JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 'cicd_scopes' WHERE pm.project_name in (${project}) and cdc.result = 'SUCCESS' and cdc.environment = 'PRODUCTION' GROUP BY 1 ), _days_weekly_deploy as( -- calculate the number of deployment days every week SELECT date(DATE_ADD(last_few_calendar_months.day, INTERVAL -WEEKDAY(last_few_calendar_months.day) DAY)) as week, MAX(if(_production_deployment_days.day is not null, 1, 0)) as weeks_deployed, COUNT(distinct _production_deployment_days.day) as days_deployed FROM last_few_calendar_months LEFT JOIN _production_deployment_days ON _production_deployment_days.day = last_few_calendar_months.day GROUP BY week ), _days_monthly_deploy as( -- calculate the number of deployment days every month SELECT date(DATE_ADD(last_few_calendar_months.day, INTERVAL -DAY(last_few_calendar_months.day)+1 DAY)) as month, MAX(if(_production_deployment_days.day is not null, 1, null)) as months_deployed, COUNT(distinct _production_deployment_days.day) as days_deployed FROM last_few_calendar_months LEFT JOIN _production_deployment_days ON _production_deployment_days.day = last_few_calendar_months.day GROUP BY month ), _days_six_months_deploy AS ( SELECT month, SUM(days_deployed) OVER ( ORDER BY month ROWS BETWEEN 5 PRECEDING AND CURRENT ROW ) AS days_deployed_per_six_months, COUNT(months_deployed) OVER ( ORDER BY month ROWS BETWEEN 5 PRECEDING AND CURRENT ROW ) AS months_deployed_count, ROW_NUMBER() OVER ( PARTITION BY DATE_FORMAT(month, '%Y-%m') DIV 6 ORDER BY month DESC ) AS rn FROM _days_monthly_deploy ), _median_number_of_deployment_days_per_week_ranks as( SELECT *, percent_rank() over(order by days_deployed) as ranks FROM _days_weekly_deploy ), _median_number_of_deployment_days_per_week as( SELECT max(days_deployed) as median_number_of_deployment_days_per_week FROM _median_number_of_deployment_days_per_week_ranks WHERE ranks <= 0.5 ), _median_number_of_deployment_days_per_month_ranks as( SELECT *, percent_rank() over(order by days_deployed) as ranks FROM _days_monthly_deploy ), _median_number_of_deployment_days_per_month as( SELECT max(days_deployed) as median_number_of_deployment_days_per_month FROM _median_number_of_deployment_days_per_month_ranks WHERE ranks <= 0.5 ), _days_per_six_months_deploy_by_filter AS ( SELECT month, days_deployed_per_six_months, months_deployed_count FROM _days_six_months_deploy WHERE rn%6 = 1 ), _median_number_of_deployment_days_per_six_months_ranks as( SELECT *, percent_rank() over(order by days_deployed_per_six_months) as ranks FROM _days_per_six_months_deploy_by_filter ), _median_number_of_deployment_days_per_six_months as( SELECT min(days_deployed_per_six_months) as median_number_of_deployment_days_per_six_months, min(months_deployed_count) as is_collected FROM _median_number_of_deployment_days_per_six_months_ranks WHERE ranks >= 0.5 ) SELECT CASE WHEN ('$dora_report') = '2023' THEN CASE WHEN median_number_of_deployment_days_per_week >= 7 THEN CONCAT(median_number_of_deployment_days_per_week, ' deployment days per week(elite)') WHEN median_number_of_deployment_days_per_week >= 1 THEN CONCAT(median_number_of_deployment_days_per_week, ' deployment days per week(high)') WHEN median_number_of_deployment_days_per_month >= 1 THEN CONCAT(median_number_of_deployment_days_per_month, ' deployment days per month(medium)') WHEN median_number_of_deployment_days_per_month < 1 and is_collected is not null THEN CONCAT(median_number_of_deployment_days_per_month, ' deployment days per month(low)') ELSE "N/A. Please check if you have collected deployments." END WHEN ('$dora_report') = '2021' THEN CASE WHEN median_number_of_deployment_days_per_week >= 7 THEN CONCAT(median_number_of_deployment_days_per_week, ' deployment days per week(elite)') WHEN median_number_of_deployment_days_per_month >= 1 THEN CONCAT(median_number_of_deployment_days_per_month, ' deployment days per month(high)') WHEN median_number_of_deployment_days_per_six_months >= 1 THEN CONCAT(median_number_of_deployment_days_per_six_months, ' deployment days per six months(medium)') WHEN median_number_of_deployment_days_per_six_months < 1 and is_collected is not null THEN CONCAT(median_number_of_deployment_days_per_six_months, ' deployment days per six months(low)') ELSE "N/A. Please check if you have collected deployments." END ELSE 'Invalid dora report' END AS 'Deployment Frequency' FROM _median_number_of_deployment_days_per_week, _median_number_of_deployment_days_per_month, _median_number_of_deployment_days_per_six_months
-
Validate and Debug: Use the DORA validation dashboard to validate and debug the dashboard. This can help identify any issues with the data or queries.
By following these steps, you should be able to resolve the AxiosError: Request failed with status code 500
and the SQL query execution errors in the Grafana DORA dashboard [1].
To continue talking to Dosu, mention @dosu.
from incubator-devlake.
Please check if your database system is up and running.
from incubator-devlake.
Related Issues (20)
- [Bug][Devlake][GitHub] GitHub app connection data source usability issues HOT 8
- [Bug][DORA] Change failure rate regression HOT 4
- [Doc][Developer Docs] Developer docs assume that users use git - they should also talk about source releases HOT 2
- [Refactor][Time Range] Allow Sync policy Time Range to be set objectively HOT 2
- [Question][GitHub] GitOps-like repos belonging to multiple projects. HOT 2
- Axios Error 504 HOT 3
- [Bug][Webhook] Can't associate an existing webhook with a project HOT 4
- [BUG].[REFDIFF].[PLUGIN] - 'SELECT * FROM refs ORDER BY created_date desc' taking too long HOT 6
- [Bug][GitHub] wrong pipeline name column if run-name is defined HOT 2
- [Bug][Jira][REST API] Unable to set up Jira connection via API due to token length issue HOT 4
- [Bug][Onboard] Option `enableGraphQL` is disabled by default. HOT 1
- [Bug][GitHub] Missing Pull Request data when changing the Time Range in Sync Policy HOT 1
- [Feature][Jira issue changelogs] Add customized jira account fields to table.accounts HOT 1
- [Bug][Sonarcloud] Error 1406 (22001): Data too long for column 'project_key' at row 1 HOT 7
- [Bug][GitLab] Sometimes Project data are automatically deleted. HOT 2
- [Bug][cicd_pipelines] Fix pipelines with Github HOT 11
- [Bug][Gitlab] v1.0.1-beta2 Data Time Range not working HOT 13
- [Bug][CircleCI Plugin] Only collecting first page of API responses HOT 6
- [Bug][Config UI] AxiosError: Request failed with status code 502 HOT 4
- [Bug][Gitlab] Component and File-Level Metrics not displaying HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-devlake.